mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 00:15:32 +00:00
Merge pull request #16032 from keymanapp/chore/web-core-preflight-replay-15949-15895_WindowsTc
maint(web): fix running web e2e tests on Windows 🎼 🍒
This commit is contained in:
commit
49fa04bdcb
5 changed files with 14 additions and 3 deletions
|
|
@ -135,6 +135,8 @@ function Teamcity(runner, options) {
|
|||
const ignoredTests = {};
|
||||
const testState = { pending: 0 };
|
||||
|
||||
log('Initializing Mocha TeamCity Reporter');
|
||||
|
||||
runner.on(EVENT_SUITE_BEGIN, function (suite) {
|
||||
handleFlow(true, hasParentFlowId);
|
||||
if (suite.root) {
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ export default class PlaywrightTeamcityReporter implements Reporter {
|
|||
private root!: TestNode;
|
||||
|
||||
public constructor(options: { parentFlow?: string } = {}) {
|
||||
console.log('Initializing Playwright TeamCity Reporter');
|
||||
TestNode.RootFlow = options.parentFlow ?? 'unit_tests';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,14 +94,16 @@ export default function teamcityReporter({ name="Web Test Runner JavaScript test
|
|||
|
||||
/** @type {import('@web/test-runner').Reporter} */
|
||||
const reporter = {
|
||||
start({config, sessions}) {
|
||||
start({ config, sessions }) {
|
||||
logger = config.logger;
|
||||
logger.log('Initializing Web Test Runner TeamCity Reporter');
|
||||
|
||||
rootDir = config.rootDir;
|
||||
|
||||
for(const session of sessions.all()) {
|
||||
testDefMap.set(buildSessionName(session), new Map());
|
||||
}
|
||||
|
||||
logger = config.logger;
|
||||
logger.log(`##teamcity[blockOpened name='${e(name)}']`);
|
||||
},
|
||||
stop(args) {
|
||||
|
|
|
|||
|
|
@ -205,12 +205,15 @@ function do_browser_tests() {
|
|||
|
||||
pushd "${KEYMAN_ROOT}"
|
||||
if is_test_included dom; then
|
||||
builder_echo "Running browser-based tests..."
|
||||
web-test-runner --config "web/src/test/auto/dom/web-test-runner${WTR_CONFIG}.config.mjs" ${WTR_INSPECT}
|
||||
fi
|
||||
if is_test_included integrated; then
|
||||
builder_echo "Running integration tests..."
|
||||
web-test-runner --config "web/src/test/auto/integrated/web-test-runner${WTR_CONFIG}.config.mjs" ${WTR_INSPECT}
|
||||
fi
|
||||
if is_test_included e2e; then
|
||||
builder_echo "Running end-to-end tests..."
|
||||
npx playwright test --config "web/src/test/auto/e2e/playwright.config.ts"
|
||||
fi
|
||||
popd
|
||||
|
|
|
|||
|
|
@ -76,7 +76,10 @@ export default defineConfig({
|
|||
|
||||
/* Run your local dev server before starting the tests */
|
||||
webServer: {
|
||||
command: `"${KEYMAN_ROOT}/node_modules/.bin/gosh" "../../../../build.sh start"`,
|
||||
// Normally we'd run `web/build.sh start` or `gosh web/build.sh start`
|
||||
// here, but that's causing problems on Windows.
|
||||
command: 'node web/src/tools/testing/test-server/index.cjs',
|
||||
cwd: KEYMAN_ROOT,
|
||||
url: 'http://localhost:3000',
|
||||
reuseExistingServer: !process.env.KEYMAN_IS_CI_BUILD,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue