@@ -9,13 +9,11 @@ import { defineConfig, devices } from '@playwright/test';
99import dotenv from 'dotenv' ;
1010dotenv . config ( { path : '.env' } ) ;
1111import os from 'os' ;
12- // import path from 'path';
1312
1413const BASE_URL = process . env . URL || 'https://www.saucedemo.com/' ;
1514const startLocalHost = process . env . URL && process . env . URL . includes ( 'localhost' ) ;
1615export const LOCAL_HOST_URL = 'https://localhost:9002' ; // Update the URL to match your local dev server URL
17- // export const STORAGE_STATE_LOGIN = path.join(__dirname, 'playwright/.auth/user-login.json');
18- // export const EMPTY_STORAGE_STATE = path.join(__dirname, './tests/testdata/empty-storage-state.json');
16+ const customLoggerPath = require . resolve ( 'src/vasu-playwright-lib/setup/custom-logger' ) ;
1917
2018export default defineConfig ( {
2119 /**
@@ -48,7 +46,7 @@ export default defineConfig({
4846 * The reporter to use. This can be set to use a different value on CI.
4947 * See https://playwright.dev/docs/test-reporters
5048 */
51- reporter : [ [ 'html' , { open : 'never' } ] , [ 'dot' ] ] ,
49+ reporter : [ [ customLoggerPath ] , [ 'html' , { open : 'never' } ] , [ 'dot' ] ] ,
5250 /**
5351 * Shared settings for all the projects below.
5452 * See https://playwright.dev/docs/api/class-testoptions
@@ -67,7 +65,7 @@ export default defineConfig({
6765 } ,
6866 ignoreHTTPSErrors : true ,
6967 acceptDownloads : true ,
70- testIdAttribute : 'qa-target ' ,
68+ testIdAttribute : 'data-testid ' ,
7169 /**
7270 * The base URL to be used in navigation actions such as `await page.goto('/')`.
7371 * This allows for shorter and more readable navigation commands in the tests.
@@ -88,30 +86,13 @@ export default defineConfig({
8886 * See https://playwright.dev/docs/test-configuration#projects
8987 */
9088 projects : [
91- // {
92- // name: 'setup',
93- // testMatch: '**/*.setup.ts',
94- // use: {
95- // ...devices['Desktop Chrome'],
96- // viewport: { width: 1600, height: 1000 },
97- // launchOptions: {
98- // args: ['--disable-web-security'],
99- // slowMo: 0,
100- // },
101- // },
102- // },
103-
10489 /** Due to different view ports in Head and Headless, created 2 projects one for head mode and the same browser for headless. */
10590 {
10691 name : 'chromium' ,
107- // dependencies: ['setup'],
10892 use : {
10993 viewport : null ,
110- // storageState: STORAGE_STATE_LOGIN,
11194 launchOptions : {
11295 args : [ '--disable-web-security' , '--start-maximized' ] ,
113- /* --auto-open-devtools-for-tabs option is used to open a test with Network tab for debugging. It can help in analyzing network requests and responses.*/
114- // args: ["--disable-web-security","--auto-open-devtools-for-tabs"],
11596 // channel: 'chrome',
11697 slowMo : 0 ,
11798 headless : false ,
@@ -121,11 +102,9 @@ export default defineConfig({
121102
122103 {
123104 name : 'chromiumheadless' ,
124- // dependencies: ['setup'],
125105 use : {
126106 ...devices [ 'Desktop Chrome' ] ,
127107 viewport : { width : 1920 , height : 1080 } ,
128- // storageState: STORAGE_STATE_LOGIN,
129108 launchOptions : {
130109 args : [ '--disable-web-security' ] ,
131110 // channel: 'chrome',
0 commit comments