Skip to content

Commit deeb121

Browse files
committed
Added croos-env
1 parent 4f60b28 commit deeb121

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎.github/workflows/playwright.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
run: npm run test:serial:ci
4545
env:
4646
ENV: "qa"
47+
CI: true
4748

4849
# Step to wait for the job to complete
4950
- name: Wait for job completion

‎playwright.config.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { testConfig } from './testConfig';
33
import { OrtoniReportConfig } from 'ortoni-report';
44

55
const ENV = process.env.ENV || process.env.npm_config_ENV; // Support both modern and legacy patterns
6+
const isCI = !!process.env.CI; // Detect if running in CI environment
67

78
if (!ENV || ![`qa`, `dev`, `qaApi`, `devApi`].includes(ENV)) {
89
console.log(`Please provide a correct environment value after command like "--ENV=qa|dev|qaApi|devApi"`);
@@ -31,7 +32,9 @@ const config: PlaywrightTestConfig = {
3132
retries: 0,
3233

3334
//Reporters
34-
reporter: [[`./CustomReporterConfig.ts`], [`allure-playwright`], [`html`, { outputFolder: 'html-report', open: 'never' }],['ortoni-report', reportConfig]],
35+
reporter: isCI
36+
? [[`./CustomReporterConfig.ts`], [`allure-playwright`], [`html`, { outputFolder: 'html-report', open: 'never' }]]
37+
: [[`./CustomReporterConfig.ts`], [`allure-playwright`], [`html`, { outputFolder: 'html-report', open: 'never' }],['ortoni-report', reportConfig]],
3538

3639
projects: [
3740
{
@@ -47,7 +50,7 @@ const config: PlaywrightTestConfig = {
4750
baseURL: testConfig[ENV],
4851

4952
//Browser Mode
50-
headless: false,
53+
headless: isCI ? true : false,
5154

5255
//Browser height and width
5356
viewport: { width: 1500, height: 730 },

0 commit comments

Comments
 (0)