Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dc6d400
test: centralise locators and refactor tests
KrupaPammi Apr 29, 2026
e9062b1
test: add test that's been removed
KrupaPammi Apr 29, 2026
6a524f7
test: write first test in cucumber
KrupaPammi Apr 30, 2026
5bb625d
test: convert submit dir tests into Gherkin and add step definitions
KrupaPammi May 1, 2026
4004a8a
test: convert /update tests into Gherkin and add step-definitions
KrupaPammi May 5, 2026
d2b564d
test: Add comments in cucumber config
KrupaPammi May 5, 2026
6c97779
test: disable local playwright reports and test-results that generate…
KrupaPammi May 7, 2026
fd17063
test: move shard redirect step into comon step-definitions
KrupaPammi May 8, 2026
f195111
test: setup and convert playwright-local tests into cucumber
KrupaPammi May 12, 2026
ae0d8a7
ci: Add retry and parallel options in the config
KrupaPammi May 12, 2026
69e5750
ci: update playwright run with cucumber script
KrupaPammi May 12, 2026
65a24df
test: Add mobile safari config and parallel scripts
KrupaPammi May 12, 2026
9c22095
test: fix marketing prefs step by adding scrollingintoview
KrupaPammi May 12, 2026
3edd445
test: few tweaks
KrupaPammi May 12, 2026
dd18155
test: fix failing staging tests locally
KrupaPammi May 13, 2026
a7e3b1b
test: resolve ambiguous steps
KrupaPammi May 14, 2026
f0a2b5c
test: fix campaign code from RND26 to SR26
KrupaPammi May 14, 2026
4769a96
test: remove nightly-sanity tag
KrupaPammi May 14, 2026
bbb00de
use consistent kebab casing
KrupaPammi May 14, 2026
06a398a
config: add playwright equivalent timeouts in cucumber config
KrupaPammi May 14, 2026
051336b
move browserstack capabilities into cucumber config
KrupaPammi May 14, 2026
b3125f6
keep the test script as before
KrupaPammi May 14, 2026
1968a49
test: add default navigation timeout
KrupaPammi May 19, 2026
7637a84
downgrade cucumber version to 8.9.1 to support node 16
KrupaPammi May 19, 2026
01353cc
test: move resuable steps into giftaid common
KrupaPammi May 19, 2026
db2969f
test: delete giftaid submission steps file as it's moved to common
KrupaPammi May 19, 2026
b545fc7
test: update transsource value to SR26_GiftAid
KrupaPammi May 19, 2026
65b48d4
test: fix missing update validation step definition; populateUpdateFo…
KrupaPammi May 19, 2026
9dafdd1
add comments in playwright-local config
KrupaPammi May 19, 2026
78bc781
test: move selectors to locators file
KrupaPammi May 20, 2026
fbf2563
test: remove playwright.config files
KrupaPammi May 20, 2026
a173f53
remove local playwright.config file; fix casing
KrupaPammi May 20, 2026
4c6c051
Merge remote-tracking branch 'origin/master' into test/eng-5100-playw…
KrupaPammi May 20, 2026
6e86b81
remove playwright scripts
KrupaPammi May 20, 2026
24c2b21
remove FORCE_COLOR from the local cucumber scripts
KrupaPammi May 20, 2026
f5be6b8
use only 2 parallel workers in playwright-local tests
KrupaPammi May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
- name: Install playwright browsers
run: yarn playwright install chromium

- name: Run Playwright Chrome Tests
run: yarn test:playwright-local:ci:chromium
- name: Run Cucumber Giftaid Sanity Tests
run: yarn test:cucumber:ci:chromium:sanity
continue-on-error: false
env:
NODE_ENV: development
Expand Down Expand Up @@ -85,8 +85,8 @@ jobs:
- name: Install playwright browsers (WebKit)
run: yarn playwright install webkit

