@brightspace-ui/testing 1.13.0 → 1.13.1

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.0",
5
+ "version": "1.13.1",
6
6
  "repository": "https://github.com/BrightspaceUI/testing.git",
7
7
  "scripts": {
8
8
  "lint": "eslint . --ext .js",
@@ -5,8 +5,6 @@ import { visualDiff } from './visual-diff-plugin.js';
5
5
  import { visualDiffReporter } from './visual-diff-reporter.js';
6
6
 
7
7
  const DEFAULT_PATTERN = type => `./test/**/*.${type}.js`;
8
- const ALLOWED_BROWSERS = ['chrome', 'chromium', 'firefox', 'safari', 'webkit'];
9
- const DEFAULT_BROWSERS = ['chromium', 'firefox', 'webkit'];
10
8
  const BROWSER_MAP = {
11
9
  chrome: 'chromium',
12
10
  chromium: 'chromium',
@@ -14,6 +12,8 @@ const BROWSER_MAP = {
14
12
  safari: 'webkit',
15
13
  webkit: 'webkit'
16
14
  };
15
+ const ALLOWED_BROWSERS = Object.keys(BROWSER_MAP);
16
+ const DEFAULT_BROWSERS = [...new Set(Object.values(BROWSER_MAP))];
17
17
  const TIMEZONE = '{"name":"Canada - Toronto","identifier":"America/Toronto"}';
18
18
  const FONT_ASSETS = 'https://s.brightspace.com/lib/fonts/0.6.0/assets/';
19
19
  const SUPPRESS_RESIZE_OBSERVER_ERRORS = `
@@ -71,7 +71,7 @@ export class WTRConfig {
71
71
  return {
72
72
  name: 'vdiff',
73
73
  files: this.#pattern,
74
- browsers: ['chrome'],
74
+ browsers: [BROWSER_MAP.chrome],
75
75
  testRunnerHtml: testFramework =>
76
76
  `<!DOCTYPE html>
77
77
  <html lang="en" data-timezone='${TIMEZONE}'>
@@ -249,18 +249,19 @@ export class WTRConfig {
249
249
  }
250
250
 
251
251
  getBrowsers(browsers) {
252
- browsers = (this.#requestedBrowsers || browsers || DEFAULT_BROWSERS).map(b => BROWSER_MAP[b] || 'chromium');
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');
255
255
 
256
256
  return [...new Set(browsers)].map((b) => playwrightLauncher({
257
- concurrency: b === 'firefox' || this.#cliArgs.open ? 1 : undefined, // focus in Firefox unreliable if concurrency > 1 (https://github.com/modernweb-dev/web/issues/238)
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
259
  createBrowserContext: ({ browser }) => browser.newContext({ deviceScaleFactor: 2, reducedMotion: 'reduce' }),
260
260
  launchOptions: {
261
261
  headless: !this.#cliArgs.open,
262
262
  devtools: false,
263
- slowMo: this.#cliArgs.slowmo || 0
263
+ slowMo: this.#cliArgs.slowmo || 0,
264
+ args: b === BROWSER_MAP.chrome ? ['--disable-gpu-rasterization'] : []
264
265
  }
265
266
  }));
266
267
  }