Apply for landing: end-to-end tests
November 30, 2023 ยท View on GitHub
This is a suite of end-to-end tests for the dxw Apply for landing example apps, using Playwright.
Our first implementation of the example app is the Ruby implementation, and this implementation will serve as the model for others (Node, .NET, Kotlin/SpringBoot etc).
Getting started
We strongly recommend using the VS Code Playwright plugin and use the plugin's commands.
Prerequisites
- Node.JS
- NPM
Setup
Install the dependencies with:
npm install
npm run install-playwright
Environment variables
Add a .env file to the root of the project with the following variables:
RUBY_IMPLEMENTATION_DEPLOYED_URL= # the url at which the Ruby deployed implementation is to be found
RUBY_IMPLEMENTATION_LOCAL_URL= # the url at which the local Ruby is to be found
Running the tests
Against the deployed environment
To run the tests locally against the deployed application environment, run the following command:
npm run test
or to run using the Playwright user interface:
npm run test:ui
Against your local enviroment
Alternatively you can run the tests against your local environment with the following command:
npm run test:local
or to run using the Playwright user interface:
npm run test:local:ui
Debugging
Playwright has handy debugging to allow you step through your tests and use a "Pick locator" tool.
Run with a command like:
npx playwright test apply.spec.ts --project=local --debug