Skip to content

Commit

Permalink
Merge branch 'master' into new-design-notifications-news
Browse files Browse the repository at this point in the history
  • Loading branch information
RalitsaIlieva authored Dec 13, 2023
2 parents cd5939e + 852970f commit 7689513
Show file tree
Hide file tree
Showing 107 changed files with 3,247 additions and 598 deletions.
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,16 @@
"name": "Kalina Zhecheva",
"avatar_url": "https://avatars.githubusercontent.com/u/60223025?v=4",
"profile": "https://github.com/kzhecheva",
"contributions": [
"code",
"test"
]
},
{
"login": "PetarDimitrov91",
"name": "Petar Dimitrov",
"avatar_url": "https://avatars.githubusercontent.com/u/79804094?v=4",
"profile": "https://github.com/PetarDimitrov91",
"contributions": [
"code"
]
Expand Down
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
# Check for updates to GitHub Actions every month
interval: 'monthly'
2 changes: 1 addition & 1 deletion .github/workflows/build-nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-pr-fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check whether tests are enabled for this PR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: yarn install --immutable
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
name: Run Playwright
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: './frontend'
ref: ${{ github.event.pull_request.head.sha }}

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: podkrepi-bg/api
ref: master
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
run: docker compose up -d stripe-webhook

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18'

Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Release
run-name: Releasing ${{ github.event.release.tag_name }}

on:
workflow_dispatch:
Expand All @@ -17,17 +18,17 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
push: true
file: Dockerfile.maintenance
Expand All @@ -47,10 +48,10 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -65,7 +66,7 @@ jobs:
run: echo "VERSION=master-$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
env:
NODE_ENV: production
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
Expand All @@ -92,10 +93,10 @@ jobs:
name: Scan k8s manifests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install kustomize
uses: imranismail/setup-kustomize@v1
uses: imranismail/setup-kustomize@v2

- name: Build development manifests
run: kustomize build manifests/overlays/development > dev-manifests.yaml
Expand Down Expand Up @@ -130,7 +131,7 @@ jobs:
name: dev
url: https://dev.podkrepi.bg
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install kubectl
uses: azure/setup-kubectl@v3
Expand All @@ -150,7 +151,7 @@ jobs:
working-directory: manifests/overlays/development
run: |
kustomize edit set image ghcr.io/podkrepi-bg/frontend=ghcr.io/podkrepi-bg/frontend:$VERSION
kustomize edit set annotation app.komodor.com/app.ref:$GITHUB_SHA
kustomize edit set annotation app.komodor.com/app.ref:$GITHUB_SHA
- name: Set kubeconfig
run: echo ${{ secrets.K8S_DEV_CONFIG }} | base64 -d > config.yaml
Expand Down Expand Up @@ -187,7 +188,7 @@ jobs:
name: prod
url: https://podkrepi.bg
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install kubectl
uses: azure/setup-kubectl@v3
Expand All @@ -202,7 +203,7 @@ jobs:
working-directory: manifests/overlays/production
run: |
kustomize edit set image ghcr.io/podkrepi-bg/frontend=ghcr.io/podkrepi-bg/frontend:$VERSION
kustomize edit set annotation app.komodor.com/app.ref:$GITHUB_SHA
kustomize edit set annotation app.komodor.com/app.ref:$GITHUB_SHA
- name: Set kubeconfig
run: echo ${{ secrets.K8S_CONFIG }} | base64 -d > config.yaml
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
env:
NODE_ENV: production
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
Expand Down Expand Up @@ -53,12 +53,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
push: false
file: Dockerfile.maintenance
Expand All @@ -75,12 +75,12 @@ jobs:
name: Scan k8s manifests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install kustomize
uses: imranismail/setup-kustomize@v1
uses: imranismail/setup-kustomize@v2

- name: Build development manifests
run: kustomize build manifests/overlays/development > dev-manifests.yaml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ Watch releases of this repository to be notified about future updates:

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

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

[![All Contributors](https://img.shields.io/badge/all_contributors-76-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 @@ -216,7 +215,8 @@ Thanks goes to these wonderful people:
<td align="center" valign="top" width="10%"><a href="https://github.com/dphilipov"><img src="https://avatars.githubusercontent.com/u/76788928?v=4?s=100" width="100px;" alt="Dimitar Filipov"/><br /><sub><b>Dimitar Filipov</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=dphilipov" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/hiapetrov"><img src="https://avatars.githubusercontent.com/u/107921565?v=4?s=100" width="100px;" alt="Alexander"/><br /><sub><b>Alexander</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=hiapetrov" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/RalitsaIlieva"><img src="https://avatars.githubusercontent.com/u/17964436?v=4?s=100" width="100px;" alt="RalitsaIlieva"/><br /><sub><b>RalitsaIlieva</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=RalitsaIlieva" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/kzhecheva"><img src="https://avatars.githubusercontent.com/u/60223025?v=4?s=100" width="100px;" alt="Kalina Zhecheva"/><br /><sub><b>Kalina Zhecheva</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=kzhecheva" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/kzhecheva"><img src="https://avatars.githubusercontent.com/u/60223025?v=4?s=100" width="100px;" alt="Kalina Zhecheva"/><br /><sub><b>Kalina Zhecheva</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=kzhecheva" title="Code">💻</a> <a href="https://github.com/podkrepi-bg/frontend/commits?author=kzhecheva" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/PetarDimitrov91"><img src="https://avatars.githubusercontent.com/u/79804094?v=4?s=100" width="100px;" alt="Petar Dimitrov"/><br /><sub><b>Petar Dimitrov</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=PetarDimitrov91" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion e2e/pages/web-pages/base.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ClickOptions, LocatorOptions } from '../../utils/types'

// Here we define all base methods, which are inherited into the other pages
export class BasePage {
protected page: Page
public page: Page

constructor(page: Page) {
this.page = page
Expand Down
22 changes: 22 additions & 0 deletions e2e/pages/web-pages/campaigns/campaigns.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export class CampaignsPage extends HomePage {
private readonly bgSupportNowActionButtonText = bgLocalizationCampaigns.cta['support']
private readonly enSupportNowActionButtonText = enLocalizationCampaigns.cta['support']

// Summary donors and wishes sections
private readonly bgDonorsButtonText = bgLocalizationCampaigns.campaign['donors']
private readonly enDonorsButtonText = enLocalizationCampaigns.campaign['donors']
private readonly bgWishesButtonText = bgLocalizationCampaigns.campaign['wishes']
private readonly enWishesButtonText = enLocalizationCampaigns.campaign['wishes']

async checkPageUrlByRegExp(urlRegExpAsString?: string, timeoutParam = 10000): Promise<void> {
await this.page.waitForTimeout(1000)
await expect(this.page, 'The URL is not correct!').toHaveURL(
Expand Down Expand Up @@ -108,4 +114,20 @@ export class CampaignsPage extends HomePage {
.locator(this.cardActionButtons, { hasText: supportButtonText })
await this.clickElementByLocator(cardActionButtonElement)
}

/**
* Check if Donors section in campaing summary is visible on the Campaigns page
* @param {LanguagesEnum} language - the default value is BG
*/
async isDonorsSectionVisible(language: LanguagesEnum = LanguagesEnum.BG): Promise<boolean> {
return this.isDonorsElementVisible(language, this.bgDonorsButtonText, this.enDonorsButtonText)
}

/**
* Check if Wishes section in campaing summary is visible on the Campaigns page
* @param {LanguagesEnum} language - the default value is BG
*/
async isWishesSectionVisible(language: LanguagesEnum = LanguagesEnum.BG): Promise<boolean> {
return this.isWishesElementVisible(language, this.bgWishesButtonText, this.enWishesButtonText)
}
}
59 changes: 59 additions & 0 deletions e2e/tests/regression/campaign-flow/campaign-view.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { test, expect, Page } from '@playwright/test'
import { HeaderPage } from '../../../pages/web-pages/header.page'
import { HomePage } from '../../../pages/web-pages/home.page'
import { CampaignsPage } from '../../../pages/web-pages/campaigns/campaigns.page'
import { DonationPage } from '../../../pages/web-pages/campaigns/donation.page'
import { StripeCheckoutPage } from '../../../pages/web-pages/external/stripe-checkout.page'
import { LanguagesEnum } from '../../../data/enums/languages.enum'

// This spec contains tests related campaign summary section and
// check summary 'Donors and Wishes' sections appearance and behavior.
test.describe.serial(
'A contributor is able to see Donors and Wishes in campaign summary section',
async () => {
let page: Page
let homepage: HomePage
let headerPage: HeaderPage
let campaignsPage: CampaignsPage
let donationPage: DonationPage
let stripeCheckoutPage: StripeCheckoutPage

test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
homepage = new HomePage(page)
headerPage = new HeaderPage(page)
campaignsPage = new CampaignsPage(page)
donationPage = new DonationPage(page)
stripeCheckoutPage = new StripeCheckoutPage(page)
// For local executions use method navigateToLocalhostHomepage();
// await homepage.navigateToLocalhostHomepage();
await homepage.navigateToEnvHomepage()
await headerPage.changeLanguageToBe(LanguagesEnum.EN)
})

test.afterAll(async () => {
await page.close()
})

test('Particular campaign can be opened through the Campaign page', async () => {
await headerPage.clickDonateHeaderNavButton()
await campaignsPage.clickCampaignCardByIndex(0)

expect(
await campaignsPage.checkPageUrlByRegExp(),
'The url is not changed after clicking on the campaign card.',
)
})

test('Particular campaign summary contains Donors and Wishes sections', async () => {
expect(campaignsPage.page.getByTestId('summary-donors')).toBeVisible()
expect(campaignsPage.page.getByTestId('summary-wishes')).toBeVisible()

await campaignsPage.page.getByTestId('summary-donors').click()
expect(campaignsPage.page.getByTestId('summary-donors-wrapper')).toBeVisible()

await campaignsPage.page.getByTestId('summary-wishes').click()
expect(campaignsPage.page.getByTestId('summary-wishes-wrapper')).toBeVisible()
})
},
)
4 changes: 4 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const moduleExports = {
source: '/api/v1/:slug*',
destination: `${process.env.API_URL ?? 'http://localhost:5010/api/v1'}/:slug*`, // Proxy to API
},
{
source: '/robots.txt',
destination: '/api/robots'
}
]
},
async redirects() {
Expand Down
Loading

0 comments on commit 7689513

Please sign in to comment.