webdriverio 9.1.0 → 9.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"newWindow.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/newWindow.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAItD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAsB,SAAS,CAC3B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,GAAG,EAAE,MAAM,EACX,EAAE,UAAe,EAAE,cAAmB,EAAE,GAAE,gBAAqB,mBA+ClE"}
1
+ {"version":3,"file":"newWindow.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/newWindow.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAItD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAsB,SAAS,CAC3B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,GAAG,EAAE,MAAM,EACX,EAAE,UAAe,EAAE,cAAmB,EAAE,GAAE,gBAAqB,mBAiDlE"}
@@ -1 +1 @@
1
- {"version":3,"file":"switchWindow.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/switchWindow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,YAAY,CAC9B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,MAAM,GAAG,MAAM,mBAiD3B"}
1
+ {"version":3,"file":"switchWindow.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/switchWindow.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,YAAY,CAC9B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,MAAM,GAAG,MAAM,mBAmD3B"}
@@ -8,6 +8,7 @@ export declare class ContextManager {
8
8
  #private;
9
9
  constructor(browser: WebdriverIO.Browser);
10
10
  initialize(): Promise<boolean>;
11
+ setCurrentContext(context: string): void;
11
12
  getCurrentContext(): Promise<string>;
12
13
  }
13
14
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAMA,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,kBAS7D;AAED;;;;GAIG;AACH,qBAAa,cAAc;;gBAKX,OAAO,EAAE,WAAW,CAAC,OAAO;IAoBlC,UAAU;IAsBV,iBAAiB;CAM1B"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAMA,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,kBAS7D;AAED;;;;GAIG;AACH,qBAAa,cAAc;;gBAKX,OAAO,EAAE,WAAW,CAAC,OAAO;IAoBlC,UAAU;IAqBhB,iBAAiB,CAAE,OAAO,EAAE,MAAM;IAI5B,iBAAiB;CAM1B"}
package/build/index.js CHANGED
@@ -3002,13 +3002,15 @@ var ContextManager = class {
3002
3002
  *
3003
3003
  * @param {local.BrowsingContextNavigationInfo} context browsing context used to navigate
3004
3004
  */
3005
- #handleNavigationStarted(context) {
3006
- this.#browser.getWindowHandle().then((windowHandle) => {
3007
- if (context.context === windowHandle) {
3008
- log4.info(`Update current context: ${context.context}`);
3009
- this.#currentContext = context.context;
3010
- }
3011
- });
3005
+ async #handleNavigationStarted(context) {
3006
+ const windowHandle = await this.#browser.getWindowHandle();
3007
+ if (context.context === windowHandle) {
3008
+ log4.info(`Update current context: ${context.context}`);
3009
+ this.#currentContext = context.context;
3010
+ }
3011
+ }
3012
+ setCurrentContext(context) {
3013
+ this.#currentContext = context;
3012
3014
  }
3013
3015
  async getCurrentContext() {
3014
3016
  if (!this.#currentContext) {
@@ -3779,7 +3781,9 @@ async function newWindow(url6, { windowName = "", windowFeatures = "" } = {}) {
3779
3781
  }
3780
3782
  const tabsBefore = await this.getWindowHandles();
3781
3783
  if (this.isBidi) {
3784
+ const contextManager2 = getContextManager(this);
3782
3785
  const { context } = await this.browsingContextCreate({ type: "window" });
3786
+ contextManager2.setCurrentContext(context);
3783
3787
  await this.browsingContextNavigate({ context, url: url6 });
3784
3788
  } else {
3785
3789
  await this.execute(newWindowHelper, url6, windowName, windowFeatures);
@@ -4071,8 +4075,10 @@ async function switchWindow(matcher) {
4071
4075
  }
4072
4076
  return !!target.match(matcher);
4073
4077
  };
4078
+ const contextManager2 = getContextManager(this);
4074
4079
  for (const tab of tabs) {
4075
4080
  await this.switchToWindow(tab);
4081
+ contextManager2.setCurrentContext(tab);
4076
4082
  const url6 = await this.getUrl();
4077
4083
  if (matchesTarget(url6)) {
4078
4084
  return tab;
@@ -4878,10 +4884,11 @@ var ShadowRootManager = class {
4878
4884
  return;
4879
4885
  }
4880
4886
  this.#initialize = this.#browser.sessionSubscribe({
4881
- events: ["log.entryAdded"]
4887
+ events: ["log.entryAdded", "browsingContext.navigationStarted"]
4882
4888
  }).then(() => true, () => false);
4883
4889
  this.#browser.on("log.entryAdded", this.handleLogEntry.bind(this));
4884
4890
  this.#browser.on("result", this.#commandResultHandler.bind(this));
4891
+ this.#browser.on("browsingContext.navigationStarted", this.#handleNavigationStarted.bind(this));
4885
4892
  browser.scriptAddPreloadScript({
4886
4893
  functionDeclaration: customElementWrapper.toString()
4887
4894
  });
@@ -4889,6 +4896,12 @@ var ShadowRootManager = class {
4889
4896
  async initialize() {
4890
4897
  return this.#initialize;
4891
4898
  }
4899
+ /**
4900
+ * keep track of navigation events and remove shadow roots when they are no longer needed
4901
+ */
4902
+ #handleNavigationStarted(context) {
4903
+ this.#shadowRoots.delete(context.context);
4904
+ }
4892
4905
  /**
4893
4906
  * keep track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G;IACH,gBAAgB,CAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI;IA6B5D,IAAI,CAAE,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAelD,cAAc,CAAE,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAe/D,kBAAkB,IAAK,MAAM,EAAE;IAO/B,IAAI,IAAK,cAAc,EAAE;IAIzB,MAAM,CAAE,OAAO,EAAE,MAAM,GAAG,OAAO;CAcpC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "webdriverio",
3
3
  "description": "Next-gen browser and mobile automation test framework for Node.js",
4
- "version": "9.1.0",
4
+ "version": "9.1.1",
5
5
  "homepage": "https://webdriver.io",
6
6
  "author": "Christian Bromann <mail@bromann.dev>",
7
7
  "license": "MIT",
@@ -100,7 +100,7 @@
100
100
  "rgb2hex": "0.2.5",
101
101
  "serialize-error": "^11.0.3",
102
102
  "urlpattern-polyfill": "^10.0.0",
103
- "webdriver": "9.1.0"
103
+ "webdriver": "9.1.1"
104
104
  },
105
105
  "peerDependencies": {
106
106
  "puppeteer-core": "^22.3.0"
@@ -110,5 +110,5 @@
110
110
  "optional": true
111
111
  }
112
112
  },
113
- "gitHead": "e6b005f5a150c335a105cfc2e386d43ac526adac"
113
+ "gitHead": "f70367e464d7c056328cd7d8e57ea296c0e766ae"
114
114
  }