Sample Project:
name: 'local',
use: {
...devices['Desktop Chrome'],
storageState: 'ui-tests/.auth/testUser.json',
baseURL: 'http://localhost:3031',
},
dependencies: ['setup'],
retries: 1,
testMatch: [
'**/tests/smokeTests/**.spec.js',
'**/tests/regression/**.spec.js',
'**/tests/partialUI/**.spec.js'
],
},
We generate users and data in the environment but if the array has the smokeTest we do not generate a user. I want to be able to use the global setup but define the generated user process based on the spec file in the testMatch Array.
Is this possible in Playwright?
We use a fixture that stores the generated users and pom files
if we try to run the generation as a setup script the files PDE-TESTs runs at the same time.
************ PDE-TESTS **************** <=This is causing the setup generate script to fail because its running at the same time as the users are being generated.
************* Generate Users Setup **********
************ AUTHENTICATION SETUP ************
************ PDE-TESTS ****************