webdriverio 8.0.0-alpha.607 → 8.0.0-alpha.620

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":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAIxD,OAAO,wBAAwB,MAAM,+BAA+B,CAAA;AAOpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,GAAG,SAAS,CAAC,CAAA;AACtG,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAc,CAAA;AAE9B;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,WAA2B,aAAa,mBAAmB,QAAQ,KAAG,QAAQ,YAAY,OAAO,CA6CnH,CAAA;AAED,eAAO,MAAM,MAAM,kBAAkC,aAAa,KAAG,QAAQ,YAAY,OAAO,CAmB/F,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,WACZ,aAAa,uBAAuB;;MAE7C,QAAQ,YAAY,kBAAkB,CAgExC,CAAA;AAED,eAAO,MAAM,kBAAkB,iCAA2B,CAAA;AAC1D,cAAc,YAAY,CAAA;AAC1B,cAAc,+BAA+B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAIxD,OAAO,wBAAwB,MAAM,+BAA+B,CAAA;AAOpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,GAAG,SAAS,CAAC,CAAA;AACtG,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAc,CAAA;AAE9B;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,WAA2B,aAAa,mBAAmB,QAAQ,KAAG,QAAQ,YAAY,OAAO,CA6CnH,CAAA;AAED,eAAO,MAAM,MAAM,kBAAkC,aAAa,KAAG,QAAQ,YAAY,OAAO,CAc/F,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,WACZ,aAAa,uBAAuB;;MAE7C,QAAQ,YAAY,kBAAkB,CAgExC,CAAA;AAED,eAAO,MAAM,kBAAkB,iCAA2B,CAAA;AAC1D,cAAc,YAAY,CAAA;AAC1B,cAAc,+BAA+B,CAAA"}
package/build/index.js CHANGED
@@ -61,15 +61,11 @@ export const attach = async function (attachOptions) {
61
61
  */
62
62
  const params = {
63
63
  ...attachOptions,
64
- options: { ...attachOptions.options },
65
64
  ...detectBackend(attachOptions),
66
65
  requestedCapabilities: attachOptions.requestedCapabilities
67
66
  };
68
67
  const prototype = getPrototype('browser');
69
- let automationProtocol = 'webdriver';
70
- if (params.options?.automationProtocol) {
71
- automationProtocol = params.options?.automationProtocol;
72
- }
68
+ let automationProtocol = await getAutomationProtocol(params);
73
69
  const ProtocolDriver = (await import(automationProtocol)).default;
74
70
  return ProtocolDriver.attachToSession(params, undefined, prototype, wrapCommand);
75
71
  };
@@ -1,16 +1,15 @@
1
1
  import type { Options } from '@wdio/types';
2
- import type { AttachOptions } from 'webdriver';
3
2
  /**
4
3
  * create `browser` object with capabilities and environment flags before session is started
5
4
  * so that Mocha/Jasmine users can filter their specs based on flags or use capabilities in test titles
6
5
  */
7
6
  export default class ProtocolStub {
8
- static newSession(options: Options.WebDriver): Promise<Record<string, any>>;
7
+ static newSession(options: Options.WebDriver): Promise<any>;
9
8
  /**
10
9
  * added just in case user wants to somehow reload webdriver or devtools session
11
10
  * before it was started.
12
11
  */
13
12
  static reloadSession(): void;
14
- static attachToSession(options: AttachOptions, modifier?: (...args: any[]) => any): Record<string, any>;
13
+ static attachToSession(options: never, modifier?: Function): any;
15
14
  }
16
15
  //# sourceMappingURL=protocol-stub.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol-stub.d.ts","sourceRoot":"","sources":["../src/protocol-stub.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAO9C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;WAChB,UAAU,CAAE,OAAO,EAAE,OAAO,CAAC,SAAS;IAcnD;;;OAGG;IACH,MAAM,CAAC,aAAa;IAIpB,MAAM,CAAC,eAAe,CAClB,OAAO,EAAE,aAAa,EACtB,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG;CAazC"}
