Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests_primary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
strategy:
fail-fast: false
matrix:
package: [html-reporter, web]
package: [html-reporter, coverage-report, web]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
6 changes: 6 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const ignores = [
"packages/html-reporter/playwright.config.ts",
"packages/html-reporter/tests/*",
"packages/html-reporter/vite.config.ts",
"packages/coverage-report/playwright.config.ts",
"packages/coverage-report/tests/*",
"packages/coverage-report/vite.config.ts",
"test-results/",
"tests/assets/",
"tests/components/",
Expand Down Expand Up @@ -284,6 +287,8 @@ const reactBaseConfig = fixupConfigRules(
const reactFiles = [
`packages/html-reporter/src/**/*.ts`,
`packages/html-reporter/src/**/*.tsx`,
`packages/coverage-report/src/**/*.ts`,
`packages/coverage-report/src/**/*.tsx`,
`packages/recorder/src/**/*.ts`,
`packages/recorder/src/**/*.tsx`,
`packages/trace-viewer/src/**/*.ts`,
Expand Down Expand Up @@ -528,6 +533,7 @@ export default [
files: reactFiles,
})),
reactPackageSection("html-reporter"),
reactPackageSection("coverage-report"),
reactPackageSection("recorder"),
reactPackageSection("trace-viewer"),
];
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"stest": "playwright test --config=tests/stress/playwright.config.ts",
"biditest": "playwright test --config=tests/bidi/playwright.config.ts",
"test-html-reporter": "playwright test --config=packages/html-reporter",
"test-coverage-report": "playwright test --config=packages/coverage-report",
"test-web": "playwright test --config=packages/web",
"ttest": "node ./tests/playwright-test/stable-test-runner/node_modules/@playwright/test/cli test --config=tests/playwright-test/playwright.config.ts",
"test": "playwright test --config=tests/library/playwright.config.ts",
Expand Down
29 changes: 29 additions & 0 deletions packages/coverage-report/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!--
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.
-->

<!DOCTYPE html>
<html style='scrollbar-gutter: stable both-edges;'>
<head>
<meta charset='UTF-8'>
<meta name='color-scheme' content='dark light'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Playwright Coverage Report</title>
</head>
<body>
<div id='root'></div>
<script type='module' src='/src/index.tsx'></script>
</body>
</html>
6 changes: 6 additions & 0 deletions packages/coverage-report/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "coverage-report",
"private": true,
"version": "0.0.0",
"type": "module"
}
55 changes: 55 additions & 0 deletions packages/coverage-report/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* 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.
*/

import path from 'path';
import url from 'url';
import { devices, defineConfig } from '@playwright/test';

process.env.PWTEST_UNDER_TEST = '1';

const dirname = path.dirname(url.fileURLToPath(import.meta.url));
const outputDir = path.join(dirname, '..', '..', 'test-results');

export default defineConfig({
testDir: 'src',
outputDir,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: process.env.CI ? [
['dot'],
['json', { outputFile: path.join(outputDir, 'report.json') }],
['blob', { outputDir: path.join(dirname, '..', '..', 'blob-report') }],
['../../tests/config/parquetReporter.ts'],
] : [
['html', { open: 'on-failure' }]
],
tag: process.env.PW_TAG,
use: {
baseURL: 'http://localhost:3103/tests/index.html',
serviceWorkers: 'block',
reuseContext: true,
trace: 'on-first-retry',
},
projects: [{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
}],
webServer: {
command: 'npx vite --port 3103 --strictPort',
url: 'http://localhost:3103/tests/index.html',
reuseExistingServer: !process.env.CI,
},
});
6 changes: 6 additions & 0 deletions packages/coverage-report/src/DEPS.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[*]
@web/**
@isomorphic/**

[coverageView.spec.ts]
***
Loading
Loading