@wdio/utils 9.19.2 → 9.20.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.
package/build/index.js CHANGED
@@ -379,7 +379,7 @@ function WebDriver(options, modifier, propertiesObject = {}) {
379
379
  }
380
380
  }
381
381
  };
382
- function unit(sessionId, commandWrapper) {
382
+ function unit(sessionId, commandWrapper, elementCmdImplicitWaitExclusionList) {
383
383
  propertiesObject.commandList = { value: Object.keys(propertiesObject) };
384
384
  propertiesObject.options = { value: options };
385
385
  if ("requestedCapabilities" in options) {
@@ -405,11 +405,15 @@ function WebDriver(options, modifier, propertiesObject = {}) {
405
405
  if (typeof modifier === "function") {
406
406
  client = modifier(client, options);
407
407
  }
408
- client.addCommand = function(name, func, attachToElement = false, proto, instances) {
408
+ client.addCommand = function(name, func, attachToElementOrOptions = false, proto, instances) {
409
+ const { attachToElement, disableElementImplicitWait, proto: _proto, instances: _instances } = typeof attachToElementOrOptions === "object" && attachToElementOrOptions !== null ? attachToElementOrOptions : { attachToElement: attachToElementOrOptions, proto, instances };
409
410
  const customCommand = typeof commandWrapper === "function" ? commandWrapper(name, func) : func;
410
411
  if (attachToElement) {
411
- if (instances) {
412
- Object.values(instances).forEach((instance) => {
412
+ if (disableElementImplicitWait && elementCmdImplicitWaitExclusionList && !elementCmdImplicitWaitExclusionList.includes(name)) {
413
+ elementCmdImplicitWaitExclusionList.push(name);
414
+ }
415
+ if (_instances) {
416
+ Object.values(_instances).forEach((instance) => {
413
417
  instance.__propertiesObject__[name] = {
414
418
  value: customCommand
415
419
  };
@@ -417,7 +421,7 @@ function WebDriver(options, modifier, propertiesObject = {}) {
417
421
  }
418
422
  this.__propertiesObject__[name] = { value: customCommand };
419
423
  } else {
420
- unit.lift(name, customCommand, proto);
424
+ unit.lift(name, customCommand, _proto);
421
425
  }
422
426
  if (typeof process.send === "function" && process.env.WDIO_WORKER_ID) {
423
427
  const message = {
@@ -1047,12 +1051,12 @@ function wrapCommand(commandName, fn) {
1047
1051
  });
1048
1052
  }
1049
1053
  if (commandName.endsWith("$$") && typeof pIteration_exports[prop] === "function") {
1050
- return (mapIterator) => wrapElementFn(
1054
+ return (...iteratorArgs) => wrapElementFn(
1051
1055
  target,
1052
- function(mapIterator2) {
1053
- return pIteration_exports[prop](this, mapIterator2);
1056
+ function(...iteratorArgs2) {
1057
+ return pIteration_exports[prop](this, ...iteratorArgs2);
1054
1058
  },
1055
- [mapIterator]
1059
+ iteratorArgs
1056
1060
  );
1057
1061
  }
1058
1062
  if (ELEMENT_PROPS.includes(prop)) {
package/build/monad.d.ts CHANGED
@@ -2,7 +2,7 @@ interface PropertiesObject {
2
2
  [key: string | symbol]: PropertyDescriptor;
3
3
  }
4
4
  export default function WebDriver(options: object, modifier?: Function, propertiesObject?: PropertiesObject): {
5
- (this: void, sessionId: string, commandWrapper?: Function): any;
5
+ (this: void, sessionId: string, commandWrapper?: Function, elementCmdImplicitWaitExclusionList?: string[]): any;
6
6
  lift(name: string, func: Function, proto: Record<string, any>, origCommand?: Function): void;
7
7
  };
8
8
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"monad.d.ts","sourceRoot":"","sources":["../src/monad.ts"],"names":[],"mappings":"AAiBA,UAAU,gBAAgB;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,kBAAkB,CAAA;CAC7C;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,gBAAgB,GAAE,gBAAqB;WAwCvF,IAAI,aAAa,MAAM,mBAAmB,QAAQ;eAqJ1C,MAAM,QAAQ,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,QAAQ;EA8FzG"}
1
+ {"version":3,"file":"monad.d.ts","sourceRoot":"","sources":["../src/monad.ts"],"names":[],"mappings":"AAiBA,UAAU,gBAAgB;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,kBAAkB,CAAA;CAC7C;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,gBAAgB,GAAE,gBAAqB;WAwCvF,IAAI,aAAa,MAAM,mBAAmB,QAAQ,wCAAwC,MAAM,EAAE;eA6J1F,MAAM,QAAQ,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,QAAQ;EA8FzG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/utils",
3
- "version": "9.19.2",
3
+ "version": "9.20.1",
4
4
  "description": "A WDIO helper utility to provide several utility functions used across the project.",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-utils",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@puppeteer/browsers": "^2.2.0",
41
41
  "@wdio/logger": "9.18.0",
42
- "@wdio/types": "9.19.2",
42
+ "@wdio/types": "9.20.0",
43
43
  "decamelize": "^6.0.0",
44
44
  "deepmerge-ts": "^7.0.3",
45
45
  "edgedriver": "^6.1.2",
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "4ca46771777a0ef20bfd911fbd0da0904059fd9e"
58
+ "gitHead": "ac132d5e6c95ad0b9f4e92cb0090c9a60296da4c"
59
59
  }