Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sashko9807/podkrepibg-frontend in…
Browse files Browse the repository at this point in the history
…to new-campaign-statuses
  • Loading branch information
sashko9807 committed Oct 29, 2024
2 parents b5dafcc + fc45a88 commit ed14071
Show file tree
Hide file tree
Showing 182 changed files with 10,708 additions and 3,329 deletions.
18 changes: 18 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,24 @@
"code",
"test"
]
},
{
"login": "viiktorstefanov",
"name": "Viktor Stefanov",
"avatar_url": "https://avatars.githubusercontent.com/u/122864734?v=4",
"profile": "https://github.com/viiktorstefanov",
"contributions": [
"code"
]
},
{
"login": "velnachev",
"name": "velnachev",
"avatar_url": "https://avatars.githubusercontent.com/u/60844919?v=4",
"profile": "https://github.com/velnachev",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 10,
Expand Down
42 changes: 20 additions & 22 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/alpine
{
"name": "NodeJS",
"image": "ghcr.io/podkrepi-bg/nodejs-devcontainer:v1.2.0",
"forwardPorts": [], // Forward ports
"containerEnv": {
"DATABASE_URL": "postgres://postgres:[email protected]:5432/postgres?schema=api" // Custom env vars
},
"postStartCommand": "yarn", // Install dependencies
"customizations":{
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker",
"nrwl.angular-console",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"dbaeumer.vscode-eslint"
]
}
},
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
]
}
"name": "NodeJS",
"image": "ghcr.io/podkrepi-bg/nodejs-devcontainer:v1.2.0",
"forwardPorts": [], // Forward ports
"containerEnv": {
"DATABASE_URL": "postgres://postgres:[email protected]:5432/postgres?schema=api" // Custom env vars
},
"postStartCommand": "yarn", // Install dependencies
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker",
"nrwl.angular-console",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"dbaeumer.vscode-eslint"
]
}
},
"mounts": ["source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"]
}
4 changes: 3 additions & 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 All @@ -43,3 +43,5 @@ PAYPAL_CLIENT_ID=sb
###########
GHOST_API_URL=https://blog.podkrepi.bg
GHOST_CONTENT_KEY=86ec17c4b9660acd66b6034682
[email protected]
PODKREPI_PASSWORD=$ecurePa33
12 changes: 8 additions & 4 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 @@ -36,9 +38,9 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Run db
- name: Run db and keycloak
working-directory: ./api
run: docker compose up -d pg-db
run: docker compose up -d pg-db keycloak

- name: Run stripe webhook
working-directory: ./api
Expand Down Expand Up @@ -69,7 +71,7 @@ jobs:
- name: Install Frontend Dependencies
working-directory: ./frontend
run: yarn install --immutable

- name: Install e2e Dependencies
working-directory: ./frontend/e2e
run: yarn install --immutable
Expand All @@ -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 All @@ -116,7 +120,7 @@ jobs:
name: playwright-report
path: ./frontend/e2e/test-results/
retention-days: 14

- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ Watch releases of this repository to be notified about future updates:
## Contributors ✨

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-82-orange.svg?style=flat-square)](#contributors-)

[![All Contributors](https://img.shields.io/badge/all_contributors-84-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Please check [contributors guide](https://github.com/podkrepi-bg/frontend/blob/master/CONTRIBUTING.md) for:
Expand Down Expand Up @@ -226,6 +224,8 @@ Thanks goes to these wonderful people:
<tr>
<td align="center" valign="top" width="10%"><a href="https://github.com/teodorazhelyazkova"><img src="https://avatars.githubusercontent.com/u/103574320?v=4?s=100" width="100px;" alt="Teodora Zhelyazkova"/><br /><sub><b>Teodora Zhelyazkova</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=teodorazhelyazkova" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://martbul.github.io/MartinKovachki/"><img src="https://avatars.githubusercontent.com/u/99181339?v=4?s=100" width="100px;" alt="Martin Kovachki"/><br /><sub><b>Martin Kovachki</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=Martbul" title="Code">💻</a> <a href="https://github.com/podkrepi-bg/frontend/commits?author=Martbul" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/viiktorstefanov"><img src="https://avatars.githubusercontent.com/u/122864734?v=4?s=100" width="100px;" alt="Viktor Stefanov"/><br /><sub><b>Viktor Stefanov</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=viiktorstefanov" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/velnachev"><img src="https://avatars.githubusercontent.com/u/60844919?v=4?s=100" width="100px;" alt="velnachev"/><br /><sub><b>velnachev</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=velnachev" title="Code">💻</a></td>
</tr>
</tbody>
</table>
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
Loading

0 comments on commit ed14071

Please sign in to comment.