Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Epic] New Donation Flow - New version of the Donation Flow #1324

Open
wants to merge 76 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
dd4be6f
New Donation Flow - Choosing a payment method step (Card with Stripe…
dimitur2204 Jan 22, 2023
489e605
New Donation Flow - Authentication form (#1294)
dimitur2204 Jan 30, 2023
9005eff
New Donation Flow - Form Data Flow and Stripe Card submission (#1311)
dimitur2204 Feb 1, 2023
268a561
New Donation Flow - Alerts and Summary Column (#1314)
dimitur2204 Feb 2, 2023
a1c8547
Merge remote-tracking branch 'origin/master' into 1272-epic-new-versi…
dimitur2204 Feb 5, 2023
49c94a5
New Donation Flow - #1297 #1291 Bank Transfer flow and Success page (…
dimitur2204 Feb 6, 2023
b16753c
New Donation Flow - 1297 Error handling and Fail page (#1330)
dimitur2204 Feb 9, 2023
1ea141e
New Donation Flow - Translations (#1334)
dimitur2204 Feb 10, 2023
2dbf3cd
New Donation Flow - e2e tests, Finalization and QA (#1336)
dimitur2204 Feb 20, 2023
f91d42f
Merge branch '1272-epic-new-version-of-the-donation-flow' of https://…
dimitur2204 Feb 20, 2023
6da5861
Merge remote-tracking branch 'origin/1272-epic-new-version-of-the-don…
dimitur2204 Feb 20, 2023
8c7f017
1336 - remove old donation page from the smoke tests
dimitur2204 Feb 20, 2023
ac2f452
Merge remote-tracking branch 'origin/master' into 1272-epic-new-versi…
dimitur2204 Feb 22, 2023
f69fa64
1272 - update import of the `stripeFeeCalculators` in the function tests
dimitur2204 Feb 22, 2023
f80913b
1272 - add STRIPE_PUBLIC_KEY to the playwright workflow file
dimitur2204 Feb 22, 2023
7351d06
Merge remote-tracking branch 'origin/master' into 1272-epic-new-versi…
dimitur2204 Feb 22, 2023
19902c4
1272 - add animatino gif
dimitur2204 Feb 25, 2023
2ae6bad
use STRIPE_DEV_PUBLISHABLE_KEY for playwright action
imilchev Feb 25, 2023
b72adb9
1272 - update stripe key env variable in playwright.yml
dimitur2204 Feb 26, 2023
a190c53
1272 - update stripe env variable name inside stripeClient
dimitur2204 Feb 26, 2023
db4447f
Merge branch '1272-epic-new-version-of-the-donation-flow' of https://…
dimitur2204 Feb 26, 2023
49e7ccf
Merge remote-tracking branch 'origin/master' into 1272-epic-new-versi…
dimitur2204 Feb 26, 2023
997a94d
1272 - update e2e files imports
dimitur2204 Feb 26, 2023
2923636
1272 - next.config and .env.local.example with new stripe env key name
dimitur2204 Feb 26, 2023
badd305
1272 - add inhertied env to the check-pr.yml config
dimitur2204 Feb 27, 2023
11e8484
1272 - change env to environment in check-pr.yml
dimitur2204 Feb 27, 2023
d846848
1272 - add specific env variable
dimitur2204 Feb 27, 2023
49b41d0
1272 - add environment as development
dimitur2204 Feb 27, 2023
cd690ab
1272 - add env in the playwright.yml file
dimitur2204 Feb 27, 2023
6c3d2ed
1272 - remove comment from playwright.yml
dimitur2204 Feb 27, 2023
312e0ce
1272 - change out env for vars
dimitur2204 Feb 27, 2023
e1104aa
Merge branch 'master' into 1272-epic-new-version-of-the-donation-flow
dimitur2204 Mar 16, 2023
ada9151
Merge remote-tracking branch 'origin/master' into 1272-epic-new-versi…
dimitur2204 Mar 21, 2023
05ad7b2
1393 - Refactor and change out the donation flow to use Stripe.SetupI…
dimitur2204 Mar 24, 2023
a9efe2b
Merge branch '1272-epic-new-version-of-the-donation-flow' of https://…
dimitur2204 Mar 24, 2023
78f2786
1272 - add error handling for bad auth cards on the status page
dimitur2204 Mar 24, 2023
1ef04d4
Merge branch 'master' of https://github.com/podkrepi-bg/frontend into…
sashko9807 Apr 11, 2024
153bac0
fix: Resolve build errors after merging with master branch
sashko9807 Apr 11, 2024
a612deb
feat: Add recurring payment
sashko9807 Apr 12, 2024
2af3c0a
feat(stripe): Add field to collect card holder name
sashko9807 Apr 12, 2024
b159180
fix: Use formik.cardRegion value when calculating fee in summary dialog
sashko9807 Apr 12, 2024
73a2e52
fix: Resolve conflict due to duplication of type
sashko9807 Apr 12, 2024
877ea28
fix(donation-flow): Resolve next hydratation error
sashko9807 Apr 12, 2024
058b2bf
refactor(donation-flow): Create subscription from setup intent
sashko9807 Apr 13, 2024
1097117
fix(donation-flow): Confirm card in case of 3DS
sashko9807 Apr 13, 2024
21ff8d6
refactor(donation-flow): Abstract stripe payment creation into fn
sashko9807 Apr 14, 2024
388809a
chore(donation-flow): Send idempotent key for stripe requests
sashko9807 Apr 14, 2024
fe2ca29
ui(donation-flow): Show stripe message errors instead of general one
sashko9807 Apr 14, 2024
16fd0cd
ui: Disable bank and unregistered selections for recurring payments
sashko9807 Apr 14, 2024
a6a532d
ui(i18n): Translate form errors
sashko9807 Apr 14, 2024
c2197a9
ui(donation-flow): Change error states according to UI requirements
sashko9807 Apr 15, 2024
3e1fa6b
fix(donation-flow): Confirm setupIntent only if it hasn't been confirmed
sashko9807 Apr 15, 2024
7f16b91
chore(donation-flow): Reset form when payment has succeeded
sashko9807 Apr 15, 2024
c455435
refactor: Change structure for better resposiveness
sashko9807 Apr 16, 2024
1c99fe4
ui: Change tooltip design according to ui specs
sashko9807 Apr 16, 2024
c694ac6
chore: Bring back SetupIntent call.
sashko9807 Apr 16, 2024
ccf5eb9
ui: Fix otherAmount field being too large
sashko9807 Apr 16, 2024
bdbe2eb
ui: Don't show desktop alerts for viewports <900px width
sashko9807 Apr 16, 2024
f17c818
chore: Remove unnecessary console.log
sashko9807 Apr 17, 2024
ec84d69
ui: Fix DonationStatus page being too large
sashko9807 Apr 17, 2024
4f974e3
i18n: Provide internalization for Share button
sashko9807 Apr 17, 2024
58fe458
fix: Fix hydratation errors
sashko9807 Apr 17, 2024
0e5a112
e2e: Adapt e2e tests to latest changes
sashko9807 Apr 18, 2024
3f2bd56
chore: Retrieve latest payment intent after card confirmation
sashko9807 Apr 18, 2024
e89fd2b
fix: Fix donation wishes not being attached to specific campaign
sashko9807 Apr 18, 2024
acfe194
fix: Donation status page being in loading state for bank donations
sashko9807 Apr 18, 2024
4583c4d
fix: Next.js build errors
sashko9807 Apr 18, 2024
43c0cb0
Cancel SetupIntent incase of bank donation and user cancellation
sashko9807 Apr 29, 2024
8f8401b
ui: Use same style for Stripe errors as form errors
sashko9807 Apr 29, 2024
27f5f15
fix: Formik persisted values being applied to donation for any campaign
sashko9807 Apr 29, 2024
b02e3d4
tests: Fix e2e breakages after latest changes
sashko9807 Apr 29, 2024
41e66d1
a11y: Fix not being to blur otherAmount input field
sashko9807 May 11, 2024
a3b9ef8
Merge branch 'master' of https://github.com/sashko9807/podkrepibg-fro…
sashko9807 Jun 17, 2024
54d4896
fix: Build issues
sashko9807 Jun 19, 2024
8a71aef
fix: SessionStorage item not cleared after succeeded donation
sashko9807 Jun 19, 2024
c0081dc
ui: Use correct typography for Alerts
sashko9807 Jun 19, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ jobs:
- name: Start frontend
working-directory: ./frontend
run: yarn start &> frontend.log &
env:
STRIPE_PUBLIC_KEY: ${{ env.STRIPE_DEV_PUBLISHABLE_KEY }}
dimitur2204 marked this conversation as resolved.
Show resolved Hide resolved

- name: Install Playwright Browsers
working-directory: ./frontend/e2e
Expand Down
23 changes: 23 additions & 0 deletions e2e/data/donation-test.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export const stripeSuccessFormData = {
cardNumber: '4242 4242 4242 4242',
email: '[email protected]',
expiryDate: '04 / 42',
cvc: '424',
country: 'BG',
}

export const stripeErrorNoBalanceFormData = {
cardNumber: '4000 0000 0000 9995',
email: '[email protected]',
expiryDate: '04 / 42',
cvc: '424',
country: 'BG',
}

export const stripeAuthenticationRequiredFormData = {
cardNumber: '4000 0027 6000 3184',
email: '[email protected]',
expiryDate: '04 / 42',
cvc: '424',
country: 'BG',
}
17 changes: 4 additions & 13 deletions e2e/data/enums/donation-regions.enum.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
// This enum should be used as a parameter for methods in E2E tests

// Check bgLocalizationOneTimeDonation["third-step"]["card-region"]
export enum bgDonationRegions {
EUROPE = 'Европа',
GREAT_BRITAIN = 'Великобритания',
OTHER = 'други',
}

export enum enDonationRegions {
EUROPE = 'Europe',
GREAT_BRITAIN = 'Great Britain',
OTHER = 'other',
export enum DonationRegions {
EUROPE = 'EU',
GREAT_BRITAIN = 'UK',
OTHER = 'Other',
}
8 changes: 4 additions & 4 deletions e2e/data/localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import enLocalizationValidationJson from '../../public/locales/en/validation.jso
import bgLocalizationCampaignsJson from '../../public/locales/bg/campaigns.json'
import enLocalizationCampaignsJson from '../../public/locales/en/campaigns.json'

import bgLocalizationOneTimeDonationJson from '../../public/locales/bg/one-time-donation.json'
import enLocalizationOneTimeDonationJson from '../../public/locales/en/one-time-donation.json'
import bgLocalizationDonationFlowJson from '../../public/locales/bg/donation-flow.json'
import enLocalizationDonationFlowJson from '../../public/locales/en/donation-flow.json'

// All these constants are used in the E2E test pages to manipulate web elements in a respective language
// Common localization terms
Expand All @@ -30,8 +30,8 @@ export const enLocalizationSupport = enLocalizationSupportJson
export const bgLocalizationCampaigns = bgLocalizationCampaignsJson
export const enLocalizationCampaigns = enLocalizationCampaignsJson
// Donations
export const bgLocalizationOneTimeDonation = bgLocalizationOneTimeDonationJson
export const enLocalizationOneTimeDonation = enLocalizationOneTimeDonationJson
export const bgLocalizationDonationFlow = bgLocalizationDonationFlowJson
export const enLocalizationDonationFlow = enLocalizationDonationFlowJson
// Validations
export const bgLocalizationValidation = bgLocalizationValidationJson
export const enLocalizationValidation = enLocalizationValidationJson
8 changes: 0 additions & 8 deletions e2e/data/support-page-tests.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,3 @@ export const supportPageVolutneerTestData = {
phone: '+359888000000',
comment: 'E2E Test comment',
}

export const anonDonationTestData = {
cardNumber: '4242 4242 4242 4242',
cardExpDate: '04 / 42',
cardCvc: '424',
billingName: 'E2E Test Anonymous Donation',
country: 'BG',
}
2 changes: 1 addition & 1 deletion e2e/pages/web-pages/base.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export class BasePage {
for (const item of labelText) {
// Here we use Xpath because of the special symbol "&nbsp" in the English version
const radioCheckboxElementLocator = this.page.locator(
"(//input[@type='radio']/ancestor::label/p[contains(text(),'" + item + "')])[1]",
"(//input[@type='radio']/ancestor::label/span/p[contains(text(),'" + item + "')])[1]",
)
if (await this.isElementVisibleByLocatorWithTimeout(radioCheckboxElementLocator)) {
await radioCheckboxElementLocator.click()
Expand Down
3 changes: 3 additions & 0 deletions e2e/pages/web-pages/campaigns/campaigns.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export class CampaignsPage extends HomePage {
private readonly bgSupportNowActionButtonText = bgLocalizationCampaigns.cta['support-now']
private readonly enSupportNowActionButtonText = enLocalizationCampaigns.cta['support-now']

/**
* Ovverride the method from the BasePage and add the specific selector for the Campaigns page as default
*/
async checkPageUrlByRegExp(urlRegExpAsString?: string, timeoutParam = 10000): Promise<void> {
await this.page.waitForTimeout(1000)
await expect(this.page, 'The URL is not correct!').toHaveURL(
Expand Down
244 changes: 0 additions & 244 deletions e2e/pages/web-pages/campaigns/donation.page.ts

This file was deleted.

40 changes: 40 additions & 0 deletions e2e/pages/web-pages/donation/donation-status.page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Page, expect } from '@playwright/test'
import { LanguagesEnum } from '../../../data/enums/languages.enum'
import { bgLocalizationDonationFlow, enLocalizationDonationFlow } from '../../../data/localization'
import { SLUG_REGEX } from '../../../utils/helpers'
import { CampaignsPage } from '../campaigns/campaigns.page'
export class DonationStatusPage extends CampaignsPage {
constructor(page: Page) {
super(page)
}

// -> Status titles <-
private readonly bgSuccessTitle = bgLocalizationDonationFlow.status.success.title
private readonly enSuccessTitle = enLocalizationDonationFlow.status.success.title

// -> Wish form <-
private readonly wishSendText = bgLocalizationDonationFlow.status.success.wish.send

async checkPageUrlByRegExp(urlRegExpAsString?: string, timeoutParam = 10000): Promise<void> {
await expect(this.page, 'The URL is not correct!').toHaveURL(
new RegExp(urlRegExpAsString || `^(.*?)/campaigns/donation/${SLUG_REGEX}/status?.+$`),
{
timeout: timeoutParam,
},
)
}

async isSucceededStatusTitleDisplayed(): Promise<boolean> {
return this.isH4HeadingVisible(LanguagesEnum.BG, this.bgSuccessTitle, this.enSuccessTitle)
}

async submitWishForm(): Promise<void> {
const wishAreaLocator = await this.page.locator('textarea[name="wish"]')
await this.waitForElementToBeReadyByLocator(wishAreaLocator)
await wishAreaLocator.fill('e2e_test_wish')
const buttonLocator = await this.page.locator('button[type="submit"]', {
hasText: this.wishSendText,
})
await this.clickElementByLocator(buttonLocator)
}
}
Loading