Skip to content

Commit 8f9ef77

Browse files
committed
Run a complete donation journey test in legacy / ES5 bundle version of Donate too
1 parent 35719f9 commit 8f9ef77

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Just run in one actual browser, modern Chrome. We want to test that the bundle works in general, but it's
2+
# too cumbersome to run modern automation tools on actual old browsers.
3+
@skip(browserName=["microsoftedge","safari"])
4+
Feature: New donor with legacy-brower-friendly app: donate & register
5+
6+
As a new donor on an older browser
7+
I want payment to be taken for a match campaign for a Stripe charity
8+
So that I can support my chosen charity with a doubled donation
9+
10+
Scenario: New donor with legacy-brower-friendly app: donation completes successfully and donor registers
11+
Given that I am on my chosen charity's Donate page, using the legacy browser app
12+
When I enter an amount of £25000
13+
And I say no to Gift Aid
14+
And I enter my name, email address and UK Visa card number
15+
And I choose a preference for charity and TBG communications
16+
And I press Donate
17+
When I wait a few seconds
18+
Then I should be redirected to a Thank You confirmation page with amount £25000
19+
When I wait long enough for email processing
20+
Then my last email should contain amount £25000
21+
And my last email should contain the charity's custom thank you message
22+
And my last email should contain the correct name
23+
24+
When I register using the link in my donation thanks message
25+
Then I should receive a registration success email with the email I donated with

pages/DonateStartPage.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ export default class DonateStartPage {
103103
await goToUrl(startPageStripe);
104104
}
105105

106+
async openWithLegacyApp() {
107+
await goToUrl(`${startPageStripe}?legacy=1&no-compat-check=1`);
108+
}
109+
106110
async openRegister() {
107111
await goToUrl('/register');
108112
await checkTitle('Register');

steps/donation.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ Given(
8787
}
8888
);
8989

90+
Given(
91+
/^that I am on my chosen charity's Donate page, using the legacy browser app$/,
92+
async () => {
93+
page.nextStepIndex = 0;
94+
await page.openWithLegacyApp();
95+
await page.checkReady();
96+
}
97+
);
98+
9099
When(/^I open the Regular Giving application campaign start donating page$/, async () => {
91100
await page.openRegularGiving();
92101
});

0 commit comments

Comments
 (0)