This repo has been created to support the demo for STAG Meetup Talk held on August 2021.
Prerequisities
Nodejs stable version should be installed in your machine
Setup
- Clone repo to your local
- Run command - npm ci
Running Specific tests
- Cross Browser(Chromium, Webkit, Firefox) - npx playwright test TC001_crossbrowsers.spec.js
Device Emulation - npx playwright test --config=mobile.config.js TC001_crossbrowsers.spec.js
-
waits - npx playwright test TC002_waits.spec.js --project=DesktopChromium
-
PageEval - npx playwright test TC003_pageeval.spec.js --project=DesktopChromium
-
Geolocation - npx playwright test TC004_geo.spec.js --config=geo.config.js --timeout 800000 Works on iPhone11 Webkit.
-
Visual Testing - npx playwright test TC005_visualtesting.spec.js --project=DesktopChromium
-
Playwright Traceviewer- Trace config available in playwright.config.js
npx playwright test TC006_traceviewer.spec.js --project=DesktopChromium --timeout=15000
Windows -npx playwright show-trace test-results\tests-TC006_traceviewer-Trace-viewer-test-DesktopChromium\trace.zip
Mac - npx playwright show-trace test-results/tests-TC006_traceviewer-Trace-viewer-test-DesktopChromium/trace.zip
- Playwright Inspector
npx playwright test TC007_pwinspector.spec.js --project=DesktopChromium --timeout 800000 --debug
npx playwright test TC007_pwinspector.spec.js --project=DesktopChromium --timeout 800000 - Use this option if we use page.pause() in the code.
- API tests npx playwright test TC008_api.spec.js --project=DesktopChromium
Note: Make some changes and push to github,it should trigger github actions ci pipeline.
Pages used
- https://playwright.dev/ - Official site
- https://try.playwright.tech/ - Try out Playwright
- https://help.afterpay.com/hc/en-au - Demo Page
- https://github.com/jithinjosejacob/playwright_stag/actions/ - CI
- https://github.com/microsoft/playwright/blob/7ccdc5176ded3e76566b6f7981b6136cfcadd7b0/src/server/deviceDescriptors.ts - Device List
- https://playwright.dev/docs/actionability/ - Auto waiting
- https://www.npmjs.com/package/pixelmatch - Pixelmatch(Visual Comparison)
- https://playwright.dev/docs/emulation/ - Device Emulation
- https://try.playwright.tech/?e=intercept-requests - log network requests