Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/helper/Playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -3557,7 +3557,11 @@ class Playwright extends Helper {
.catch(async e => {
const currUrl = await this._getPageUrl() // Required because the waitForFunction can't return data.
if (/Timeout/i.test(e.message)) {
throw new Error(`expected url to be ${urlPart}, but found ${currUrl}`)
if (urlPart !== currUrl) {
throw new Error(`expected url to be ${urlPart}, but found ${currUrl}`)
} else {
throw new Error(`expected url not loaded, error message: ${e.message}`)
}
} else {
throw e
}
Expand Down
6 changes: 5 additions & 1 deletion lib/helper/Puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2467,7 +2467,11 @@ class Puppeteer extends Helper {
.catch(async e => {
const currUrl = await this._getPageUrl() // Required because the waitForFunction can't return data.
if (/Waiting failed/i.test(e.message) || /failed: timeout/i.test(e.message)) {
throw new Error(`expected url to be ${urlPart}, but found ${currUrl}`)
if (urlPart !== currUrl) {
throw new Error(`expected url to be ${urlPart}, but found ${currUrl}`)
} else {
throw new Error(`expected url not loaded, error message: ${e.message}`)
}
} else {
throw e
}
Expand Down