diff --git a/packages/webdriverio/package.json b/packages/webdriverio/package.json index bbf9526e754..6d7a20073f3 100644 --- a/packages/webdriverio/package.json +++ b/packages/webdriverio/package.json @@ -1,7 +1,7 @@ { "name": "@testplane/webdriverio", "description": "Next-gen browser and mobile automation test framework for Node.js", - "version": "9.5.27", + "version": "9.5.28", "homepage": "https://webdriver.io", "author": "Christian Bromann ", "license": "MIT", diff --git a/packages/webdriverio/src/commands/browser/url.ts b/packages/webdriverio/src/commands/browser/url.ts index 459e7eeeabd..95919f3e026 100644 --- a/packages/webdriverio/src/commands/browser/url.ts +++ b/packages/webdriverio/src/commands/browser/url.ts @@ -216,6 +216,10 @@ export async function url ( url: path, wait }).catch((err) => { + if (options._noFallbackOnCancel) { + throw err + } + /** * It seems that WebDriver Bidi runs into issue with concurrent navigation. * @see https://github.com/w3c/webdriver-bidi/issues/878 @@ -326,4 +330,18 @@ interface UrlCommandOptions { * Checkout `browser.addPreloadScript` for a more versatile way to mock the environment. */ onBeforeLoad?: () => unknown + /** + * @internal + * + * UNSTABLE / INTERNAL — not part of the public API. May be renamed or removed at any time + * without notice and without a major version bump. Do not rely on this in user code. + * + * Used internally to disable the automatic fallback that re-issues the navigation when the + * driver reports a concurrent-navigation error (Chrome: "navigation canceled by concurrent + * navigation", Firefox: "failed with error: unknown error"). Intended for callers that + * intentionally cancelled the navigation and want the original error to propagate. + * + * @default false + */ + _noFallbackOnCancel?: boolean }