@wdio/browser-runner 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.
- package/build/browser/setup.d.ts.map +1 -1
- package/build/browser/setup.js +0 -8
- package/build/index.d.ts +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +9 -6
- package/build/vite/plugins/testrunner.js +2 -2
- package/build/vite/utils.d.ts.map +1 -1
- package/build/vite/utils.js +11 -2
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/browser/setup.ts"],"names":[],"mappings":"AAQA,KAAK,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC,CAAA;AAC9D,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,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;KAC7C;CACJ;
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/browser/setup.ts"],"names":[],"mappings":"AAQA,KAAK,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC,CAAA;AAC9D,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,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;KAC7C;CACJ;AAOD,eAAO,MAAM,MAAM,WAA+C,CAAA;AAClE,eAAO,MAAM,cAAc,oBAGzB,CAAA"}
|
package/build/browser/setup.js
CHANGED
|
@@ -3,14 +3,6 @@ import { expect } from 'expect-webdriverio';
|
|
|
3
3
|
import { remote } from 'webdriverio';
|
|
4
4
|
import { _setGlobal } from '@wdio/globals';
|
|
5
5
|
import { MochaFramework } from './frameworks/mocha.js';
|
|
6
|
-
/**
|
|
7
|
-
* listen to window errors during bootstrap phase
|
|
8
|
-
*/
|
|
9
|
-
window.__wdioErrors__ = [];
|
|
10
|
-
addEventListener('error', (ev) => window.__wdioErrors__.push({
|
|
11
|
-
filename: ev.filename,
|
|
12
|
-
message: ev.message
|
|
13
|
-
}));
|
|
14
6
|
/**
|
|
15
7
|
* create connection to Vite server
|
|
16
8
|
*/
|
package/build/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import type { BrowserRunnerOptions as BrowserRunnerOptionsImport } from './types
|
|
|
4
4
|
export default class BrowserRunner extends LocalRunner {
|
|
5
5
|
#private;
|
|
6
6
|
private options;
|
|
7
|
-
|
|
7
|
+
protected _config: Options.Testrunner;
|
|
8
|
+
constructor(options: BrowserRunnerOptionsImport, _config: Options.Testrunner);
|
|
8
9
|
/**
|
|
9
10
|
* nothing to initialise when running locally
|
|
10
11
|
*/
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAIzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAK1C,OAAO,KAAK,EAAE,oBAAoB,IAAI,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAIjF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAIzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAK1C,OAAO,KAAK,EAAE,oBAAoB,IAAI,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAIjF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;;IAK9C,OAAO,CAAC,OAAO;IACf,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU;gBAD7B,OAAO,EAAE,0BAA0B,EACjC,OAAO,EAAE,OAAO,CAAC,UAAU;IAYzC;;OAEG;IACG,UAAU;IAYhB,GAAG,CAAE,OAAO,EAAE,OAAO;IAoCrB;;;;OAIG;IACG,QAAQ;CAIjB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,WAAW,CAAC;QAClB,UAAU,oBAAqB,SAAQ,0BAA0B;SAAG;KACvE;CACJ"}
|
package/build/index.js
CHANGED
|
@@ -7,16 +7,18 @@ import { makeHeadless } from './utils.js';
|
|
|
7
7
|
const log = logger('@wdio/browser-runner');
|
|
8
8
|
export default class BrowserRunner extends LocalRunner {
|
|
9
9
|
options;
|
|
10
|
+
_config;
|
|
10
11
|
#config;
|
|
11
12
|
#server;
|
|
12
|
-
constructor(options,
|
|
13
|
-
super(options,
|
|
13
|
+
constructor(options, _config) {
|
|
14
|
+
super(options, _config);
|
|
14
15
|
this.options = options;
|
|
15
|
-
|
|
16
|
+
this._config = _config;
|
|
17
|
+
if (_config.framework !== 'mocha') {
|
|
16
18
|
throw new Error(FRAMEWORK_SUPPORT_ERROR);
|
|
17
19
|
}
|
|
18
20
|
this.#server = new ViteServer(options);
|
|
19
|
-
this.#config =
|
|
21
|
+
this.#config = _config;
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* nothing to initialise when running locally
|
|
@@ -25,6 +27,7 @@ export default class BrowserRunner extends LocalRunner {
|
|
|
25
27
|
log.info('Initiate browser environment');
|
|
26
28
|
try {
|
|
27
29
|
await this.#server.start();
|
|
30
|
+
this._config.baseUrl = `http://localhost:${this.#server.config.server?.port}`;
|
|
28
31
|
}
|
|
29
32
|
catch (err) {
|
|
30
33
|
throw new Error(`Vite server failed to start: ${err.stack}`);
|
|
@@ -34,11 +37,11 @@ export default class BrowserRunner extends LocalRunner {
|
|
|
34
37
|
run(runArgs) {
|
|
35
38
|
runArgs.caps = makeHeadless(this.options, runArgs.caps);
|
|
36
39
|
if (runArgs.command === 'run') {
|
|
37
|
-
runArgs.args.baseUrl =
|
|
40
|
+
runArgs.args.baseUrl = this._config.baseUrl;
|
|
38
41
|
}
|
|
39
42
|
const worker = super.run(runArgs);
|
|
40
43
|
worker.on('message', async (payload) => {
|
|
41
|
-
if (payload.name === 'sessionStarted') {
|
|
44
|
+
if (payload.name === 'sessionStarted' && !SESSIONS.has(payload.cid)) {
|
|
42
45
|
SESSIONS.set(payload.cid, {
|
|
43
46
|
args: this.#config.mochaOpts || {},
|
|
44
47
|
config: this.#config,
|
|
@@ -23,8 +23,8 @@ const WDIO_PACKAGES = ['webdriverio', 'expect-webdriverio'];
|
|
|
23
23
|
const virtualModuleId = 'virtual:wdio';
|
|
24
24
|
const resolvedVirtualModuleId = '\0' + virtualModuleId;
|
|
25
25
|
const MODULES_TO_MOCK = [
|
|
26
|
-
'node:
|
|
27
|
-
'glob', 'devtools', 'ws'
|
|
26
|
+
'node:url', 'node:module', 'node:events', 'node:path',
|
|
27
|
+
'import-meta-resolve', 'puppeteer-core', 'archiver', 'glob', 'devtools', 'ws'
|
|
28
28
|
];
|
|
29
29
|
const FETCH_FROM_ESM = [
|
|
30
30
|
'serialize-error', 'minimatch', 'css-shorthand-properties', 'lodash.merge', 'lodash.zip',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/vite/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE5D,wBAAsB,WAAW,CAAE,OAAO,EAAE,WAAW,CAAC,oBAAoB,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/vite/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE5D,wBAAsB,WAAW,CAAE,OAAO,EAAE,WAAW,CAAC,oBAAoB,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,mBA6D3G;AAED,wBAAsB,kBAAkB,CAAE,MAAM,EAAE,eAAe,EAAE,GAAG,CAAC,EAAE,MAAM,gBAa9E;AAED,wBAAsB,gBAAgB,CAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,mBAUrE"}
|
package/build/vite/utils.js
CHANGED
|
@@ -7,14 +7,15 @@ export async function getTemplate(options, env, spec) {
|
|
|
7
7
|
let vueDeps = '';
|
|
8
8
|
if (options.preset === 'vue') {
|
|
9
9
|
try {
|
|
10
|
-
const
|
|
10
|
+
const rootFileUrl = url.pathToFileURL(root).href;
|
|
11
|
+
const vueDir = path.dirname(url.fileURLToPath(await resolve('vue', `${rootFileUrl}/node_modules`)));
|
|
11
12
|
const vueScript = (await fs.readFile(path.join(vueDir, 'dist', 'vue.global.prod.js'), 'utf-8')).toString();
|
|
12
13
|
vueDeps += /*html*/ `
|
|
13
14
|
<script type="module">
|
|
14
15
|
${vueScript}
|
|
15
16
|
window.Vue = Vue
|
|
16
17
|
</script>`;
|
|
17
|
-
const vueCompilerDir = path.dirname(url.fileURLToPath(await resolve('@vue/compiler-dom',
|
|
18
|
+
const vueCompilerDir = path.dirname(url.fileURLToPath(await resolve('@vue/compiler-dom', `${rootFileUrl}/node_modules`)));
|
|
18
19
|
const vueCompilerScript = (await fs.readFile(path.join(vueCompilerDir, 'dist', 'compiler-dom.global.prod.js'))).toString();
|
|
19
20
|
vueDeps += /*html*/ `
|
|
20
21
|
<script type="module">
|
|
@@ -42,6 +43,14 @@ export async function getTemplate(options, env, spec) {
|
|
|
42
43
|
window.__wdioEnv__ = ${JSON.stringify(env)}
|
|
43
44
|
window.__wdioSpec__ = '${spec}'
|
|
44
45
|
window.__wdioEvents__ = []
|
|
46
|
+
/**
|
|
47
|
+
* listen to window errors during bootstrap phase
|
|
48
|
+
*/
|
|
49
|
+
window.__wdioErrors__ = []
|
|
50
|
+
addEventListener('error', (ev) => window.__wdioErrors__.push({
|
|
51
|
+
filename: ev.filename,
|
|
52
|
+
message: ev.message
|
|
53
|
+
}))
|
|
45
54
|
</script>
|
|
46
55
|
${vueDeps}
|
|
47
56
|
</head>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/browser-runner",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.620+56a4ae1f2",
|
|
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",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
|
|
32
32
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
33
33
|
"@types/mocha": "^10.0.0",
|
|
34
|
-
"@wdio/globals": "8.0.0-alpha.
|
|
35
|
-
"@wdio/local-runner": "8.0.0-alpha.
|
|
36
|
-
"@wdio/logger": "8.0.0-alpha.
|
|
37
|
-
"@wdio/mocha-framework": "8.0.0-alpha.
|
|
38
|
-
"@wdio/protocols": "8.0.0-alpha.
|
|
39
|
-
"@wdio/runner": "8.0.0-alpha.
|
|
40
|
-
"@wdio/types": "8.0.0-alpha.
|
|
41
|
-
"@wdio/utils": "8.0.0-alpha.
|
|
34
|
+
"@wdio/globals": "8.0.0-alpha.620+56a4ae1f2",
|
|
35
|
+
"@wdio/local-runner": "8.0.0-alpha.620+56a4ae1f2",
|
|
36
|
+
"@wdio/logger": "8.0.0-alpha.620+56a4ae1f2",
|
|
37
|
+
"@wdio/mocha-framework": "8.0.0-alpha.620+56a4ae1f2",
|
|
38
|
+
"@wdio/protocols": "8.0.0-alpha.620+56a4ae1f2",
|
|
39
|
+
"@wdio/runner": "8.0.0-alpha.620+56a4ae1f2",
|
|
40
|
+
"@wdio/types": "8.0.0-alpha.620+56a4ae1f2",
|
|
41
|
+
"@wdio/utils": "8.0.0-alpha.620+56a4ae1f2",
|
|
42
42
|
"deepmerge-ts": "^4.2.2",
|
|
43
43
|
"expect-webdriverio": "^4.0.0-alpha.6",
|
|
44
44
|
"fast-safe-stringify": "^2.1.1",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"serialize-error": "^11.0.0",
|
|
48
48
|
"vite": "^3.1.7",
|
|
49
49
|
"vite-plugin-top-level-await": "^1.2.1",
|
|
50
|
-
"webdriver": "8.0.0-alpha.
|
|
51
|
-
"webdriverio": "8.0.0-alpha.
|
|
50
|
+
"webdriver": "8.0.0-alpha.620+56a4ae1f2",
|
|
51
|
+
"webdriverio": "8.0.0-alpha.620+56a4ae1f2",
|
|
52
52
|
"ws": "^8.10.0"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/ws": "^8.5.3"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "56a4ae1f236fc71721e15c077cdc35964093bbe4"
|
|
64
64
|
}
|