Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/1912-Support-Page-Forms-Validation
Browse files Browse the repository at this point in the history
  • Loading branch information
velnachev committed Oct 17, 2024
2 parents 7ddf813 + fc45a88 commit 4b0fb2e
Show file tree
Hide file tree
Showing 124 changed files with 8,367 additions and 2,729 deletions.
2 changes: 1 addition & 1 deletion .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ GOOGLE_SECRET=

## Stripe ##
##############
STRIPE_PUBLIC_KEY=
STRIPE_PUBLISHABLE_KEY=

## Paypal ##
##############
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Playwright tests
on:
workflow_call:
workflow_dispatch:
env:
STRIPE_DEV_PUBLISHABLE_KEY: ${{ vars.STRIPE_DEV_PUBLISHABLE_KEY }}

jobs:
run-playwright:
Expand Down Expand Up @@ -95,6 +97,8 @@ jobs:
- name: Start frontend
working-directory: ./frontend
run: yarn start &> frontend.log &
env:
STRIPE_PUBLISHABLE_KEY: ${{ env.STRIPE_DEV_PUBLISHABLE_KEY }}

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

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

export const stripeAuthenticationRequiredFormData = {
cardNumber: '4000 0027 6000 3184',
name: 'E2e_TEST_NAME',
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',
}
5 changes: 4 additions & 1 deletion e2e/pages/web-pages/campaigns/campaigns.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ export class CampaignsPage extends HomePage {
private readonly bgWishesButtonText = bgLocalizationCampaigns.campaign['wishes']
private readonly enWishesButtonText = enLocalizationCampaigns.campaign['wishes']

/**
* 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(
new RegExp(urlRegExpAsString || `^(.*?)/campaigns/${SLUG_REGEX}`),
new RegExp(urlRegExpAsString || `^(.*?)/(en/)?campaigns/${SLUG_REGEX}`),
{
timeout: timeoutParam,
},
Expand Down
244 changes: 0 additions & 244 deletions e2e/pages/web-pages/campaigns/donation.page.ts

This file was deleted.

Loading

0 comments on commit 4b0fb2e

Please sign in to comment.