Skip to content

Commit

Permalink
Created basic POM for the Playwright tests - initial commit
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DanielTakev committed Dec 16, 2022
1 parent 9db3a35 commit b18b16b
Show file tree
Hide file tree
Showing 40 changed files with 2,186 additions and 740 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:

- name: Run Frontend Tests
working-directory: ./frontend
run: yarn playwright test e2e/local
run: yarn playwright test e2e/tests

- uses: actions/upload-artifact@v3
if: always()
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ lerna-debug.log*
coverage
.nyc_output

# E2E
e2e-reports/

# IDEs and editors
.idea
.project
Expand Down
27 changes: 27 additions & 0 deletions e2e/.github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
5 changes: 5 additions & 0 deletions e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
/playwright/.cache/
/playwright-report/
/playwright/.cache/
/e2e-reports/
14 changes: 14 additions & 0 deletions e2e/data/enums/donation-regions.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// 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"
}
6 changes: 6 additions & 0 deletions e2e/data/enums/languages.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This enum should be used as a parameter for methods in E2E tests

export enum LanguagesEnum {
BG = 'BG',
EN = 'EN'
}
37 changes: 37 additions & 0 deletions e2e/data/localization.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import bgLocalizationCommonJson from '../../public/locales/bg/common.json';
import enLocalizationCommonJson from '../../public/locales/en/common.json';

import bgLocalizationIndexJson from '../../public/locales/bg/index.json';
import enLocalizationIndexJson from '../../public/locales/en/index.json';

import bgLocalizationSupportJson from '../../public/locales/bg/support.json';
import enLocalizationSupportJson from '../../public/locales/en/support.json';

import bgLocalizationValidationJson from '../../public/locales/bg/validation.json';
import enLocalizationValidationJson from '../../public/locales/en/validation.json';

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';

// All these constants are used in the E2E test pages to manipulate web elements in a respective language
// Common localization terms
export const bgLocalizationCommon = bgLocalizationCommonJson;
export const enLocalizationCommon = enLocalizationCommonJson;
// Home
export const bgLocalizationIndex = bgLocalizationIndexJson;
export const enLocalizationIndex = enLocalizationIndexJson;
// Support page
export const bgLocalizationSupport = bgLocalizationSupportJson;
export const enLocalizationSupport = enLocalizationSupportJson;
// Campaigns page
export const bgLocalizationCampaigns = bgLocalizationCampaignsJson;
export const enLocalizationCampaigns = enLocalizationCampaignsJson;
// Donations
export const bgLocalizationOneTimeDonation = bgLocalizationOneTimeDonationJson;
export const enLocalizationOneTimeDonation = enLocalizationOneTimeDonationJson;
// Validations
export const bgLocalizationValidation = bgLocalizationValidationJson;
export const enLocalizationValidation = enLocalizationValidationJson;
15 changes: 15 additions & 0 deletions e2e/data/support-page-tests.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const supportPageVolutneerTestData = {
firstName: 'Test valid first name',
lastName: 'Test valid last name',
email: 'e2e_test_mail@test.bg',
phone: '+359888000000',
comment: 'E2E Test comment'
}

export const anonDonationTestData = {
cardNumber: '4242 4242 4242 4242',
cardExpDate: '04 / 24',
cardCvc: '424',
billingName: 'E2E Test Anonymous Donation',
country: 'BG'
}
29 changes: 0 additions & 29 deletions e2e/local/campaigns.spec.ts

This file was deleted.

107 changes: 0 additions & 107 deletions e2e/local/donation.spec.ts

This file was deleted.

72 changes: 0 additions & 72 deletions e2e/local/homepage.spec.ts

This file was deleted.

Loading

0 comments on commit b18b16b

Please sign in to comment.