diff --git a/package-lock.json b/package-lock.json index d37a5121..c05eeaea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@brightspace-ui/testing", - "version": "0.10.0", + "version": "0.11.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@brightspace-ui/testing", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@open-wc/testing": "^3", @@ -2659,9 +2659,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.435", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.435.tgz", - "integrity": "sha512-B0CBWVFhvoQCW/XtjRzgrmqcgVWg6RXOEM/dK59+wFV93BFGR6AeNKc4OyhM+T3IhJaOOG8o/V+33Y2mwJWtzw==", + "version": "1.4.437", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.437.tgz", + "integrity": "sha512-ZFekRuBOHUXp21wrR5lshT6pZa/KmjkhKBAtmZz4NN5sCWlHOk3kdhiwFINrDBsRLX6FjyBAb1TRN+KBeNlyzQ==", "dev": true, "peer": true }, @@ -3642,9 +3642,9 @@ } }, "node_modules/glob": { - "version": "10.2.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.7.tgz", - "integrity": "sha512-jTKehsravOJo8IJxUGfZILnkvVJM/MOfHRs8QcXolVef2zNI9Tqyy5+SeuOAZd3upViEZQLyFpQhYiHLrMUNmA==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.0.tgz", + "integrity": "sha512-AQ1/SB9HH0yCx1jXAT4vmCbTOPe5RQ+kCurjbel5xSCGhebumUv+GJZfa1rEqor3XIViqwSEmlkZCQD43RWrBg==", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.0.3", diff --git a/package.json b/package.json index 24e141c1..aa9c19ad 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@brightspace-ui/testing", "description": "Utilities for testing front-end components and applications", "type": "module", - "version": "0.10.0", + "version": "0.11.0", "repository": "https://github.com/BrightspaceUI/testing.git", "scripts": { "lint": "eslint . --ext .js", diff --git a/src/browser/commands.js b/src/browser/commands.js index c54aaa8f..3e65c4ba 100644 --- a/src/browser/commands.js +++ b/src/browser/commands.js @@ -37,7 +37,7 @@ export async function sendKeys(action, keys) { await cmdSendKeys(val); } -export async function sendKeysElem(action, keys, elem) { +export async function sendKeysElem(elem, action, keys) { if (elem) { await focusElem(elem); } diff --git a/src/server/headed-mode-plugin.js b/src/server/headed-mode-plugin.js index 3479fe9f..cc4c757d 100644 --- a/src/server/headed-mode-plugin.js +++ b/src/server/headed-mode-plugin.js @@ -2,7 +2,7 @@ import { globSync } from 'glob'; export function headedMode({ manual, watch, pattern }) { - const files = globSync(pattern, { ignore: 'node_modules/**' }); + const files = globSync(pattern, { ignore: 'node_modules/**', posix: true }); return { name: 'brightspace-headed-mode', diff --git a/src/server/wtr-config.js b/src/server/wtr-config.js index bba1362a..dd21b77d 100644 --- a/src/server/wtr-config.js +++ b/src/server/wtr-config.js @@ -13,10 +13,10 @@ const optionDefinitions = [ { name: 'watch', type: Boolean }, // custom options { name: 'chromium', type: Boolean }, + { name: 'filter', alias: 'f', type: String, multiple: true }, { name: 'firefox', type: Boolean }, { name: 'golden', type: Boolean }, { name: 'grep', alias: 'g', type: String }, - { name: 'filter', alias: 'f', type: String, multiple: true }, { name: 'timeout', type: Number }, { name: 'webkit', type: Boolean }, ]; @@ -213,6 +213,7 @@ export class WTRConfig { if (!Array.isArray(browsers)) throw new TypeError('browsers must be an array'); return browsers.map((b) => playwrightLauncher({ + concurrency: b === 'firefox' ? 1 : undefined, // focus in Firefox unreliable if concurrency > 1 (https://github.com/modernweb-dev/web/issues/238) product: b, createBrowserContext: ({ browser }) => browser.newContext({ deviceScaleFactor: 2, reducedMotion: 'reduce' }) })); diff --git a/test/browser/commands.test.js b/test/browser/commands.test.js index 104321dd..7a3708a2 100644 --- a/test/browser/commands.test.js +++ b/test/browser/commands.test.js @@ -58,7 +58,7 @@ describe('commands', () => { }); it('should send keys to element', async() => { - await sendKeysElem('type', 'Hello', elem); + await sendKeysElem(elem, 'type', 'Hello'); expect(elem.value).to.equal('Hello'); });