1
+ {"version":3,"file":"protocol-stub.d.ts","sourceRoot":"","sources":["../src/protocol-stub.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAA;AAExD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;WAChB,UAAU,CAAE,OAAO,EAAE,OAAO,CAAC,SAAS;IAoBnD;;;OAGG;IACH,MAAM,CAAC,aAAa;IAIpB,MAAM,CAAC,eAAe,CAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,QAAQ;CAY9D"}
@@ -1,8 +1,4 @@
1
1
  import { capabilitiesEnvironmentDetector } from '@wdio/utils';
2
- /**
3
- * these commands can be used outside test scope and may be used accidentally by user before browser session is started
4
- */
5
- const WARN_ON_COMMANDS = ['addCommand', 'overwriteCommand'];
6
2
  /**
7
3
  * create `browser` object with capabilities and environment flags before session is started
8
4
  * so that Mocha/Jasmine users can filter their specs based on flags or use capabilities in test titles
@@ -10,11 +6,17 @@ const WARN_ON_COMMANDS = ['addCommand', 'overwriteCommand'];
10
6
  export default class ProtocolStub {
11
7
  static async newSession(options) {
12
8
  const capabilities = emulateSessionCapabilities((options.capabilities || {}));
13
- const browser = addCommands({
9
+ const browser = {
10
+ options,
14
11
  capabilities,
12
+ requestedCapabilities: capabilities,
13
+ customCommands: [],
14
+ overwrittenCommands: [],
15
+ commandList: [],
15
16
  ...capabilitiesEnvironmentDetector(capabilities, options._automationProtocol || 'webdriver')
16
- });
17
- browser.options = options;
17
+ };
18
+ browser.addCommand = (...args) => browser.customCommands.push(args);
19
+ browser.overwriteCommand = (...args) => browser.overwrittenCommands.push(args);
18
20
  return browser;
19
21
  }
20
22
  /**
@@ -26,27 +28,16 @@ export default class ProtocolStub {
26
28
  }
27
29
  static attachToSession(options, modifier) {
28
30
  if (options || !modifier) {
29
- return ProtocolStub.newSession(options);
31
+ throw new Error('You are trying to attach to a protocol stub, this should never occur, please file an issue.');
30
32
  }
31
33
  /**
32
- * MultiRemote
34
+ * MultiRemote is needed
33
35
  */
34
- return addCommands(modifier({
36
+ return modifier({
35
37
  commandList: []
36
- }));
38
+ });
37
39
  }
38
40
  }
39
- /**
40
- * provide better visibility to users that want to add / overwrite commands
41
- * before session is started
42
- * @param {object} browser
43
- */
44
- function addCommands(browser) {
45
- WARN_ON_COMMANDS.forEach((commandName) => {
46
- browser[commandName] = commandNotAvailable(commandName);
47
- });
48
- return browser;
49
- }
50
41
  /**
51
42
  * transform capabilities provided by user to look like
52
43
  * capabilities returned by WebDriver
@@ -66,10 +57,3 @@ function emulateSessionCapabilities(caps) {
66
57
  }
67
58
  return capabilities;
68
59
  }
69
- /**
70
- * warn user to avoid usage of command before browser session is started.
71
- * @param {string} commandName
72
- */
73
- function commandNotAvailable(commandName) {
74
- return () => { throw new Error(`Unable to use '${commandName}' before browser session is started.`); };
75
- }
@@ -463,7 +463,7 @@ export const getAutomationProtocol = async (config) => {
463
463
  * check if we are on mobile and use WebDriver if so
464
464
  */
465
465
  if (desiredCaps.deviceName || caps['appium:deviceName'] ||
466
- desiredCaps.platformVersion || caps['appium:platformVersion'] ||
466
+ caps['appium:platformVersion'] ||
467
467
  desiredCaps.app || caps['appium:app']) {
468
468
  return 'webdriver';
469
469
  }
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": "8.0.0-alpha.607+dac623702",
4
+ "version": "8.0.0-alpha.620+56a4ae1f2",
5
5
  "homepage": "https://webdriver.io",
6
6
  "author": "Christian Bromann <mail@bromann.dev>",
7
7
  "license": "MIT",
@@ -66,17 +66,17 @@
66
66
  "dependencies": {
67
67
  "@types/aria-query": "^5.0.0",
68
68
  "@types/node": "^18.0.0",
69
- "@wdio/config": "8.0.0-alpha.607+dac623702",
70
- "@wdio/logger": "8.0.0-alpha.607+dac623702",
71
- "@wdio/protocols": "8.0.0-alpha.607+dac623702",
72
- "@wdio/repl": "8.0.0-alpha.607+dac623702",
73
- "@wdio/types": "8.0.0-alpha.607+dac623702",
74
- "@wdio/utils": "8.0.0-alpha.607+dac623702",
69
+ "@wdio/config": "8.0.0-alpha.620+56a4ae1f2",
70
+ "@wdio/logger": "8.0.0-alpha.620+56a4ae1f2",
71
+ "@wdio/protocols": "8.0.0-alpha.620+56a4ae1f2",
72
+ "@wdio/repl": "8.0.0-alpha.620+56a4ae1f2",
73
+ "@wdio/types": "8.0.0-alpha.620+56a4ae1f2",
74
+ "@wdio/utils": "8.0.0-alpha.620+56a4ae1f2",
75
75
  "archiver": "^5.0.0",
76
76
  "aria-query": "^5.0.0",
77
77
  "css-shorthand-properties": "^1.1.1",
78
78
  "css-value": "^0.0.1",
79
- "devtools": "8.0.0-alpha.607+dac623702",
79
+ "devtools": "8.0.0-alpha.620+56a4ae1f2",
80
80
  "devtools-protocol": "^0.0.1075693",
81
81
  "grapheme-splitter": "^1.0.2",
82
82
  "import-meta-resolve": "^2.1.0",
@@ -89,7 +89,7 @@
89
89
  "resq": "^1.9.1",
90
90
  "rgb2hex": "0.2.5",
91
91
  "serialize-error": "^8.0.0",
92
- "webdriver": "8.0.0-alpha.607+dac623702"
92
+ "webdriver": "8.0.0-alpha.620+56a4ae1f2"
93
93
  },
94
- "gitHead": "dac62370266d145eeeafbfbea7e470d65a7ab663"
94
+ "gitHead": "56a4ae1f236fc71721e15c077cdc35964093bbe4"
95
95
  }