-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11453 from keymanapp/chore/web/kbd-proc-test-migr…
…ation chore(web): conversion of Web keyboard-loading browser-tests for @web/test-runner use 🏃
- Loading branch information
Showing
9 changed files
with
105 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
common/web/keyboard-processor/tests/dom/web-test-runner.CI.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// @ts-check | ||
import BASE_CONFIG from './web-test-runner.config.mjs'; | ||
import teamcityReporter from '@keymanapp/common-test-resources/test-runner-TC-reporter.mjs'; | ||
import { sessionStabilityReporter } from '@keymanapp/common-test-resources/test-runner-stability-reporter.mjs'; | ||
|
||
/** @type {import('@web/test-runner').TestRunnerConfig} */ | ||
export default { | ||
...BASE_CONFIG, | ||
reporters: [ | ||
teamcityReporter(), /* custom-written, for CI-friendly reports */ | ||
sessionStabilityReporter({ciMode: true}) | ||
] | ||
} |
62 changes: 62 additions & 0 deletions
62
common/web/keyboard-processor/tests/dom/web-test-runner.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// @ts-check | ||
import { devices, playwrightLauncher } from '@web/test-runner-playwright'; | ||
import { esbuildPlugin } from '@web/dev-server-esbuild'; | ||
import { defaultReporter, summaryReporter } from '@web/test-runner'; | ||
import { LauncherWrapper, sessionStabilityReporter } from '@keymanapp/common-test-resources/test-runner-stability-reporter.mjs'; | ||
import { importMapsPlugin } from '@web/dev-server-import-maps'; | ||
import { dirname, resolve } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
const dir = dirname(fileURLToPath(import.meta.url)); | ||
const KEYMAN_ROOT = resolve(dir, '../../../../..'); | ||
|
||
/** @type {import('@web/test-runner').TestRunnerConfig} */ | ||
export default { | ||
// debug: true, | ||
browsers: [ | ||
new LauncherWrapper(playwrightLauncher({ product: 'chromium' })), | ||
new LauncherWrapper(playwrightLauncher({ product: 'firefox' })), | ||
new LauncherWrapper(playwrightLauncher({ product: 'webkit', concurrency: 1 })), | ||
], | ||
concurrency: 10, | ||
nodeResolve: true, | ||
files: [ | ||
'**/*.spec.ts' | ||
], | ||
middleware: [ | ||
// Rewrites short-hand paths for test resources, making them fully relative to the repo root. | ||
function rewriteResourcePath(context, next) { | ||
if(context.url.startsWith('/resources/')) { | ||
context.url = '/common/test' + context.url; | ||
} | ||
|
||
return next(); | ||
} | ||
], | ||
plugins: [ | ||
esbuildPlugin({ts: true, target: 'auto'}), | ||
importMapsPlugin({ | ||
inject: { | ||
importMap: { | ||
// Redirects `eventemitter3` imports to the bundled ESM library. The standard import is an | ||
// ESM wrapper around the CommonJS implementation, and WTR fails when it hits the CommonJS. | ||
imports: { | ||
'eventemitter3': '/node_modules/eventemitter3/dist/eventemitter3.esm.js' | ||
} | ||
} | ||
} | ||
}) | ||
], | ||
reporters: [ | ||
summaryReporter({}), /* local-dev mocha-style */ | ||
sessionStabilityReporter({}), | ||
defaultReporter({}) | ||
], | ||
/* | ||
Un-comment the next two lines for easy interactive debugging; it'll launch the | ||
test page in your preferred browser. | ||
*/ | ||
// open: true, | ||
// manual: true, | ||
rootDir: KEYMAN_ROOT | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.