Steps to run:
- Run the command
npm installandnpx playwright installto install playwright and the relevant project dependancies - In the settings folder create and populate the following files:
.env.secret: follow template in .env.secret_example and populate with values from Stache entry.env.portal: copy contents of the .env file relevant to the portal and environment being tested from the Core Portal Deployments repo (env file for prod cep)custom_portal_settings.py: copy contents of the settings_custom file relevant to the portal and environment being tested from the Core Portal Deployments repo (settings_custom file for prod cep)
- Run the following command from root of the project:
python3 utils/pythonHelper.pyand ensure a file namedcustom_portal_settings.jsongets created in the settings folder with some portal data - The test suite can be run using one of the following commands:
- Full test suite (runs all the tests available):
npx playwright test --project=default --project=unauthorized
- Limited test suite (skips application and datafile tests):
npx playwright test --project=limited --project=unauthorized
- Full test suite (runs all the tests available):
To run other portals:
- Repeat Steps 2-3 from above for the portal you want to test, replacing or renaming the previous files.
- Update fixtures/baseFixture.js with the portal information, replacing or renaming the previous file.
Useful cli flags:
--debugto run debug mode (headed + step-through controls + selector creation)--headedto run headed--uito run the separate playwright ui that you can run tests in and get a trace log