React Frontend for giftaid submissions.
This front end application is somewhat legacy. With this in mind you will need to be careful about what version of node you are running, as an older one will probably be needed to run this application. An easy solution is to use Node Version Manager to revert your node install to an older version.
To install NVM on Mac:
brew install nvmThen you can use the local .nmvrc config file to install and use the specified version:
nvm useYou will also need to be a member of the Comic Relief organisation on NPM in order to install this project, as it has the
private NPM package @comicrelief/data-models as a dev dependency:
npm loginyarn installCurrently you can just use the sample .env.dist
cp .env.dist .envFor local development please run:
yarn startPull requests are tested with circle ci, this will run code style and unit tests against the PR. Deployments are enacted using concourse, the pipeline can be seen here.
The domains for giftaid are as follows
Local end-to-end tests use:
- Cucumber
- Playwright
- Chromium and Mobile Safari
- A locally running React app on
http://localhost:3000
Before running the tests locally, start the React app:
yarn startThis starts the application on: http://localhost:3000
Run all local tests:
yarn test:localRun Chromium tests:
yarn test:local:chromiumRun Mobile Safari tests:
yarn test:local:mobileRun Chromium in headed mode:
yarn test:local:chromium:headedRun Mobile Safari in headed mode:
yarn test:local:mobile:headedExample:
yarn test:local --tags "@valid-giftaid-submission"Run address validation tests:
yarn test:local --tags "@address-validation"playwright-local/
├── tests/features
├── tests/step-definitions
├── tests/support
└── tests/utils
- Feature files contain readable Gherkin scenarios using the
.featureextension - Step definitions contain the Playwright automation implementation
- Hooks create a fresh browser context and page for every scenario
- Shared selectors are stored in
utils/locators.js - Shared reusable helper methods are stored in
utils/commands.js
Staging tests run against BrowserStack and require the following environment variables:
export BASE_URL='https://giftaid-staging.comicrelief.com/'
export BROWSERSTACK_USERNAME='<INSERT_USERNAME>'
export BROWSERSTACK_ACCESS_KEY='<INSERT_ACCESS_KEY>'BrowserStack credentials can be found in:
serverless-giftaid/concourse/private.yml
Run staging tests:
yarn test:sanity