@wdio/browser-runner 8.29.6 → 8.30.0

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.
@@ -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 +1 @@
1
- {"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/browser/expect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA2E,MAAM,QAAQ,CAAA;AA2JxG,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/browser/expect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA2E,MAAM,QAAQ,CAAA;AA2LxG,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -1,6 +1,5 @@
1
1
  import { expect } from 'expect';
2
2
  import { MESSAGE_TYPES } from '@wdio/types';
3
- import { matchers } from 'virtual:wdio';
4
3
  import { $ } from '@wdio/globals';
5
4
  import { getCID } from './utils.js';
6
5
  import { WDIO_EVENT_NAME } from '../constants.js';
@@ -11,14 +10,13 @@ let matcherRequestCount = 0;
11
10
  const matcherRequests = new Map();
12
11
  const COMMAND_TIMEOUT = 30 * 1000; // 30s
13
12
  /**
14
- * Set up expect-webdriverio matchers for the browser environment.
15
- * Every assertion is send to the testrunner via a websocket connection
16
- * and is executed in the Node.js environment. This allows us to enable
17
- * matchers that require Node.js specific modules like `fs` or `child_process`,
18
- * for visual regression or snapshot testing for example.
13
+ * Matcher factory enables to run all matchers within the browser by sending all necessary information
14
+ * to the worker process and execute the actual assertion in the Node.js environment.
15
+ * @param matcherName name of the matcher
16
+ * @returns a matcher result computed in the Node.js environment
19
17
  */
20
- expect.extend(matchers.reduce((acc, matcherName) => {
21
- acc[matcherName] = async function (context, ...args) {
18
+ function createMatcher(matcherName) {
19
+ return async function (context, ...args) {
22
20
  const cid = getCID();
23
21
  if (!import.meta.hot || !cid) {
24
22
  return {
@@ -40,25 +38,26 @@ expect.extend(matchers.reduce((acc, matcherName) => {
40
38
  matcherName,
41
39
  args: args
42
40
  };
41
+ const isContextObject = typeof context === 'object';
43
42
  /**
44
43
  * Check if context is an WebdriverIO.Element
45
44
  */
46
- if ('elementId' in context && typeof context.elementId === 'string') {
45
+ if (isContextObject && 'elementId' in context && typeof context.elementId === 'string') {
47
46
  expectRequest.element = context;
48
47
  }
49
48
  /**
50
49
  * Check if context is ChainablePromiseElement
51
50
  */
52
- if ('then' in context && typeof context.selector === 'object') {
51
+ if (isContextObject && 'then' in context && typeof context.selector === 'object') {
53
52
  expectRequest.element = await context;
54
53
  }
55
54
  /**
56
- * Check if context is a `Element` and transtform it into a WebdriverIO.Element
55
+ * Check if context is a `Element` and transform it into a WebdriverIO.Element
57
56
  */
58
57
  if (context instanceof Element) {
59
58
  expectRequest.element = await $(context);
60
59
  }
61
- else if (typeof context === 'object' && !('sessionId' in context)) {
60
+ else if (isContextObject && !('sessionId' in context)) {
62
61
  /**
63
62
  * check if context is an object or promise and resolve it
64
63
  * but not pass through the browser object
@@ -68,6 +67,12 @@ expect.extend(matchers.reduce((acc, matcherName) => {
68
67
  expectRequest.context = await context;
69
68
  }
70
69
  }
70
+ else if (!isContextObject) {
71
+ /**
72
+ * if context is not an object or promise, pass it through
73
+ */
74
+ expectRequest.context = context;
75
+ }
71
76
  /**
72
77
  * Avoid serialization issues when sending over the element. If we create
73
78
  * an element from an existing HTMLElement, it might have custom properties
@@ -97,18 +102,42 @@ expect.extend(matchers.reduce((acc, matcherName) => {
97
102
  .replace('/@fs/', '/');
98
103
  }
99
104
  import.meta.hot.send(WDIO_EVENT_NAME, { type: MESSAGE_TYPES.expectRequestMessage, value: expectRequest });
100
- const contextString = 'elementId' in context ? 'WebdriverIO.Element' : 'WebdriverIO.Browser';
105
+ const contextString = isContextObject
106
+ ? 'elementId' in context
107
+ ? 'WebdriverIO.Element'
108
+ : 'WebdriverIO.Browser'
109
+ : context;
101
110
  return new Promise((resolve, reject) => {
102
111
  const commandTimeout = setTimeout(() => reject(new Error(`Assertion expect(${contextString}).${matcherName}(...) timed out`)), COMMAND_TIMEOUT);
103
112
  matcherRequests.set(expectRequest.id, { resolve, commandTimeout });
104
113
  });
105
114
  };
106
- return acc;
107
- }, {}));
115
+ }
116
+ /**
117
+ * request all available matchers from the testrunner
118
+ */
119
+ import.meta.hot?.send(WDIO_EVENT_NAME, { type: MESSAGE_TYPES.expectMatchersRequest });
108
120
  /**
109
121
  * listen on assertion results from testrunner
110
122
  */
111
123
  import.meta.hot?.on(WDIO_EVENT_NAME, (message) => {
124
+ /**
125
+ * Set up `expect-webdriverio` matchers for the browser environment.
126
+ * Every assertion is send to the testrunner via a websocket connection
127
+ * and is executed in the Node.js environment. This allows us to enable
128
+ * matchers that require Node.js specific modules like `fs` or `child_process`,
129
+ * for visual regression or snapshot testing for example.
130
+ *
131
+ * The testrunner will send a list of available matchers to the browser
132
+ * since there might services or other hooks that add custom matchers.
133
+ */
134
+ if (message.type === MESSAGE_TYPES.expectMatchersResponse) {
135
+ const matchers = message.value.matchers.reduce((acc, matcherName) => {
136
+ acc[matcherName] = createMatcher(matcherName);
137
+ return acc;
138
+ }, {});
139
+ expect.extend(matchers);
140
+ }
112
141
  if (message.type !== MESSAGE_TYPES.expectResponseMessage) {
113
142
  return;
114
143
  }
@@ -6,6 +6,10 @@ import type { NewSpecPageOptions } from '@stencil/core/internal';
6
6
  * @returns the created spec page
7
7
  */
8
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>;
9
13
  /**
10
14
  * A set of flags used for bitwise calculations against {@link ComponentRuntimeMeta#$flags$}.
11
15
  *
@@ -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,4 +1,5 @@
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.
@@ -109,6 +110,9 @@ export function render(opts) {
109
110
  };
110
111
  renderVdom(ref, opts.template());
111
112
  }
113
+ else if (typeof opts.html === 'string') {
114
+ container.innerHTML = opts.html;
115
+ }
112
116
  let rootComponent = null;
113
117
  Object.defineProperty(page, 'root', {
114
118
  get() {
@@ -121,6 +125,16 @@ export function render(opts) {
121
125
  return container.firstElementChild;
122
126
  },
123
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
+ });
124
138
  if (opts.hydrateServerSide) {
125
139
  insertVdomAnnotations(document, []);
126
140
  }
@@ -225,6 +239,35 @@ function findRootComponent(cmpTags, node) {
225
239
  }
226
240
  return null;
227
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
+ }
228
271
  const formatLazyBundleRuntimeMeta = (bundleId, cmps) => {
229
272
  return [bundleId, cmps.map((cmp) => formatComponentRuntimeMeta(cmp, true))];
230
273
  };
@@ -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"}
@@ -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;AAwID;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,gBAaxD"}
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', 'fixtures', 'stencil.js');
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
- if (!hasHImport) {
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
- const hasRenderFunctionImport = stencilImports.some((imp) => 'h' in (imp.namedImports || {}));
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
@@ -1 +1 @@
1
- {"version":3,"file":"testrunner.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/testrunner.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AA2ClC,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,oBAAoB,GAAG,MAAM,EAAE,CA2I9E"}
1
+ {"version":3,"file":"testrunner.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/testrunner.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AA2ClC,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,oBAAoB,GAAG,MAAM,EAAE,CA0I9E"}
@@ -2,7 +2,6 @@ import url from 'node:url';
2
2
  import path from 'node:path';
3
3
  import { builtinModules } from 'node:module';
4
4
  import logger from '@wdio/logger';
5
- import { matchers } from 'expect-webdriverio';
6
5
  import { polyfillPath } from 'modern-node-polyfills';
7
6
  import { deepmerge } from 'deepmerge-ts';
8
7
  import { resolve } from 'import-meta-resolve';
@@ -90,7 +89,6 @@ export function testrunner(options) {
90
89
  import { fn } from '@wdio/browser-runner'
91
90
  export const commands = ${JSON.stringify(protocolCommandList)}
92
91
  export const automationProtocolPath = ${JSON.stringify(automationProtocolPath)}
93
- export const matchers = ${JSON.stringify(Object.keys(matchers))}
94
92
  export const wrappedFn = (...args) => fn()(...args)
95
93
  `;
96
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/browser-runner",
3
- "version": "8.29.6",
3
+ "version": "8.30.0",
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,17 +37,17 @@
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.3",
41
- "@wdio/local-runner": "8.29.5",
40
+ "@wdio/globals": "8.30.0",
41
+ "@wdio/local-runner": "8.30.0",
42
42
  "@wdio/logger": "8.28.0",
43
- "@wdio/mocha-framework": "8.29.3",
44
- "@wdio/protocols": "^8.24.12",
45
- "@wdio/runner": "8.29.5",
46
- "@wdio/types": "8.29.1",
47
- "@wdio/utils": "8.29.3",
43
+ "@wdio/mocha-framework": "8.30.0",
44
+ "@wdio/protocols": "8.29.7",
45
+ "@wdio/runner": "8.30.0",
46
+ "@wdio/types": "8.30.0",
47
+ "@wdio/utils": "8.30.0",
48
48
  "deepmerge-ts": "^5.0.0",
49
49
  "expect": "^29.7.0",
50
- "expect-webdriverio": "^4.9.3",
50
+ "expect-webdriverio": "^4.10.1",
51
51
  "get-port": "^7.0.0",
52
52
  "import-meta-resolve": "^4.0.0",
53
53
  "istanbul-lib-coverage": "^3.2.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.3",
66
- "webdriverio": "8.29.3"
65
+ "webdriver": "8.30.0",
66
+ "webdriverio": "8.30.0"
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": "45ff936ee5c76137bf96c15a2fc36c362a0ff693"
74
+ "gitHead": "033e2a91e97c9bd060eb70f2e4e412d382bec3af"
75
75
  }
@@ -17,6 +17,10 @@ export 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 @@ export 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, `autoAppluChanges` continuously flushes the queue on the background. Default is `false`.
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,7 +51,7 @@ export 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
57
  export interface StencilEnvironment {
@@ -73,14 +69,33 @@ export interface StencilEnvironment {
73
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
80
84
  /**
81
85
  * Removes the container element from the DOM.
82
86
  */
83
87
  unmount: () => void
84
88
  }
85
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
+ */
86
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":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAgBrE,OAAO,KAAK,EAKR,kBAAkB,EACrB,MAAM,wBAAwB,CAAA;AAe/B;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,kBAAkB,GAAG,kBAAkB,CA2HnE;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"}