A proof of concept to showcase the implementation of Playwright as a test framework with multiple test reporters (Monocart and Allure) to test the checkout flow and Apache JMeter load test integration to measure performance for the "Test Automation - Big Cartel E-commerce Test store".
- Overview
- Project information
- Pre requisites
- Setup
- Run tests and generate the test run report to view test results
- Gotcha's
- TODO / Current Issues
This repository demonstrates:
- The Playwright Testing Framework to run tests locally.
- Test run reporting generated with:
- CI/CD Integration for GitHub workflow support executing tests in Docker with GitHub Actions triggered on push/pull requests to main and for daily scheduled runs:
- The passing workflow for "Playwright Tests with Allure Report" is currently a false positive (failing issues listed below), the workflow has been disabled in GitHub Actions until the issue can be resolved!
- Current Issues:
- Workflow runs without error in the workspace, generates the artefact, but it doesn't load the report data objects when the index.html is viewed in the downloaded artefact due to a
blocked by CORS policyissue. - Using the allure command line tool to open and serve the report from the downloaded artefact root is failing as well and will be investigated at a later stage.
- TODO: Will be updated at some stage to use GitHub Pages instead to resolve the issue.
- Workflow runs without error in the workspace, generates the artefact, but it doesn't load the report data objects when the index.html is viewed in the downloaded artefact due to a
⇡ Return to the Table of Contents
This project repo contains a functional journey test verifying multiple areas of the e-commerce checkout flow
- Search for an item in the store.
- View a product from the search results.
- Select colour and age options from the dropdowns.
- Increase item quantity.
- Proceed to the cart.
- Verify cart details, including:
- Correct items.
- Selected options.
- Quantities.
- Item prices and cart totals.
⇡ Return to the Table of Contents
⇡ Return to the Table of Contents
- Clone or Download
- Clone this repository:
git clone https://github.com/badj/playwright-poc.git - Alternatively, download the ZIP file and extract it.
- Clone this repository:
- Navigate to Project Directory:
cd playwright-poc - Initialise a Node.js project
npm init -y
- Install Playwright
npm i -D @playwright/test
- Install browsers
npx playwright install
⇡ Return to the Table of Contents
- Execute the test
npx playwright test - OR Execute the test with the UI
npx playwright test --ui - View the HTML report when test execution completes - Command will print to the terminal
npx playwright show-report
-
A hyperlink to the web server will be printed to the terminal that links through to the generated report - sample output:
Serving HTML report at http://localhost:9323. Press Ctrl+C to quit.
⇡ Return to the Table of Contents
- Execute the test
npx playwright test - Generate and view the HTML report when test execution completes - The Report opens automatically and is generated in monocart-report/index.html
npx monocart show-report monocart-report/index.html
-
A hyperlink to the web server will be printed to the terminal that links through to the generated report - sample output:
serve dirs [ 'monocart-report', './' ] 7/8/2025, 10:26:33 PM server listening on http://localhost:8090/index.html
⇡ Return to the Table of Contents
- Execute the test
npx playwright test - Generate and view the HTML report when test execution completes - Report will be generated in allure-report/index.html
allure generate allure-results -o allure-report --clean
- OR Generate the report and open it automatically on the web server - Report will be generated in allure-report/index.html
allure generate allure-results -o allure-report --clean && allure open allure-report && echo "file://$(pwd)/allure-report/index.html"
-
A hyperlink to the web server will be printed to the terminal that links through to the generated report - sample output:
Server started at <http://127.0.0.1:56217>. Press <Ctrl+C> to exit
⇡ Return to the Table of Contents
- A JMeter load tests integration workflow has been integrated to measure site performance
- The Jmeter load tests are located in the performance-tests directory in performance-tests/load-test.jmx:
⚠️ Thread Group configurations were set to low values to reduce the impact of the load test on the e-commerce store where Cloudflare could potentially throttle the requests!
- Thread Group configurations for the tests:
- Thread Group number of threads: 3
- Thread Group ramp time: 10 seconds
- Thread Group same user on next iteration: true
- Thread Group on sample error: continue
- Loop Controller loops: 1
- Loop Controller continue forever: false
⚠️ Keep thread group configurations set to the original low values to reduce the impact of the load test on the e-commerce store to prevent Cloudflare new request throttling!
- The workflow:
- Runs daily at 10:30 am NZT (UTC+12).
- "on push and pull_request" to branches "main" disabled (
⚠️ Caused Cloudflare security check issues that made the Playwright tests fail - keep disabled!) - Installs JMeter.
- Executes the JMeter load tests against the "Test Automation - Big Cartel E-commerce Test store" Landing page, Products page and Cart page.
- Jmeter tests Generate a dashboard (HTML report) and .jtl results.
- Uploads artifacts for review (view in GitHub Actions UI).
- Prints a summary for quick analysis (e.g., avg response time, error rate).
⚠️ Run the JMeter tests locally:- Download and install Java 8+ installed (JMeter requires it) from Oracle Downloads
- Download and install Apache JMeter (latest version) from JMeter Apache
- Unzip it and run bin/jmeter.bat (Windows) or bin/jmeter (macOS/Linux).
- Open the JMeter GUI and load the test plan from performance-tests/load-test.jmx.
⚠️ Keep thread group configurations set to the original low values to reduce the impact of the load test on the e-commerce store to prevent Cloudflare new request throttling!
⇡ Return to the Table of Contents
Installing Playwright using
npm i -D @playwright/testfailing due to an unsupported Node.js version. Your current Node.js version is older than the recommended LTS version. Playwright requires a more recent version of Node.js. As of Playwright v1.54.1, the minimum supported Node.js version is typically Node.js 16 or higher.
To resolve the issue:
- Update Node.js using nvm (Node Version Manager) - Install Node.js 18 (LTS) or a newer version like 20
nvm install 18- Switch to the new version
nvm use 18- Set it as the default version
nvm alias default 18- Verify the Node.js version - Ensure it’s at least v16 or higher.
node -v- Verify npm version:
npm -vAdditional steps if the steps above do not resolve it:
- Clear npm Cache and Reinstall Dependencies → The error may be caused by a corrupted npm cache or incomplete dependency installation
This ensures a clean slate for dependency installation, avoiding issues from cached or corrupted files.
npm cache clean --force- Remove the node_modules directory and package-lock.json → Navigate to the project directory
Change to the playwright-poc project directory (example for macOS)*:
cd [path to your repo]/playwright-poc- Remove the node_modules directory and package-lock.json file:
rm -rf node_modules package-lock.json- Reinstall dependencies:
npm install⇡ Return to the Table of Contents
- 🚧 "Add to cart" AJAX/XHR blocked by Cloudflare - FIREFOX
- 🚧 Playwright tests for checkout and cart pages loading/triggering Cloudflare security checks - FIREFOX
⇡ Return to the Table of Contents