- name: Run Mobile WebKit Tests
run: yarn test:playwright-local:ci:mobile
- name: Run Mobile Cucumber Tests
run: yarn test:cucumber:ci:mobile:sanity
continue-on-error: false
env:
NODE_ENV: development
Expand Down
24 changes: 15 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,20 @@
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"lint": "eslint --color src",
"test:playwright-local:local": "playwright test --config=./playwright-local/playwright-local.config.js",
"test:playwright-local:local:chromium": "playwright test --config=./playwright-local/playwright-local.config.js --project=chromium",
"test:playwright-local:local:chromium--h": "playwright test --config=./playwright-local/playwright-local.config.js --project=chromium --headed",
"test:playwright-local:local:mobile": "playwright test --config=./playwright-local/playwright-local.config.js --project=mobile-safari",
"test:playwright-local:local:mobile--h": "playwright test --config=./playwright-local/playwright-local.config.js --project=mobile-safari --headed",
"test:playwright-local:ci": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:playwright-local",
"test:playwright-local:ci:chromium": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:playwright-local:local:chromium",
"test:playwright-local:ci:mobile": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:playwright-local:local:mobile",
"test:playwright-local:local:chrome:mobile": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:playwright-local:local",
"test:cucumber:local": "cd playwright-local && BASE_URL=http://localhost:3000 cucumber-js --config config/cucumber.js",
"test:cucumber:local:sanity": "cd playwright-local && BASE_URL=http://localhost:3000 cucumber-js --config config/cucumber.js --tags '@sanity'",
"test:cucumber:local:chromium": "cd playwright-local && BROWSER=chromium BASE_URL=http://localhost:3000 cucumber-js --config config/cucumber.js",
"test:cucumber:local:chromium:sanity": "cd playwright-local && BROWSER=chromium BASE_URL=http://localhost:3000 cucumber-js --config config/cucumber.js --tags '@sanity'",
"test:cucumber:local:chromium:headed": "cd playwright-local && BROWSER=chromium HEADED=true BASE_URL=http://localhost:3000 cucumber-js --config config/cucumber.js --tags '@sanity'",
"test:cucumber:local:mobile": "cd playwright-local && BROWSER=mobile-safari BASE_URL=http://localhost:3000 cucumber-js --config config/cucumber.js",
"test:cucumber:local:mobile:sanity": "cd playwright-local && BROWSER=mobile-safari BASE_URL=http://localhost:3000 cucumber-js --config config/cucumber.js --tags '@sanity'",
"test:cucumber:local:mobile:headed": "cd playwright-local && BROWSER=mobile-safari HEADED=true BASE_URL=http://localhost:3000 cucumber-js --config config/cucumber.js --tags '@sanity'",
"test:cucumber:ci": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:cucumber:local",
"test:cucumber:ci:sanity": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:cucumber:local:sanity",
"test:cucumber:ci:chromium": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:cucumber:local:chromium",
"test:cucumber:ci:chromium:sanity": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:cucumber:local:chromium:sanity",
"test:cucumber:ci:mobile": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:cucumber:local:mobile",
"test:cucumber:ci:mobile:sanity": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:cucumber:local:mobile:sanity",
"snyk-protect": "snyk-protect",
"prepublish": "yarn snyk-protect"
},
Expand All @@ -59,6 +64,7 @@
"@babel/runtime": "^7.11.2",
"@comicrelief/data-models": "^1.15.4",
"@comicrelief/test-utils": "^1.5.13",
"@cucumber/cucumber": "8.9.1",
"@playwright/test": "1.38.1",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
Expand Down
15 changes: 15 additions & 0 deletions playwright-local/config/cucumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
default: {
paths: ['tests/features/**/*.feature'],
require: [
'tests/support/**/*.js',
'tests/step-definitions/**/*.js',
],
// Use 'pretty' locally for readable step-by-step output.
// On CI keep the output minimal to avoid noisy logs.
format: ['progress', 'summary'],
retry: 2, // Retry failed scenarios twice
parallel: 2, // Run scenarios in parallel workers
publishQuiet: true,
},
};
60 changes: 0 additions & 60 deletions playwright-local/playwright-local.config.js

This file was deleted.

43 changes: 43 additions & 0 deletions playwright-local/tests/features/submit/addressValidation.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@sanity @address-validation
Feature: Address validation

Background:
Given I am on the local Giftaid page
And I select the local Giftaid option
And I enter the local supporter details

Scenario: Empty postcode should show an error message
When I clear the local postcode field
And I submit the local Giftaid form
Then I should see the local postcode error message "Please enter your postcode"

Scenario Outline: Invalid postcodes should show error messages
When I enter the local postcode "<postcode>"
Then I should see the local postcode error message "<message>"

Examples:
| postcode | message |
| 12SE17TP | Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below. |
| comic relief | Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below. |
| cro 7tp | Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below. |

Scenario: Entering a postcode without selecting an address should show an error message
When I enter the local postcode "SE1 7TP"
And I search for the local postcode
Then I should see the local address dropdown
When I submit the local Giftaid form
Then I should see the local address select error message "Please select your address"

Scenario: Clicking the manual address link should show the address fields
When I enter the local postcode "SE1 7TP"
Then I should see the local manual address link
When I click the local manual address link
Then I should see the local manual address fields

Scenario: Invalid address fields should show error messages
When I enter the local postcode "SE1 7TP"
And I click the local manual address link
And I enter the local invalid address line 1
Then I should see the local address line 1 error message
When I enter the local invalid town
Then I should see the local town error message
55 changes: 55 additions & 0 deletions playwright-local/tests/features/submit/formValidation.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@sanity @form-validation
Feature: Form validation

