End to end tests for Archive.org using Playwright
- login to BrowserStack and retrieve the account username and access key, see documentation here
-
install dependencies:
npm i
-
install Playwright browser libs:
npx playwright install
-
run all the tests in headless mode and generate 1 whole test report:
npm run test
-
run all the tests in headless mode by each category and generate test report by category:
./run-tests.sh
-
run all the tests in headed mode (this will load multiple browsers):
npm run test:headed
-
create a
.env
file by copying the contents from.env.sample
and add the respective values you want to use for testing
- run about tests:
npm run test:about
- run av tests:
npm run test:av
- run books tests:
npm run test:books
- run collection tests:
npm run test:collection
- run details tests:
npm run test:details
- run home tests:
npm run test:home
- run login tests:
npm run test:login
- run music tests:
npm run test:music
- run search tests:
npm run test:search
- run profile tests:
npm run test:profile
- run about tests:
npm run test:about:headed
- run av tests:
npm run test:av:headed
- run books tests:
npm run test:books:headed
- run collection tests:
npm run test:collection:headed
- run details tests:
npm run test:details:headed
- run home tests:
npm run test:home:headed
- run login tests:
npm run test:login:headed
- run music tests:
npm run test:music:headed
- run search tests:
npm run test:search:headed
- run profile tests:
npm run test:profile:headed
- install VSCode Playwright plugin to run specific tests using VSCode
- run command format:
npx playwright test <test-file-path>
- sample:
npx playwright test tests/search/search-layout.spec.ts
- headed:
npx playwright test tests/search/search-layout.spec.ts --headed
- run command format:
npx playwright test <test-file-path> --debug
- sample:
npx playwright test tests/search/search-layout.spec.ts --debug
- run:
npm run show:report