@brightspace-ui/testing 1.13.5 → 1.14.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 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.13.5",
5
+ "version": "1.14.0",
6
6
  "repository": "https://github.com/BrightspaceUI/testing.git",
7
7
  "scripts": {
8
8
  "lint": "npm run lint:eslint && npm run lint:style",
@@ -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: 2, reducedMotion: 'reduce' }),
259
+ createBrowserContext: ({ browser }) => browser.newContext({ deviceScaleFactor, reducedMotion: 'reduce' }),
260
260
  launchOptions: {
261
261
  headless: !this.#cliArgs.open,
262
262
  devtools: false,