Skip to content

Commit b18b16b

Browse files
committed
Created basic POM for the Playwright tests - initial commit
Added method and configurations Additional refactoring - methods, specs and gitignore Implemented Support page for E2E tests Fixed tests for Support page New changes on the tests Fixes on E2E tests
1 parent 9db3a35 commit b18b16b

40 files changed

+2186
-740
lines changed

.github/workflows/playwright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103

104104
- name: Run Frontend Tests
105105
working-directory: ./frontend
106-
run: yarn playwright test e2e/local
106+
run: yarn playwright test e2e/tests
107107

108108
- uses: actions/upload-artifact@v3
109109
if: always()

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ lerna-debug.log*
1717
coverage
1818
.nyc_output
1919

20+
# E2E
21+
e2e-reports/
22+
2023
# IDEs and editors
2124
.idea
2225
.project
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 16
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Install Playwright Browsers
19+
run: npx playwright install --with-deps
20+
- name: Run Playwright tests
21+
run: npx playwright test
22+
- uses: actions/upload-artifact@v3
23+
if: always()
24+
with:
25+
name: playwright-report
26+
path: playwright-report/
27+
retention-days: 30

e2e/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
/playwright/.cache/
3+
/playwright-report/
4+
/playwright/.cache/
5+
/e2e-reports/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// This enum should be used as a parameter for methods in E2E tests
2+
3+
// Check bgLocalizationOneTimeDonation["third-step"]["card-region"]
4+
export enum bgDonationRegions {
5+
EUROPE = "Европа",
6+
GREAT_BRITAIN = "Великобритания",
7+
OTHER = "други"
8+
}
9+
10+
export enum enDonationRegions {
11+
EUROPE = "Europe",
12+
GREAT_BRITAIN = "Great Britain",
13+
OTHER = "other"
14+
}

e2e/data/enums/languages.enum.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// This enum should be used as a parameter for methods in E2E tests
2+
3+
export enum LanguagesEnum {
4+
BG = 'BG',
5+
EN = 'EN'
6+
}

e2e/data/localization.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import bgLocalizationCommonJson from '../../public/locales/bg/common.json';
2+
import enLocalizationCommonJson from '../../public/locales/en/common.json';
3+
4+
import bgLocalizationIndexJson from '../../public/locales/bg/index.json';
5+
import enLocalizationIndexJson from '../../public/locales/en/index.json';
6+
7+
import bgLocalizationSupportJson from '../../public/locales/bg/support.json';
8+
import enLocalizationSupportJson from '../../public/locales/en/support.json';
9+
10+
import bgLocalizationValidationJson from '../../public/locales/bg/validation.json';
11+
import enLocalizationValidationJson from '../../public/locales/en/validation.json';
12+
13+
import bgLocalizationCampaignsJson from '../../public/locales/bg/campaigns.json';
14+
import enLocalizationCampaignsJson from '../../public/locales/en/campaigns.json';
15+
16+
import bgLocalizationOneTimeDonationJson from '../../public/locales/bg/one-time-donation.json';
17+
import enLocalizationOneTimeDonationJson from '../../public/locales/en/one-time-donation.json';
18+
19+
// All these constants are used in the E2E test pages to manipulate web elements in a respective language
20+
// Common localization terms
21+
export const bgLocalizationCommon = bgLocalizationCommonJson;
22+
export const enLocalizationCommon = enLocalizationCommonJson;
23+
// Home
24+
export const bgLocalizationIndex = bgLocalizationIndexJson;
25+
export const enLocalizationIndex = enLocalizationIndexJson;
26+
// Support page
27+
export const bgLocalizationSupport = bgLocalizationSupportJson;
28+
export const enLocalizationSupport = enLocalizationSupportJson;
29+
// Campaigns page
30+
export const bgLocalizationCampaigns = bgLocalizationCampaignsJson;
31+
export const enLocalizationCampaigns = enLocalizationCampaignsJson;
32+
// Donations
33+
export const bgLocalizationOneTimeDonation = bgLocalizationOneTimeDonationJson;
34+
export const enLocalizationOneTimeDonation = enLocalizationOneTimeDonationJson;
35+
// Validations
36+
export const bgLocalizationValidation = bgLocalizationValidationJson;
37+
export const enLocalizationValidation = enLocalizationValidationJson;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export const supportPageVolutneerTestData = {
2+
firstName: 'Test valid first name',
3+
lastName: 'Test valid last name',
4+
5+
phone: '+359888000000',
6+
comment: 'E2E Test comment'
7+
}
8+
9+
export const anonDonationTestData = {
10+
cardNumber: '4242 4242 4242 4242',
11+
cardExpDate: '04 / 24',
12+
cardCvc: '424',
13+
billingName: 'E2E Test Anonymous Donation',
14+
country: 'BG'
15+
}

e2e/local/campaigns.spec.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

e2e/local/donation.spec.ts

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)