End-to-end testing of Adyen sample applications using Playwright.
It can be executed in 2 ways:
- Install and run Playwright tests on Node
- Run the
ghcr.io/adyen-examples/adyen-testing-suite
Docker image
Note: The E2E Testing Suite supports Checkout testing with both Adyen Drop-in v5 and v6.
- Node 20+
- Start sample application on
localhost:8080
- Make sure the sample application uses English language
Add Playwright dependency and install the browsers.
npm i -D @playwright/test
# install supported browsers
npx playwright install
More info on Playwright Installation page.
The webhook tests require the HMAC Key used by the application to sign the webhook payloads
Create .env
file
# set the same key used by the application being tested
ADYEN_HMAC_KEY = enter your HMAC key here
Execute all tests headless (default)
npx playwright test
Execute single test (i.e. matching filename)
npx playwright test webhook
Execute tests in folder (i.e. matching foldername)
npx playwright test ./checkout
Execute tests with open browser
npx playwright test --headed
Run the adyen-testing-suite in a Docker container which connects to the localhost application.
Note: the localhost application will resolve to http://docker:8080
from inside the Docker container.
- Docker
- Start sample application on
localhost:8080
- Make sure the sample application uses English language
- Add
http://docker:8080
to Allow origins
# Run on Mac (i.e. --platform linux/arm64/v8)
# NOTE!! Set <host IP address> before executing docker run
docker run -t -i --rm --name adyen-testing-suite -e URL=http://docker:8080 -e PLAYWRIGHT_FOLDERNAME=checkout --add-host=docker:<host IP address> --platform linux/arm64/v8 ghcr.io/adyen-examples/adyen-testing-suite:main
Run the testing-suite in Gitpod by pointing the baseUrl
of our test configuration to the public URL of the application.
There are two ways to run the tests:
- Run the following command with the URL set to the public URL of the application.
URL=https://8080-adyenexampl-adyendotnet-1xxxxxxxxxx.ws-eu88.gitpod.io npx playwright test ./checkout
- Modify the
playwright.config.js
file and replacehttp://localhost:8080
with the public URL of the application. After modifying the URL, (re)run the commandnpx playwright install
, followed bynpx playwright test ./checkout
.
# See 'http://localhost:8080' in playwright.config.js
baseURL: process.env.URL || 'http://localhost:8080'