@brightspace-ui/testing 1.13.5 → 1.15.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.
- package/package.json +1 -1
- package/src/server/wtr-config.js +4 -4
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@brightspace-ui/testing",
|
|
3
3
|
"description": "Utilities for testing front-end components and applications",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.15.0",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/testing.git",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"lint": "npm run lint:eslint && npm run lint:style",
|
package/src/server/wtr-config.js
CHANGED
|
@@ -219,7 +219,7 @@ export class WTRConfig {
|
|
|
219
219
|
files: this.#pattern
|
|
220
220
|
});
|
|
221
221
|
} else if (group === 'vdiff') {
|
|
222
|
-
config.testsFinishTimeout = 5 * 60 * 1000;
|
|
222
|
+
if (!config.testsFinishTimeout) config.testsFinishTimeout = 5 * 60 * 1000;
|
|
223
223
|
|
|
224
224
|
config.reporters ??= [ defaultReporter() ];
|
|
225
225
|
config.reporters.push(visualDiffReporter({ updateGoldens: golden }));
|
|
@@ -231,7 +231,7 @@ export class WTRConfig {
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
// convert all browsers to playwright
|
|
234
|
-
config.groups.forEach(g => g.browsers = this.getBrowsers(g.browsers));
|
|
234
|
+
config.groups.forEach(g => g.browsers = this.getBrowsers(g.browsers, config.deviceScaleFactor ?? (g.name === 'vdiff' ? 2 : 1)));
|
|
235
235
|
|
|
236
236
|
if (open || watch) {
|
|
237
237
|
config.testsFinishTimeout = 15 * 60 * 1000;
|
|
@@ -248,7 +248,7 @@ export class WTRConfig {
|
|
|
248
248
|
return config;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
getBrowsers(browsers) {
|
|
251
|
+
getBrowsers(browsers, deviceScaleFactor) {
|
|
252
252
|
browsers = (this.#requestedBrowsers || browsers || DEFAULT_BROWSERS).map(b => BROWSER_MAP[b] || BROWSER_MAP.chrome);
|
|
253
253
|
|
|
254
254
|
if (!Array.isArray(browsers)) throw new TypeError('browsers must be an array');
|
|
@@ -256,7 +256,7 @@ export class WTRConfig {
|
|
|
256
256
|
return [...new Set(browsers)].map((b) => playwrightLauncher({
|
|
257
257
|
concurrency: b === BROWSER_MAP.firefox || this.#cliArgs.open ? 1 : undefined, // focus in Firefox unreliable if concurrency > 1 (https://github.com/modernweb-dev/web/issues/238)
|
|
258
258
|
product: b,
|
|
259
|
-
createBrowserContext: ({ browser }) => browser.newContext({ deviceScaleFactor
|
|
259
|
+
createBrowserContext: ({ browser }) => browser.newContext({ deviceScaleFactor, reducedMotion: 'reduce' }),
|
|
260
260
|
launchOptions: {
|
|
261
261
|
headless: !this.#cliArgs.open,
|
|
262
262
|
devtools: false,
|