Background:
Given I am on the local Giftaid page
And I select the local Giftaid option

Scenario Outline: Invalid mobile numbers should show an error message
When I enter the local mobile number "<mobile>"
Then I should see the local mobile error message "Please enter a valid mobile phone number - it must be the same number associated with your donation."

Examples:
| mobile |
| 0712345678 |
| 0712345678900 |
| 0712 345 6789 |
| 0780ab5694245 |

Scenario: Valid mobile number should submit the form
When I complete the local Giftaid form with valid details
And I submit the local Giftaid form
Then I should see the local thank you message "Thank you, test!"

Scenario Outline: Invalid first names should show an error message
When I enter the local first name "<firstName>"
Then I should see the local first name error message "This field only accepts 25 alphabetic characters and ' - starting with alphabetic characters"

Examples:
| firstName |
| Test^$%£ |
| SPACE |
| 123Test |

Scenario: Valid first name should submit the form
When I complete the local Giftaid form with the first name "testFirstname"
And I submit the local Giftaid form
Then I should see the local thank you message "Thank you, testFirstname!"

Scenario Outline: Invalid last names should show an error message
When I enter the local last name "<lastName>"
Then I should see the local last name error message "This field only accepts 25 alphanumeric characters and , . ( ) / & ' - starting with alphanumeric characters"

Examples:
| lastName |
| Test^$%£ |
| SPACE |

Scenario: Alphanumeric last name should not show an error message
When I enter the local last name "123Test"
Then I should not see the local last name error message

Scenario: Valid last name should submit the form
When I complete the local Giftaid form with valid details
And I submit the local Giftaid form
Then I should see the local thank you message containing "Thank you,"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@sanity @international-address-validation
Feature: International address validation

Background:
Given I am on the local Giftaid page
And I select the local Giftaid option
And I enter the local supporter details

Scenario: Selecting a non-UK country and entering a non-UK postcode should submit the form
When I enter the local postcode "30916-395"
Then I should see the local postcode error message "Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below."
When I click the local manual address link
And I enter the local international address details
And I select a random local non-UK country
Then I should not see the local postcode error message
When I select the local marketing preferences
And I submit the local Giftaid form
Then I should see the local thank you message containing "Thank you,"
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@sanity @marketing-preferences-validation
Feature: Marketing preferences validation

Background:
Given I am on the local Giftaid page
And I select the local Giftaid option
And I complete the local Giftaid form with valid details

Scenario: Clicking marketing preference options should submit the Giftaid form
When I select all the local marketing preference options
And I enter the local marketing email
And I enter the local marketing phone
And I submit the local Giftaid form
Then I should see the local thank you message "Thank you, test!"

Scenario: The email marketing preference field should show validation errors
When I select the local email marketing preference
And I enter the local marketing email
And I clear the local marketing email
Then I should see the local marketing email error message "Please fill in your email address"
When I enter an invalid local marketing email "example@£$^&email.com"
Then I should see the local marketing email error message "Please fill in a valid email address"
When I enter the local marketing email
And I submit the local Giftaid form
Then I should see the local thank you message "Thank you, test!"

Scenario: The phone marketing preference field should show validation errors
When I select the local phone marketing preference
And I enter the local marketing phone
And I clear the local marketing phone
Then I should see the local marketing phone error message "Please fill in your phone number"
When I enter an invalid local marketing phone "0208569424"
Then I should see the local marketing phone error message "Please fill in a valid UK phone number, with no spaces"
When I enter the local marketing phone
And I submit the local Giftaid form
Then I should see the local thank you message containing "Thank you,"
23 changes: 23 additions & 0 deletions playwright-local/tests/features/submit/postcodeLookup.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@sanity @postcode-lookup
Feature: Postcode lookup validation

Background:
Given I am on the local Giftaid page
And I select the local Giftaid option
And I enter the local supporter details

Scenario Outline: Postcode formatting errors should show validation message
When I enter the local postcode "<postcode>"
Then I should see the local postcode error message "<message>"

Examples:
| postcode | message |
| S E 1 7 T P | Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below. |
| SE$%TP | Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below. |

Scenario: Enter valid UK postcode using postcode lookup should submit the form
When I enter the local postcode "SE1 7TP"
And I search for the local postcode
And I select the local lookup address or enter the address manually
And I submit the local Giftaid form
Then I should see the local thank you message containing "Thank you,"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@sanity @valid-giftaid-submission
Feature: Valid Giftaid Submission

Background:
Given I am on the local Giftaid page
And I select the local Giftaid option

Scenario: Valid Giftaid Submission
When I complete the local Giftaid form with valid details
And I select the local marketing preferences
And I submit the local Giftaid form and wait for the navigation
Then I should see the local thank you message containing "Thank you,"
Loading
Loading