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

#1188, #1194 - Add POM for the E2E tests and update all tests #1265

Merged
merged 37 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7f48285
Created basic POM for the Playwright tests - initial commit
DanielTakev Nov 28, 2022
b18b16b
Created basic POM for the Playwright tests - initial commit
DanielTakev Nov 28, 2022
3bb8a19
Merge branch '1194-feature-create-playwright-page-object-model-for-th…
DanielTakev Dec 16, 2022
0467e36
Updated paths for the localization files for E2E
DanielTakev Dec 16, 2022
26e6314
Merge branch 'master' into 1194-feature-create-playwright-page-object…
DanielTakev Dec 16, 2022
3948470
Merge branch '1194-feature-create-playwright-page-object-model-for-th…
DanielTakev Dec 16, 2022
6b9d21a
Revert "Merge branch '1194-feature-create-playwright-page-object-mode…
DanielTakev Dec 16, 2022
cfe5caa
Updated Readme file
DanielTakev Dec 16, 2022
c59609d
Fixed Sonar issues and updated Playwright version
DanielTakev Dec 21, 2022
2325be1
1194 - init yarn project in the e2e folder and move out gitignore
dimitur2204 Dec 22, 2022
18e9d9e
1194 - fix ts errors
dimitur2204 Dec 22, 2022
dec990b
1194 - add e2e/.yarn to gitignore
dimitur2204 Dec 22, 2022
1259787
1194 - remove e2e/.yarn
dimitur2204 Dec 22, 2022
1809c13
1194 - remove cached .yarn folder
dimitur2204 Dec 22, 2022
9c4abf0
1194 - change GH Action workflow to now run the `test:e2e`
dimitur2204 Dec 22, 2022
8bebecf
1194 - change GH Action workflow to include artifacts of the reports …
dimitur2204 Dec 22, 2022
166d768
1194 - fix home.page.ts ts errors
dimitur2204 Dec 22, 2022
886fa07
1194 - remove hardcoded navigation to different environments
dimitur2204 Dec 22, 2022
747a562
1194 - add installation of dependencies for the e2e folder in the CI…
dimitur2204 Dec 22, 2022
80bb866
Merge remote-tracking branch 'upstream/master' into 1194-pom-e2e-test…
dimitur2204 Dec 22, 2022
f5426dd
1194 - fix translation on the homepage
dimitur2204 Dec 22, 2022
089cf3c
1194 - fix e2e script in the root folder
dimitur2204 Dec 22, 2022
62f2b9d
1194 - add a tsconfig.build.json to exclude e2e while next is building
dimitur2204 Dec 22, 2022
734000f
1194 - add data based on the STAGING env variable
dimitur2204 Dec 22, 2022
34f1f50
1194 - resolve environment related tests
dimitur2204 Dec 26, 2022
56023e4
1194 - remove uneccessasry `tsconfigPath` inside of the config
dimitur2204 Jan 19, 2023
18ec68e
1194 - put video to `off` by default
dimitur2204 Jan 29, 2023
d6ce64a
Merge branch 'master' into 1194-pom-e2e-test-update-fix-builds
dimitur2204 Jan 29, 2023
31df6fa
1194 - add a clickCampaignByIndex method
dimitur2204 Jan 29, 2023
ee7116a
1194 - remove campaign specific test and changed them to index based
dimitur2204 Jan 29, 2023
3271896
Merge remote-tracking branch 'origin/master' into 1194-pom-e2e-test-u…
dimitur2204 Jan 29, 2023
29fa322
1194 - add the index on the campaigns page list
dimitur2204 Jan 29, 2023
7bea6c1
1194 - change the expiry date tests data to `04 / 42`
dimitur2204 Jan 29, 2023
bbc4cec
1194 - add the index to the campaign card on the campaigns section on…
dimitur2204 Jan 29, 2023
d5c6418
1194 - add `playwright` as a dependency for the project
dimitur2204 Jan 29, 2023
120adcb
1194 - add the changed `yarn.lock`
dimitur2204 Jan 29, 2023
0c7ea04
1194 - fix the support action button click test to not click the car…
dimitur2204 Jan 29, 2023
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
19 changes: 15 additions & 4 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ jobs:
- name: Install Frontend Dependencies
working-directory: ./frontend
run: yarn

- name: Install e2e Dependencies
working-directory: ./frontend/e2e
run: yarn

- name: Setup env
working-directory: ./frontend
Expand All @@ -92,8 +96,8 @@ jobs:
run: yarn start &> frontend.log &

- name: Install Playwright Browsers
working-directory: ./frontend
run: npx playwright install --with-deps
working-directory: ./frontend/e2e
run: yarn run playwright:install

- name: Wait on frontend
uses: iFaxity/wait-on-action@v1
Expand All @@ -103,13 +107,20 @@ jobs:

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

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: ./frontend/playwright-report/
path: ./frontend/e2e/test-results/
retention-days: 14

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: ./frontend/e2e/e2e-reports/
retention-days: 14

- uses: actions/upload-artifact@v3
Expand Down
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ lerna-debug.log*
coverage
.nyc_output

# E2E
test-results/
playwright-report/
playwright/.cache/
e2e-reports/
e2e/.yarn/*

# IDEs and editors
.idea
.project
Expand Down Expand Up @@ -51,9 +58,6 @@ build/
bld/
[Bb]in/
[Oo]bj/
/test-results/
/playwright-report/
/playwright/.cache/

# https://yarnpkg.com/getting-started/qa/#which-files-should-be-gitignored
.pnp.*
Expand Down
31 changes: 0 additions & 31 deletions e2e/AuthPage.ts

This file was deleted.

10 changes: 2 additions & 8 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,8 @@ Options:
yarn test:e2e
```

### Run only local test suites
### Run test suites in headed mode with enabled debug

```shell
yarn test:e2e local
```

### Run local test suites in headed mode with enabled debug

```shell
yarn test:e2e local --headed --debug -x -g support
yarn test:e2e --headed --debug -x -g support
```
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: '[email protected]',
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',
}
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.

Loading