From 525a5d091c858afe8ca2e232854f6d4670bef461 Mon Sep 17 00:00:00 2001 From: Akshay K <akshay.k@niveussolutions.com> Date: Thu, 30 Jan 2025 19:37:03 +0530 Subject: [PATCH] monocart report added --- package.json | 3 ++- playwright.config.js | 26 +++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index ee4d0a8..07a8eb4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "license": "ISC", "devDependencies": { "@playwright/test": "^1.50.0", - "@types/node": "^20.9.0" + "@types/node": "^20.9.0", + "monocart-reporter": "^2.9.13" }, "dependencies": { "sonar-scanner": "^3.1.0" diff --git a/playwright.config.js b/playwright.config.js index 7153976..4f20ed6 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -1,5 +1,5 @@ // @ts-check -const { defineConfig, devices } = require('@playwright/test'); +const { defineConfig, devices } = require("@playwright/test"); /** * Read environment variables from file. @@ -13,7 +13,7 @@ const { defineConfig, devices } = require('@playwright/test'); module.exports = defineConfig({ timeout: 70000, expect: { timeout: 70000 }, - testDir: './tests', + testDir: "./tests", /* Run tests in files in parallel */ fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ @@ -23,22 +23,31 @@ module.exports = defineConfig({ /* Opt out of parallel tests on CI. */ workers: process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', + reporter: [ + ["list"], + [ + "monocart-reporter", + { + name: "My Test Report", + outputFile: "./monocart-report/index.html" + } + ] + ], /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ // baseURL: 'http://127.0.0.1:3000', /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', + trace: "on-first-retry" }, /* Configure projects for major browsers */ projects: [ { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - }, + name: "chromium", + use: { ...devices["Desktop Chrome"] } + } // { // name: 'firefox', @@ -69,7 +78,7 @@ module.exports = defineConfig({ // name: 'Google Chrome', // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, // }, - ], + ] /* Run your local dev server before starting the tests */ // webServer: { @@ -78,4 +87,3 @@ module.exports = defineConfig({ // reuseExistingServer: !process.env.CI, // }, }); - -- GitLab