@wdio/browser-runner 8.29.5 → 8.29.7
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/driver.js +2 -2
- package/build/browser/{fixtures → integrations}/stencil.d.ts +5 -9
- package/build/browser/integrations/stencil.d.ts.map +1 -0
- package/build/browser/{fixtures → integrations}/stencil.js +56 -11
- package/build/browser/utils.d.ts +1 -0
- package/build/browser/utils.d.ts.map +1 -1
- package/build/browser/utils.js +24 -0
- package/build/vite/frameworks/stencil.d.ts.map +1 -1
- package/build/vite/frameworks/stencil.js +18 -17
- package/package.json +8 -8
- package/stencil/index.d.ts +35 -16
- package/build/browser/fixtures/stencil.d.ts.map +0 -1
package/build/browser/driver.js
CHANGED
|
@@ -3,7 +3,7 @@ import { webdriverMonad, sessionEnvironmentDetector } from '@wdio/utils';
|
|
|
3
3
|
import { getEnvironmentVars } from 'webdriver';
|
|
4
4
|
import { MESSAGE_TYPES } from '@wdio/types';
|
|
5
5
|
import { browser } from '@wdio/globals';
|
|
6
|
-
import { getCID } from './utils.js';
|
|
6
|
+
import { getCID, sanitizeConsoleArgs } from './utils.js';
|
|
7
7
|
import { WDIO_EVENT_NAME } from '../constants.js';
|
|
8
8
|
const COMMAND_TIMEOUT = 30 * 1000; // 30s
|
|
9
9
|
const CONSOLE_METHODS = ['log', 'info', 'warn', 'error', 'debug'];
|
|
@@ -147,7 +147,7 @@ export default class ProxyDriver {
|
|
|
147
147
|
import.meta.hot?.send(WDIO_EVENT_NAME, this.#consoleMessage({
|
|
148
148
|
name: 'consoleEvent',
|
|
149
149
|
type: method,
|
|
150
|
-
args,
|
|
150
|
+
args: sanitizeConsoleArgs(args),
|
|
151
151
|
cid
|
|
152
152
|
}));
|
|
153
153
|
origCommand(...args);
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
+
import type { StencilEnvironment } from '../../../stencil/index.d.ts';
|
|
1
2
|
import type { NewSpecPageOptions } from '@stencil/core/internal';
|
|
2
|
-
interface StencilEnvironment {
|
|
3
|
-
/**
|
|
4
|
-
* After changes have been made to a component, such as a update to a property or
|
|
5
|
-
* attribute, the test page does not automatically apply the changes. In order to
|
|
6
|
-
* wait for, and apply the update, call await `flushAll()`.
|
|
7
|
-
*/
|
|
8
|
-
flushAll: () => void;
|
|
9
|
-
}
|
|
10
3
|
/**
|
|
11
4
|
* Creates a new spec page for unit testing
|
|
12
5
|
* @param opts the options to apply to the spec page that influence its configuration and operation
|
|
13
6
|
* @returns the created spec page
|
|
14
7
|
*/
|
|
15
8
|
export declare function render(opts: NewSpecPageOptions): StencilEnvironment;
|
|
9
|
+
/**
|
|
10
|
+
* Helper method to wait until all Stencil components are rendered
|
|
11
|
+
*/
|
|
12
|
+
export declare function waitForChanges(documentElement?: HTMLElement): Promise<void>;
|
|
16
13
|
/**
|
|
17
14
|
* A set of flags used for bitwise calculations against {@link ComponentRuntimeMeta#$flags$}.
|
|
18
15
|
*
|
|
@@ -67,5 +64,4 @@ export declare const enum CMP_FLAGS {
|
|
|
67
64
|
* @returns a compact format for component metadata, intended for runtime use
|
|
68
65
|
*/
|
|
69
66
|
export declare const formatComponentRuntimeMeta: (compilerMeta: any, includeMethods: boolean) => any;
|
|
70
|
-
export {};
|
|
71
67
|
//# sourceMappingURL=stencil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stencil.d.ts","sourceRoot":"","sources":["../../../src/browser/integrations/stencil.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAgBrE,OAAO,KAAK,EAMR,kBAAkB,EACrB,MAAM,wBAAwB,CAAA;AAe/B;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,kBAAkB,GAAG,kBAAkB,CAwInE;AAsGD;;GAEG;AACH,wBAAgB,cAAc,CAAE,eAAe,cAA2B,iBA4BzE;AAED;;;;;GAKG;AACH,0BAAkB,SAAS;IACvB;;;OAGG;IACH,sBAAsB,IAAS;IAC/B;;;OAGG;IACH,sBAAsB,IAAS;IAC/B;;OAEG;IACH,iBAAiB,IAAS;IAM1B;;;;;OAKG;IACH,kBAAkB,IAAS;IAC3B;;;OAGG;IACH,oBAAoB,KAAS;IAC7B;;OAEG;IACH,OAAO,KAAS;IAEhB;;;;;OAKG;IACH,wBAAwB,KAA8C;CACzE;AASD;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,iBACrB,GAAG,kBACD,OAAO,KACxB,GAyBF,CAAA"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
|
+
import { $ } from '@wdio/globals';
|
|
2
3
|
/**
|
|
3
4
|
* Emulate Node.js `nextTick` function in browser.
|
|
4
5
|
* This is used by Stencil.js internally.
|
|
5
6
|
*/
|
|
6
7
|
process.nextTick = (cb) => setTimeout(cb, 0);
|
|
8
|
+
/**
|
|
9
|
+
* in case the user has his tsconfig.json configured to expect "jsx" to be "react"
|
|
10
|
+
*/
|
|
7
11
|
// @ts-expect-error
|
|
8
12
|
window.React = {
|
|
9
|
-
createElement: h
|
|
13
|
+
createElement: h
|
|
10
14
|
};
|
|
11
15
|
import { bootstrapLazy, flushAll, insertVdomAnnotations, registerComponents, registerModule, renderVdom, setSupportsShadowDom, startAutoApplyChanges, styles, writeTask,
|
|
12
16
|
// @ts-expect-error
|
|
@@ -71,16 +75,19 @@ export function render(opts) {
|
|
|
71
75
|
}
|
|
72
76
|
registerModule(bundleId, Cstr);
|
|
73
77
|
/**
|
|
74
|
-
* Register the component as a custom element
|
|
78
|
+
* Register the component as a custom element only if not already registered
|
|
75
79
|
*/
|
|
76
|
-
customElements.
|
|
80
|
+
if (!customElements.get(Cstr.COMPILER_META.tagName)) {
|
|
81
|
+
customElements.define(Cstr.COMPILER_META.tagName, Cstr);
|
|
82
|
+
}
|
|
77
83
|
const lazyBundleRuntimeMeta = formatLazyBundleRuntimeMeta(bundleId, [Cstr.COMPILER_META]);
|
|
78
84
|
return lazyBundleRuntimeMeta;
|
|
79
85
|
});
|
|
80
86
|
const page = {
|
|
81
87
|
container,
|
|
82
88
|
styles,
|
|
83
|
-
flushAll
|
|
89
|
+
flushAll,
|
|
90
|
+
unmount: () => container.remove()
|
|
84
91
|
};
|
|
85
92
|
if (typeof opts.direction === 'string') {
|
|
86
93
|
document.documentElement.setAttribute('dir', opts.direction);
|
|
@@ -99,26 +106,35 @@ export function render(opts) {
|
|
|
99
106
|
$flags$: 0,
|
|
100
107
|
$modeName$: undefined,
|
|
101
108
|
$cmpMeta$: cmpMeta,
|
|
102
|
-
$hostElement$:
|
|
109
|
+
$hostElement$: container,
|
|
103
110
|
};
|
|
104
111
|
renderVdom(ref, opts.template());
|
|
105
112
|
}
|
|
113
|
+
else if (typeof opts.html === 'string') {
|
|
114
|
+
container.innerHTML = opts.html;
|
|
115
|
+
}
|
|
106
116
|
let rootComponent = null;
|
|
107
117
|
Object.defineProperty(page, 'root', {
|
|
108
118
|
get() {
|
|
109
119
|
if (!rootComponent) {
|
|
110
|
-
rootComponent = findRootComponent(cmpTags,
|
|
120
|
+
rootComponent = findRootComponent(cmpTags, container);
|
|
111
121
|
}
|
|
112
122
|
if (rootComponent) {
|
|
113
123
|
return rootComponent;
|
|
114
124
|
}
|
|
115
|
-
|
|
116
|
-
if (!firstElementChild) {
|
|
117
|
-
return firstElementChild;
|
|
118
|
-
}
|
|
119
|
-
return null;
|
|
125
|
+
return container.firstElementChild;
|
|
120
126
|
},
|
|
121
127
|
});
|
|
128
|
+
Object.defineProperty(page, '$root', {
|
|
129
|
+
get() {
|
|
130
|
+
return $(page.root);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(page, '$container', {
|
|
134
|
+
get() {
|
|
135
|
+
return $(container);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
122
138
|
if (opts.hydrateServerSide) {
|
|
123
139
|
insertVdomAnnotations(document, []);
|
|
124
140
|
}
|
|
@@ -223,6 +239,35 @@ function findRootComponent(cmpTags, node) {
|
|
|
223
239
|
}
|
|
224
240
|
return null;
|
|
225
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* Helper method to wait until all Stencil components are rendered
|
|
244
|
+
*/
|
|
245
|
+
export function waitForChanges(documentElement = document.documentElement) {
|
|
246
|
+
return new Promise((resolve) => {
|
|
247
|
+
requestAnimationFrame(() => {
|
|
248
|
+
const promiseChain = [];
|
|
249
|
+
const waitComponentOnReady = (elm, promises) => {
|
|
250
|
+
if ('shadowRoot' in elm && elm.shadowRoot instanceof ShadowRoot) {
|
|
251
|
+
waitComponentOnReady(elm.shadowRoot, promises);
|
|
252
|
+
}
|
|
253
|
+
const children = elm.children;
|
|
254
|
+
const len = children.length;
|
|
255
|
+
for (let i = 0; i < len; i++) {
|
|
256
|
+
const childElm = children[i];
|
|
257
|
+
const childStencilElm = childElm;
|
|
258
|
+
if (childElm.tagName.includes('-') && typeof childStencilElm.componentOnReady === 'function') {
|
|
259
|
+
promises.push(childStencilElm.componentOnReady().then(() => { }));
|
|
260
|
+
}
|
|
261
|
+
waitComponentOnReady(childElm, promises);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
waitComponentOnReady(documentElement, promiseChain);
|
|
265
|
+
Promise.all(promiseChain)
|
|
266
|
+
.then(() => resolve())
|
|
267
|
+
.catch(() => resolve());
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
}
|
|
226
271
|
const formatLazyBundleRuntimeMeta = (bundleId, cmps) => {
|
|
227
272
|
return [bundleId, cmps.map((cmp) => formatComponentRuntimeMeta(cmp, true))];
|
|
228
273
|
};
|
package/build/browser/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare function getCID(): string | undefined;
|
|
2
2
|
export declare const showPopupWarning: <T>(name: string, value: T, defaultValue?: T | undefined) => (...params: any[]) => T;
|
|
3
|
+
export declare function sanitizeConsoleArgs(args: unknown[]): any[];
|
|
3
4
|
//# 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;AAED,eAAO,MAAM,gBAAgB,YAAa,MAAM,yDAA6C,GAAG,EAAE,MAYjG,CAAA"}
|
|
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;AAED,wBAAgB,mBAAmB,CAAE,IAAI,EAAE,OAAO,EAAE,SAyBnD"}
|
package/build/browser/utils.js
CHANGED
|
@@ -22,3 +22,27 @@ export const showPopupWarning = (name, value, defaultValue) => (...params) => {
|
|
|
22
22
|
\`\`\``);
|
|
23
23
|
return value;
|
|
24
24
|
};
|
|
25
|
+
export function sanitizeConsoleArgs(args) {
|
|
26
|
+
return args.map((arg) => {
|
|
27
|
+
try {
|
|
28
|
+
if (arg && typeof arg.elementId === 'string') {
|
|
29
|
+
return `WebdriverIO.Element<${arg.elementId}>`;
|
|
30
|
+
}
|
|
31
|
+
if (arg && typeof arg.sessionId === 'string') {
|
|
32
|
+
return `WebdriverIO.Browser<${arg.sessionId}>`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
// ignore
|
|
37
|
+
}
|
|
38
|
+
if (arg instanceof HTMLElement ||
|
|
39
|
+
(arg && typeof arg === 'object' && 'then' in arg && typeof arg.then === 'function') ||
|
|
40
|
+
typeof arg === 'function') {
|
|
41
|
+
return arg.toString();
|
|
42
|
+
}
|
|
43
|
+
if (arg instanceof Error) {
|
|
44
|
+
return arg.stack;
|
|
45
|
+
}
|
|
46
|
+
return arg;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stencil.d.ts","sourceRoot":"","sources":["../../../src/vite/frameworks/stencil.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,MAAM,CAAA;AAahD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,oBAAoB,oBAEhG;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,yBAwBvD;
|
|
1
|
+
{"version":3,"file":"stencil.d.ts","sourceRoot":"","sources":["../../../src/vite/frameworks/stencil.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,MAAM,CAAA;AAahD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,oBAAoB,oBAEhG;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,yBAwBvD;AA2ID;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,gBAaxD"}
|
|
@@ -30,7 +30,7 @@ export async function optimizeForStencil(rootDir) {
|
|
|
30
30
|
}
|
|
31
31
|
async function stencilVitePlugin(rootDir) {
|
|
32
32
|
const { transpileSync, ts } = await import('@stencil/core/compiler/stencil.js');
|
|
33
|
-
const stencilHelperPath = path.resolve(__dirname, '..', '..', 'browser', '
|
|
33
|
+
const stencilHelperPath = path.resolve(__dirname, '..', '..', 'browser', 'integrations', 'stencil.js');
|
|
34
34
|
return {
|
|
35
35
|
name: 'wdio-stencil',
|
|
36
36
|
enforce: 'pre',
|
|
@@ -56,15 +56,8 @@ async function stencilVitePlugin(rootDir) {
|
|
|
56
56
|
const stencilHelperImport = staticImports.find((imp) => imp.specifier === '@wdio/browser-runner/stencil');
|
|
57
57
|
if (stencilHelperImport) {
|
|
58
58
|
const imports = parseStaticImport(stencilHelperImport);
|
|
59
|
-
const hasHImport = stencilImports.find((imp) => 'h' in (imp.namedImports || {}));
|
|
60
|
-
const hasFragmentImport = stencilImports.find((imp) => 'Fragment' in (imp.namedImports || {}));
|
|
61
59
|
if ('render' in (imports.namedImports || {})) {
|
|
62
|
-
|
|
63
|
-
code = `import { h } from '@stencil/core';\n${code}`;
|
|
64
|
-
}
|
|
65
|
-
if (!hasFragmentImport) {
|
|
66
|
-
code = `import { Fragment } from '@stencil/core';\n${code}`;
|
|
67
|
-
}
|
|
60
|
+
code = injectStencilImports(code, stencilImports);
|
|
68
61
|
}
|
|
69
62
|
}
|
|
70
63
|
return { code };
|
|
@@ -97,14 +90,7 @@ async function stencilVitePlugin(rootDir) {
|
|
|
97
90
|
* StencilJS does not import the `h` or `Fragment` function by default. We need to add it so the user
|
|
98
91
|
* doesn't need to.
|
|
99
92
|
*/
|
|
100
|
-
|
|
101
|
-
if (!hasRenderFunctionImport) {
|
|
102
|
-
transformedCode = `import { h } from '@stencil/core';\n${transformedCode}`;
|
|
103
|
-
}
|
|
104
|
-
const hasFragmentImport = stencilImports.some((imp) => 'Fragment' in (imp.namedImports || {}));
|
|
105
|
-
if (!hasFragmentImport) {
|
|
106
|
-
transformedCode = `import { Fragment } from '@stencil/core';\n${transformedCode}`;
|
|
107
|
-
}
|
|
93
|
+
transformedCode = injectStencilImports(transformedCode, stencilImports);
|
|
108
94
|
return {
|
|
109
95
|
...transpiledCode,
|
|
110
96
|
code: transformedCode,
|
|
@@ -113,6 +99,21 @@ async function stencilVitePlugin(rootDir) {
|
|
|
113
99
|
}
|
|
114
100
|
};
|
|
115
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* StencilJS does not import the `h` or `Fragment` function by default. We need to add it so the user
|
|
104
|
+
* doesn't need to.
|
|
105
|
+
*/
|
|
106
|
+
function injectStencilImports(code, imports) {
|
|
107
|
+
const hasRenderFunctionImport = imports.some((imp) => 'h' in (imp.namedImports || {}));
|
|
108
|
+
if (!hasRenderFunctionImport) {
|
|
109
|
+
code = `import { h } from '@stencil/core/internal/client';\n${code}`;
|
|
110
|
+
}
|
|
111
|
+
const hasFragmentImport = imports.some((imp) => 'Fragment' in (imp.namedImports || {}));
|
|
112
|
+
if (!hasFragmentImport) {
|
|
113
|
+
code = `import { Fragment } from '@stencil/core/internal/client';\n${code}`;
|
|
114
|
+
}
|
|
115
|
+
return code;
|
|
116
|
+
}
|
|
116
117
|
let _tsCompilerOptions = null;
|
|
117
118
|
/**
|
|
118
119
|
* Read the TypeScript compiler configuration file from disk
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/browser-runner",
|
|
3
|
-
"version": "8.29.
|
|
3
|
+
"version": "8.29.7",
|
|
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",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
38
38
|
"@types/istanbul-lib-source-maps": "^4.0.1",
|
|
39
39
|
"@vitest/spy": "^1.0.1",
|
|
40
|
-
"@wdio/globals": "8.29.
|
|
41
|
-
"@wdio/local-runner": "8.29.
|
|
40
|
+
"@wdio/globals": "8.29.7",
|
|
41
|
+
"@wdio/local-runner": "8.29.7",
|
|
42
42
|
"@wdio/logger": "8.28.0",
|
|
43
43
|
"@wdio/mocha-framework": "8.29.3",
|
|
44
|
-
"@wdio/protocols": "
|
|
45
|
-
"@wdio/runner": "8.29.
|
|
44
|
+
"@wdio/protocols": "8.29.7",
|
|
45
|
+
"@wdio/runner": "8.29.7",
|
|
46
46
|
"@wdio/types": "8.29.1",
|
|
47
47
|
"@wdio/utils": "8.29.3",
|
|
48
48
|
"deepmerge-ts": "^5.0.0",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"vite": "~4.5.0",
|
|
63
63
|
"vite-plugin-istanbul": "^5.0.0",
|
|
64
64
|
"vite-plugin-top-level-await": "^1.3.0",
|
|
65
|
-
"webdriver": "8.29.
|
|
66
|
-
"webdriverio": "8.29.
|
|
65
|
+
"webdriver": "8.29.7",
|
|
66
|
+
"webdriverio": "8.29.7"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"prepare": "rimraf node_modules/@wdio/config node_modules/@wdio/repl node_modules/@wdio/utils"
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "1c7195268663df56856494c69d7bd655c834a368"
|
|
75
75
|
}
|
package/stencil/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Options pertaining to the creation and functionality of a {@link SpecPage}
|
|
4
4
|
*/
|
|
5
|
-
interface RenderOptions {
|
|
5
|
+
export interface RenderOptions {
|
|
6
6
|
/**
|
|
7
7
|
* An array of components to test. Component classes can be imported into the spec file, then their reference should be added to the `component` array in order to be used throughout the test.
|
|
8
8
|
*/
|
|
@@ -17,6 +17,10 @@ interface RenderOptions {
|
|
|
17
17
|
* It will render the specified template (JSX) into `document.body`.
|
|
18
18
|
*/
|
|
19
19
|
template?: () => any;
|
|
20
|
+
/**
|
|
21
|
+
* The initial HTML used to generate the test. This can be useful to construct a collection of components working together, and assign HTML attributes.
|
|
22
|
+
*/
|
|
23
|
+
html?: string;
|
|
20
24
|
/**
|
|
21
25
|
* Sets the mocked `lang` attribute on `<html>`.
|
|
22
26
|
*/
|
|
@@ -24,25 +28,17 @@ interface RenderOptions {
|
|
|
24
28
|
/**
|
|
25
29
|
* Useful for debugging hydrating components client-side. Sets that the `html` option already includes annotated prerender attributes and comments.
|
|
26
30
|
*/
|
|
27
|
-
hydrateClientSide?: boolean;
|
|
31
|
+
// hydrateClientSide?: boolean;
|
|
28
32
|
/**
|
|
29
33
|
* Useful for debugging hydrating components server-side. The output HTML will also include prerender annotations.
|
|
30
34
|
*/
|
|
31
|
-
hydrateServerSide?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Sets the mocked `document.referrer`.
|
|
34
|
-
*/
|
|
35
|
-
referrer?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Manually set if the mocked document supports Shadow DOM or not. Default is `true`.
|
|
38
|
-
*/
|
|
39
|
-
supportsShadowDom?: boolean;
|
|
35
|
+
// hydrateServerSide?: boolean;
|
|
40
36
|
/**
|
|
41
37
|
* When a component is pre-rendered it includes HTML annotations, such as `s-id` attributes and `<!-t.0->` comments. This information is used by clientside hydrating. Default is `false`.
|
|
42
38
|
*/
|
|
43
|
-
includeAnnotations?: boolean;
|
|
39
|
+
// includeAnnotations?: boolean;
|
|
44
40
|
/**
|
|
45
|
-
* By default, any changes to component properties and attributes must `page.waitForChanges()` in order to test the updates. As an option, `
|
|
41
|
+
* By default, any changes to component properties and attributes must `page.waitForChanges()` in order to test the updates. As an option, `autoApplyChanges` continuously flushes the queue on the background. Default is `false`.
|
|
46
42
|
*/
|
|
47
43
|
autoApplyChanges?: boolean;
|
|
48
44
|
/**
|
|
@@ -55,10 +51,10 @@ interface RenderOptions {
|
|
|
55
51
|
* When `true` all `BuildConditionals` will be assigned to the global testing `BUILD` object, regardless of their
|
|
56
52
|
* value. When `false`, only `BuildConditionals` with a value of `true` will be assigned to the `BUILD` object.
|
|
57
53
|
*/
|
|
58
|
-
strictBuild?: boolean;
|
|
54
|
+
// strictBuild?: boolean;
|
|
59
55
|
}
|
|
60
56
|
|
|
61
|
-
interface StencilEnvironment {
|
|
57
|
+
export interface StencilEnvironment {
|
|
62
58
|
/**
|
|
63
59
|
* After changes have been made to a component, such as a update to a property or
|
|
64
60
|
* attribute, the test page does not automatically apply the changes. In order to
|
|
@@ -70,13 +66,36 @@ interface StencilEnvironment {
|
|
|
70
66
|
*/
|
|
71
67
|
styles: Record<string, string>
|
|
72
68
|
/**
|
|
73
|
-
* Container element in which the template is being rendered.
|
|
69
|
+
* Container element in which the template is being rendered into.
|
|
74
70
|
*/
|
|
75
71
|
container: HTMLElement
|
|
72
|
+
/**
|
|
73
|
+
* The container element as WebdriverIO element.
|
|
74
|
+
*/
|
|
75
|
+
$container: WebdriverIO.Element
|
|
76
76
|
/**
|
|
77
77
|
* The root component of the template.
|
|
78
78
|
*/
|
|
79
79
|
root: HTMLElement
|
|
80
|
+
/**
|
|
81
|
+
* The root component as WebdriverIO element.
|
|
82
|
+
*/
|
|
83
|
+
$root: WebdriverIO.Element
|
|
84
|
+
/**
|
|
85
|
+
* Removes the container element from the DOM.
|
|
86
|
+
*/
|
|
87
|
+
unmount: () => void
|
|
80
88
|
}
|
|
81
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Renders a Stencil component for testing into the page.
|
|
92
|
+
* @param opts options for the test page
|
|
93
|
+
* @returns a testing environment for the rendered component
|
|
94
|
+
*/
|
|
82
95
|
export function render(opts: RenderOptions): StencilEnvironment
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Waits for the next update cycle to complete.
|
|
99
|
+
* @returns a promise that resolves when the update cycle completes
|
|
100
|
+
*/
|
|
101
|
+
export function waitForChanges(): Promise<void>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stencil.d.ts","sourceRoot":"","sources":["../../../src/browser/fixtures/stencil.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAKR,kBAAkB,EACrB,MAAM,wBAAwB,CAAA;AAe/B,UAAU,kBAAkB;IACxB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAA;CACvB;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,kBAAkB,GAAG,kBAAkB,CA4HnE;AAsGD;;;;;GAKG;AACH,0BAAkB,SAAS;IACvB;;;OAGG;IACH,sBAAsB,IAAS;IAC/B;;;OAGG;IACH,sBAAsB,IAAS;IAC/B;;OAEG;IACH,iBAAiB,IAAS;IAM1B;;;;;OAKG;IACH,kBAAkB,IAAS;IAC3B;;;OAGG;IACH,oBAAoB,KAAS;IAC7B;;OAEG;IACH,OAAO,KAAS;IAEhB;;;;;OAKG;IACH,wBAAwB,KAA8C;CACzE;AASD;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,iBACrB,GAAG,kBACD,OAAO,KACxB,GAyBF,CAAA"}
|