Scripts from package.json:
"scripts": {
"all": "npm-run-all debug1 debug2 merge-reports",
"debug1": "npx playwright test --grep @debug1 --workers=1",
"debug2": "npx playwright test --grep @debug2 --workers=3",
"merge-reports": "npx playwright merge-reports --reporter html ./blob-report",
},
I need a script that will run all tests and adjust the number of workers depending on the tag. As a result, I should get one combined report. With the current implementation, I only get a report for the debug2.
I tried using “merge-reports”, but when the execution of the ‘all’ script reaches “merge-reports”, the report from “debug2” overwrites “debug1”, and as a result, I only get the report from “debug2”.
playwright.config.ts:
import { defineConfig, devices } from '@playwright/test';
require('dotenv').config();
export default defineConfig({
timeout: 160000,
testDir: './tests',
fullyParallel: true,
expect: { timeout: 10000, toHaveScreenshot: { maxDiffPixels: 200 } },
workers: process.env.CI ? 1 : undefined,
reporter: 'blob',
use: {
headless: true,
baseURL: process.env.BASEURL,
ignoreHTTPSErrors: true,
locale: 'ru-Ru',
screenshot: 'only-on-failure',
video: {
mode: 'off',
//size: { width: 1920, height: 1080 },
},
},
projects: [
{
name: 'desktop',
testDir: './tests',
use: { ...devices['Desktop Chrome'], viewport: { width: 1920, height: 1080 } },
},
],
});
0