diff --git a/.github/actions/run-test/action.yml b/.github/actions/run-test/action.yml index 3f458b8b6247f..549ae33dbb100 100644 --- a/.github/actions/run-test/action.yml +++ b/.github/actions/run-test/action.yml @@ -61,13 +61,13 @@ runs: fi shell: bash env: - PWTEST_BOT_NAME: ${{ inputs.bot-name }} + PW_TAG: "@${{ inputs.bot-name }}" - name: Run tests if: inputs.shell != 'bash' run: ${{ inputs.command }} shell: ${{ inputs.shell }} env: - PWTEST_BOT_NAME: ${{ inputs.bot-name }} + PW_TAG: "@${{ inputs.bot-name }}" - name: Azure Login uses: azure/login@v2 if: ${{ !cancelled() && github.event_name == 'push' && github.repository == 'microsoft/playwright' }} diff --git a/.github/workflows/tests_primary.yml b/.github/workflows/tests_primary.yml index f55bc25572f41..a104607b3cefb 100644 --- a/.github/workflows/tests_primary.yml +++ b/.github/workflows/tests_primary.yml @@ -141,8 +141,6 @@ jobs: test_vscode_extension: name: VSCode Extension runs-on: ubuntu-latest - env: - PWTEST_BOT_NAME: "vscode-extension" steps: - uses: actions/checkout@v5 - uses: actions/setup-node@v6 @@ -167,12 +165,14 @@ jobs: - name: Run extension tests run: npm run test -- --workers=1 working-directory: ./playwright-vscode + env: + PW_TAG: "@vscode-extension" - name: Upload blob report if: ${{ !cancelled() }} uses: ./.github/actions/upload-blob-report with: report_dir: playwright-vscode/blob-report - job_name: ${{ env.PWTEST_BOT_NAME }} + job_name: vscode-extension test_package_installations: name: "Installation Test ${{ matrix.os }}" diff --git a/packages/playwright/src/reporters/blob.ts b/packages/playwright/src/reporters/blob.ts index 4d01cc97db2ad..cc0312546a3b8 100644 --- a/packages/playwright/src/reporters/blob.ts +++ b/packages/playwright/src/reporters/blob.ts @@ -52,6 +52,7 @@ export class BlobReporter extends TeleReporterEmitter { const metadata: BlobReportMetadata = { version: currentBlobReportVersion, userAgent: getUserAgent(), + // TODO: remove after some time, recommend config.tag instead. name: process.env.PWTEST_BOT_NAME, shard: config.shard ?? undefined, pathSeparator: path.sep, diff --git a/packages/web/playwright.config.ts b/packages/web/playwright.config.ts deleted file mode 100644 index 7b32fcf6b228f..0000000000000 --- a/packages/web/playwright.config.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * 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 { devices, defineConfig } from '@playwright/experimental-ct-react'; - -import type { ReporterDescription } from '@playwright/test'; - -const reporters = () => { - const result: ReporterDescription[] = process.env.CI ? [ - ['blob', { fileName: `${process.env.PWTEST_BOT_NAME}.zip` }], - ] : [ - ['html'] - ]; - return result; -}; - -export default defineConfig({ - testDir: 'src', - forbidOnly: !!process.env.CI, - retries: process.env.CI ? 2 : 0, - reporter: reporters(), - use: { - ctPort: 3102, - trace: 'on-first-retry', - }, - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - }, - ], -}); diff --git a/tests/bidi/playwright.config.ts b/tests/bidi/playwright.config.ts index c2f414dfc0559..946b715041043 100644 --- a/tests/bidi/playwright.config.ts +++ b/tests/bidi/playwright.config.ts @@ -44,7 +44,7 @@ const reporters = () => { const result: ReporterDescription[] = process.env.CI ? [ hasDebugOutput ? ['list'] : ['dot'], ['json', { outputFile: path.join(outputDir, 'report.json') }], - ['blob', { fileName: `${process.env.PWTEST_BOT_NAME}.zip` }], + ['blob'], ['./csvReporter', { outputFile: path.join(outputDir, 'report.csv') }], ] : [ ['html', { open: 'on-failure' }], @@ -60,6 +60,7 @@ const config: Config = { ['dot'], ['json', { outputFile: path.join(outputDir, 'report.json') }], // Needed since tests/electron/package.json exists which would otherwise be picked up as tests/electron/ (outputDir) - ['blob', { fileName: path.join(__dirname, '../../blob-report/', `${process.env.PWTEST_BOT_NAME}.zip`) }], + ['blob', { outputDir: path.resolve(__dirname, '../../blob-report') }], ] : 'line', + tag: process.env.PW_TAG, projects: [], globalSetup: './globalSetup.ts' }; diff --git a/tests/installation/playwright.config.ts b/tests/installation/playwright.config.ts index f61efa87ffc17..dc94618aea7aa 100644 --- a/tests/installation/playwright.config.ts +++ b/tests/installation/playwright.config.ts @@ -24,7 +24,7 @@ const reporters = () => { const result: ReporterDescription[] = process.env.CI ? [ ['dot'], ['json', { outputFile: path.join(outputDir, 'report.json') }], - ['blob', { fileName: `${process.env.PWTEST_BOT_NAME}.zip` }], + ['blob'], ] : [ ['list'], ['html', { open: 'on-failure' }] @@ -40,6 +40,7 @@ export default defineConfig({ timeout: 5 * 60 * 1000, retries: process.env.CI ? 3 : 0, reporter: reporters(), + tag: process.env.PW_TAG, forbidOnly: !!process.env.CI, workers: 1, projects: [ diff --git a/tests/library/playwright.config.ts b/tests/library/playwright.config.ts index cb946173dba8a..fdfbfb66b3372 100644 --- a/tests/library/playwright.config.ts +++ b/tests/library/playwright.config.ts @@ -46,7 +46,7 @@ const reporters = () => { const result: ReporterDescription[] = process.env.CI ? [ ['dot'], ['json', { outputFile: path.join(outputDir, 'report.json') }], - ['blob', { fileName: `${process.env.PWTEST_BOT_NAME}.zip` }], + ['blob'], ] : [ ['html', { open: 'on-failure', title: 'Playwright Library Tests' }] ]; @@ -100,6 +100,7 @@ const config: Config { const result: ReporterDescription[] = process.env.CI ? [ ['dot'], ['json', { outputFile: path.join(outputDir, 'report.json') }], - ['blob', { outputDir: path.join(__dirname, '..', '..', 'blob-report'), fileName: `${process.env.PWTEST_BOT_NAME}.zip` }], + ['blob', { outputDir: path.join(__dirname, '..', '..', 'blob-report') }], ] : [ ['list'] ]; @@ -51,6 +51,7 @@ export default defineConfig({ forbidOnly: !!process.env.CI, workers: process.env.CI ? 2 : undefined, reporter: reporters(), + tag: process.env.PW_TAG, projects: [ { name: 'chrome', metadata: { ...metadata, browserName: 'chromium', channel: 'chrome' }, testDir }, { name: 'chromium', use: { mcpBrowser: 'chromium' }, metadata: { ...metadata, browserName: 'chromium' }, testDir }, diff --git a/tests/playwright-test/playwright.config.ts b/tests/playwright-test/playwright.config.ts index 61ea0bfd677b5..0f01dc3cde173 100644 --- a/tests/playwright-test/playwright.config.ts +++ b/tests/playwright-test/playwright.config.ts @@ -25,7 +25,7 @@ const reporters = () => { const result: ReporterDescription[] = process.env.CI ? [ ['dot'], ['json', { outputFile: path.join(outputDir, 'report.json') }], - ['blob', { outputDir: path.join(__dirname, '..', '..', 'blob-report'), fileName: `${process.env.PWTEST_BOT_NAME}.zip` }], + ['blob', { outputDir: path.join(__dirname, '..', '..', 'blob-report') }], ] : [ ['list'] ]; @@ -49,6 +49,7 @@ export default defineConfig({ } ], reporter: reporters(), + tag: process.env.PW_TAG, metadata: { clock: process.env.PW_CLOCK ? 'clock-' + process.env.PW_CLOCK : undefined, }, diff --git a/tests/webview2/playwright.config.ts b/tests/webview2/playwright.config.ts index e33981d7329cb..57e9b3fc4b7b1 100644 --- a/tests/webview2/playwright.config.ts +++ b/tests/webview2/playwright.config.ts @@ -39,8 +39,9 @@ const config: Config = { reporter: process.env.CI ? [ ['dot'], ['json', { outputFile: path.join(outputDir, 'report.json') }], - ['blob', { fileName: `${process.env.PWTEST_BOT_NAME}.zip` }], + ['blob'], ] : 'line', + tag: process.env.PW_TAG, projects: [], globalSetup: './globalSetup.ts', };