@wdio/browser-runner 8.6.8 → 8.6.9

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":"setup.d.ts","sourceRoot":"","sources":["../../src/browser/setup.ts"],"names":[],"mappings":"AAMA,OAAO,uBAAuB,CAAA;AAG9B,KAAK,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC,CAAA;AAC9D,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,KAAK,CAAC,EAAE,GAAG,CAAA;QACX,cAAc,EAAE,cAAc,EAAE,CAAA;QAChC,YAAY,EAAE,MAAM,CAAA;QACpB,gBAAgB,EAAE,MAAM,CAAA;QACxB,cAAc,EAAE,GAAG,EAAE,CAAA;QACrB,cAAc,EAAE,SAAS,CAAA;QACzB,sBAAsB,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;QAC1C,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAC7C;CACJ;AAOD,eAAO,MAAM,MAAM,WAA+C,CAAA;AAClE,eAAO,MAAM,cAAc,oBAGzB,CAAA"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/browser/setup.ts"],"names":[],"mappings":"AAMA,OAAO,uBAAuB,CAAA;AAI9B,KAAK,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC,CAAA;AAC9D,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,KAAK,CAAC,EAAE,GAAG,CAAA;QACX,cAAc,EAAE,cAAc,EAAE,CAAA;QAChC,YAAY,EAAE,MAAM,CAAA;QACpB,gBAAgB,EAAE,MAAM,CAAA;QACxB,cAAc,EAAE,GAAG,EAAE,CAAA;QACrB,cAAc,EAAE,SAAS,CAAA;QACzB,sBAAsB,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;QAC1C,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAC7C;CACJ;AAWD,eAAO,MAAM,MAAM,WAA+C,CAAA;AAClE,eAAO,MAAM,cAAc,oBAGzB,CAAA"}
@@ -3,6 +3,10 @@ import { expect } from 'expect-webdriverio';
3
3
  import { remote } from 'webdriverio';
4
4
  import { _setGlobal } from '@wdio/globals';
5
5
  import './frameworks/mocha.js';
6
+ import { showPopupWarning } from './utils.js';
7
+ globalThis.alert = showPopupWarning('alert', undefined);
8
+ globalThis.confirm = showPopupWarning('confirm', false, true);
9
+ globalThis.prompt = showPopupWarning('prompt', null, 'your value');
6
10
  /**
7
11
  * create connection to Vite server
8
12
  */
@@ -1,2 +1,3 @@
1
1
  export declare function getCID(): string | undefined;
2
+ export declare const showPopupWarning: <T>(name: string, value: T, defaultValue?: T | undefined) => (...params: any[]) => T;
2
3
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/browser/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,uBAYrB"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/browser/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,uBAYrB;AAED,eAAO,MAAM,gBAAgB,YAAa,MAAM,yDAA6C,GAAG,EAAE,MAYjG,CAAA"}
@@ -10,3 +10,15 @@ export function getCID() {
10
10
  .split('=')
11
11
  .pop());
12
12
  }
13
+ export const showPopupWarning = (name, value, defaultValue) => (...params) => {
14
+ const formatedParams = params.map(p => JSON.stringify(p)).join(', ');
15
+ console.warn(`WebdriverIO encountered a \`${name}(${formatedParams})\` call that it cannot handle by default, so it returned \`${value}\`. Read more in https://webdriver.io/docs/runner#limitations.
16
+ If needed, mock the \`${name}\` call manually like:
17
+ \`\`\`
18
+ import { spyOn } from "@wdio/browser-runner"
19
+ spyOn(window, "${name}")${defaultValue ? `.mockReturnValue(${JSON.stringify(defaultValue)})` : ''}
20
+ ${name}(${formatedParams})
21
+ expect(${name}).toHaveBeenCalledWith(${formatedParams})
22
+ \`\`\``);
23
+ return value;
24
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/browser-runner",
3
- "version": "8.6.8",
3
+ "version": "8.6.9",
4
4
  "description": "A WebdriverIO runner to run unit tests tests in the browser.",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-browser-runner",
@@ -35,8 +35,8 @@
35
35
  "@types/istanbul-lib-source-maps": "^4.0.1",
36
36
  "@types/node": "^18.15.3",
37
37
  "@vitest/spy": "^0.29.3",
38
- "@wdio/globals": "8.6.8",
39
- "@wdio/local-runner": "8.6.8",
38
+ "@wdio/globals": "8.6.9",
39
+ "@wdio/local-runner": "8.6.9",
40
40
  "@wdio/logger": "8.6.6",
41
41
  "@wdio/mocha-framework": "8.6.8",
42
42
  "@wdio/protocols": "8.6.6",
@@ -60,7 +60,7 @@
60
60
  "vite-plugin-istanbul": "^4.0.1",
61
61
  "vite-plugin-top-level-await": "^1.3.0",
62
62
  "webdriver": "8.6.8",
63
- "webdriverio": "8.6.8",
63
+ "webdriverio": "8.6.9",
64
64
  "ws": "^8.13.0"
65
65
  },
66
66
  "scripts": {
@@ -71,7 +71,7 @@
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/ws": "^8.5.4",
74
- "@wdio/runner": "8.6.8"
74
+ "@wdio/runner": "8.6.9"
75
75
  },
76
- "gitHead": "d93cd057937fc77935a4855dedf74323183652dd"
76
+ "gitHead": "4e55b777974baeea7d74ff43964c114fc8c5f60f"
77
77
  }