test: use ToT test runner for non-test-runner tests (#8671)

This commit is contained in:
Dmitry Gozman 2021-09-03 11:22:25 -07:00 committed by GitHub
parent d9bcb0b170
commit 2b4a93972d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 43 additions and 10 deletions

View file

@ -24,7 +24,7 @@ console.log(`Updating test runner...`);
try {
execSync('npm ci --save=false --fund=false --audit=false', {
stdio: ['inherit', 'inherit', 'inherit'],
cwd: path.join(__dirname, 'tests', 'config', 'test-runner'),
cwd: path.join(__dirname, 'tests', 'playwright-test', 'stable-test-runner'),
});
} catch (e) {
process.exit(1);

View file

@ -9,13 +9,13 @@
"node": ">=12"
},
"scripts": {
"basetest": "node ./tests/config/test-runner/node_modules/@playwright/test/lib/cli/cli.js test",
"basetest": "cross-env PWTEST_CLI_ALLOW_TEST_COMMAND=1 node ./lib/cli/cli test",
"ctest": "npm run basetest -- --config=tests/config/default.config.ts --project=chromium",
"ftest": "npm run basetest -- --config=tests/config/default.config.ts --project=firefox",
"wtest": "npm run basetest -- --config=tests/config/default.config.ts --project=webkit",
"atest": "npm run basetest -- --config=tests/config/android.config.ts",
"etest": "npm run basetest -- --config=tests/config/electron.config.ts",
"ttest": "npm run basetest -- --config=tests/playwright-test/playwright-test.config.ts",
"ttest": "node ./tests/playwright-test/stable-test-runner/node_modules/@playwright/test/lib/cli/cli test --config=tests/playwright-test/playwright-test.config.ts",
"test": "npm run basetest -- --config=tests/config/default.config.ts",
"eslint": "[ \"$CI\" = true ] && eslint --quiet -f codeframe --ext ts,tsx . || eslint --ext ts,tsx .",
"tsc": "tsc -p .",

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
import type { Config } from '../config/test-runner';
import type { Config } from './test-runner';
import * as path from 'path';
import { test as pageTest } from '../page/pageTest';
import { androidFixtures } from '../android/androidTest';

17
tests/config/test-runner.d.ts vendored Normal file
View file

@ -0,0 +1,17 @@
/**
* Copyright (c) Microsoft Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from '../../types/test';

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) Microsoft Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module.exports = require('../../lib/test/index');

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
import { TestInfo, test as base } from '../config/test-runner';
import { TestInfo, test as base } from './stable-test-runner';
import { spawn } from 'child_process';
import * as fs from 'fs';
import * as path from 'path';
@ -273,7 +273,7 @@ const TSCONFIG = {
]
};
export { expect } from '../config/test-runner';
export { expect } from './stable-test-runner';
const asciiRegex = new RegExp('[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))', 'g');
export function stripAscii(str: string): string {

View file

@ -14,11 +14,11 @@
* limitations under the License.
*/
import { Config } from '../config/test-runner';
import { Config } from './stable-test-runner';
const config: Config = {
testDir: __dirname,
testIgnore: 'assets/**',
testIgnore: ['assets/**', 'stable-test-runner/**'],
timeout: 30000,
forbidOnly: !!process.env.CI,
preserveOutput: process.env.CI ? 'failures-only' : 'always',

View file

@ -17,8 +17,7 @@
import path from 'path';
import type { Browser, Locator, Page } from '../../index';
import { showTraceViewer } from '../../lib/server/trace/viewer/traceViewer';
import { playwrightTest } from '../config/browserTest';
import { expect } from '../config/test-runner';
import { playwrightTest, expect } from '../config/browserTest';
class TraceViewerPage {
actionTitles: Locator;