test: use ToT test runner for non-test-runner tests (#8671)
This commit is contained in:
parent
d9bcb0b170
commit
2b4a93972d
|
|
@ -24,7 +24,7 @@ console.log(`Updating test runner...`);
|
||||||
try {
|
try {
|
||||||
execSync('npm ci --save=false --fund=false --audit=false', {
|
execSync('npm ci --save=false --fund=false --audit=false', {
|
||||||
stdio: ['inherit', 'inherit', 'inherit'],
|
stdio: ['inherit', 'inherit', 'inherit'],
|
||||||
cwd: path.join(__dirname, 'tests', 'config', 'test-runner'),
|
cwd: path.join(__dirname, 'tests', 'playwright-test', 'stable-test-runner'),
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,13 @@
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"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",
|
"ctest": "npm run basetest -- --config=tests/config/default.config.ts --project=chromium",
|
||||||
"ftest": "npm run basetest -- --config=tests/config/default.config.ts --project=firefox",
|
"ftest": "npm run basetest -- --config=tests/config/default.config.ts --project=firefox",
|
||||||
"wtest": "npm run basetest -- --config=tests/config/default.config.ts --project=webkit",
|
"wtest": "npm run basetest -- --config=tests/config/default.config.ts --project=webkit",
|
||||||
"atest": "npm run basetest -- --config=tests/config/android.config.ts",
|
"atest": "npm run basetest -- --config=tests/config/android.config.ts",
|
||||||
"etest": "npm run basetest -- --config=tests/config/electron.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",
|
"test": "npm run basetest -- --config=tests/config/default.config.ts",
|
||||||
"eslint": "[ \"$CI\" = true ] && eslint --quiet -f codeframe --ext ts,tsx . || eslint --ext ts,tsx .",
|
"eslint": "[ \"$CI\" = true ] && eslint --quiet -f codeframe --ext ts,tsx . || eslint --ext ts,tsx .",
|
||||||
"tsc": "tsc -p .",
|
"tsc": "tsc -p .",
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Config } from '../config/test-runner';
|
import type { Config } from './test-runner';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { test as pageTest } from '../page/pageTest';
|
import { test as pageTest } from '../page/pageTest';
|
||||||
import { androidFixtures } from '../android/androidTest';
|
import { androidFixtures } from '../android/androidTest';
|
||||||
|
|
|
||||||
17
tests/config/test-runner.d.ts
vendored
Normal file
17
tests/config/test-runner.d.ts
vendored
Normal 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';
|
||||||
17
tests/config/test-runner.js
Normal file
17
tests/config/test-runner.js
Normal 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');
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* 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 { spawn } from 'child_process';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
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');
|
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 {
|
export function stripAscii(str: string): string {
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Config } from '../config/test-runner';
|
import { Config } from './stable-test-runner';
|
||||||
|
|
||||||
const config: Config = {
|
const config: Config = {
|
||||||
testDir: __dirname,
|
testDir: __dirname,
|
||||||
testIgnore: 'assets/**',
|
testIgnore: ['assets/**', 'stable-test-runner/**'],
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
forbidOnly: !!process.env.CI,
|
forbidOnly: !!process.env.CI,
|
||||||
preserveOutput: process.env.CI ? 'failures-only' : 'always',
|
preserveOutput: process.env.CI ? 'failures-only' : 'always',
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import type { Browser, Locator, Page } from '../../index';
|
import type { Browser, Locator, Page } from '../../index';
|
||||||
import { showTraceViewer } from '../../lib/server/trace/viewer/traceViewer';
|
import { showTraceViewer } from '../../lib/server/trace/viewer/traceViewer';
|
||||||
import { playwrightTest } from '../config/browserTest';
|
import { playwrightTest, expect } from '../config/browserTest';
|
||||||
import { expect } from '../config/test-runner';
|
|
||||||
|
|
||||||
class TraceViewerPage {
|
class TraceViewerPage {
|
||||||
actionTitles: Locator;
|
actionTitles: Locator;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue