* {{> waitUrlEquals }}
(urlPart, sec = null)
| 2547 | * {{> waitUrlEquals }} |
| 2548 | */ |
| 2549 | async waitUrlEquals(urlPart, sec = null) { |
| 2550 | const aSec = sec || this.options.waitForTimeoutInSeconds |
| 2551 | const expectedUrl = resolveUrl(urlPart, this.options.url) |
| 2552 | let currUrl = '' |
| 2553 | return this.browser |
| 2554 | .waitUntil(function () { |
| 2555 | return this.getUrl().then(res => { |
| 2556 | currUrl = decodeUrl(res) |
| 2557 | return currUrl === expectedUrl |
| 2558 | }) |
| 2559 | }, aSec * 1000) |
| 2560 | .catch(e => { |
| 2561 | e = wrapError(e) |
| 2562 | if (e.message.indexOf('timeout')) { |
| 2563 | throw new Error(`expected url to be ${expectedUrl}, but found ${currUrl}`) |
| 2564 | } |
| 2565 | throw e |
| 2566 | }) |
| 2567 | } |
| 2568 | |
| 2569 | /** |
| 2570 | * {{> waitCurrentPathEquals }} |
nothing calls this directly
no test coverage detected