Skip to content

Commit

Permalink
Merge branch 'master' into new-design-notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
RalitsaIlieva authored Oct 30, 2023
2 parents 2d74117 + d60abfa commit 740545a
Show file tree
Hide file tree
Showing 130 changed files with 2,764 additions and 674 deletions.
18 changes: 18 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,24 @@
"contributions": [
"code"
]
},
{
"login": "RalitsaIlieva",
"name": "RalitsaIlieva",
"avatar_url": "https://avatars.githubusercontent.com/u/17964436?v=4",
"profile": "https://github.com/RalitsaIlieva",
"contributions": [
"code"
]
},
{
"login": "kzhecheva",
"name": "Kalina Zhecheva",
"avatar_url": "https://avatars.githubusercontent.com/u/60223025?v=4",
"profile": "https://github.com/kzhecheva",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 10,
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
GHOST_API_URL: https://blog.podkrepi.bg
GHOST_CONTENT_KEY: ${{ secrets.GHOST_CONTENT_KEY }}
with:
context: .
push: false
target: runner
build-args: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build target dependencies #
###########################
FROM node:16-alpine3.16 AS base
FROM node:20-alpine AS base
WORKDIR /app
ARG NODE_ENV=production
ENV PATH=/app/node_modules/.bin:$PATH \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ Thanks goes to these wonderful people:
<td align="center" valign="top" width="10%"><a href="https://github.com/yyosifov"><img src="https://avatars.githubusercontent.com/u/2012493?v=4?s=100" width="100px;" alt="yyosifov"/><br /><sub><b>yyosifov</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=yyosifov" title="Code">💻</a></td>
<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>
</tr>
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"test": "tests"
},
"dependencies": {
"@playwright/test": "1.30.0",
"playwright": "1.30.0"
"@playwright/test": "^1.38.1",
"playwright": "^1.38.1"
},
"keywords": [],
"author": "",
Expand Down
12 changes: 9 additions & 3 deletions e2e/pages/web-pages/header.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export class HeaderPage extends BasePage {
language: LanguagesEnum,
): Promise<void> {
await this.waitForElementToBePresentedBySelector(this.toolbarCommonButtonsSelector)

//first switch to the desired language
await this.changeLanguageToBe(language)

//then find the item to click on
if (language === LanguagesEnum.BG) {
await this.clickElement(this.toolbarCommonButtonsSelector, { hasText: navTextBg })
} else if (language === LanguagesEnum.EN) {
Expand Down Expand Up @@ -128,9 +133,10 @@ export class HeaderPage extends BasePage {

/**
* Click on the language header button to change the page language
* @param {LanguagesEnum} languageParam
* @param {LanguagesEnum} language
*/
async changeanguageHeaderButtonToBe(languageParam: LanguagesEnum): Promise<void> {
await this.clickHeaderNavLink(LanguagesEnum.BG, LanguagesEnum.EN, languageParam)
async changeLanguageToBe(language: LanguagesEnum): Promise<void> {
const localeButton = this.page.getByTestId('locale-button')
if ((await localeButton.innerText()) === language) await localeButton.click()
}
}
22 changes: 13 additions & 9 deletions e2e/tests/regression/donation-flow/anon-donation-custom.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DonationPage } from '../../../pages/web-pages/campaigns/donation.page'
import { bgDonationRegions } from '../../../data/enums/donation-regions.enum'
import { StripeCheckoutPage } from '../../../pages/web-pages/external/stripe-checkout.page'
import { anonDonationTestData } from '../../../data/support-page-tests.data'
import { LanguagesEnum } from '../../../data/enums/languages.enum'

// This spec contains E2E tests related to anonymous donation flow - custom amount
// The tests are dependent, the whole describe should be runned
Expand All @@ -24,6 +25,8 @@ test.describe.serial(
const otherAmountText = bgLocalizationOneTimeDonation['first-step'].other
const bgCardIncludeFeesText = bgLocalizationOneTimeDonation['third-step']['card-include-fees']

test.use({ locale: 'bg-BG' }) //this is to ensure decimal separator is correctly expected

test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
homepage = new HomePage(page)
Expand All @@ -34,6 +37,7 @@ test.describe.serial(
// For local executions use method navigateToLocalhostHomepage();
// await homepage.navigateToLocalhostHomepage();
await homepage.navigateToEnvHomepage()
await headerPage.changeLanguageToBe(LanguagesEnum.BG)
})

test.afterAll(async () => {
Expand All @@ -58,29 +62,29 @@ test.describe.serial(
.soft(await donationPage.isSelectAmountStepActive(), 'Select Amount step is not active.')
.toBeTruthy()
await donationPage.selectRadioButtonByLabelText([otherAmountText])
await donationPage.fillOtherAmountInputField('7.50')
await donationPage.fillOtherAmountInputField('75')
await donationPage.setDonationRegionFromTheDropdown(bgDonationRegions.EUROPE)
await donationPage.selectCheckboxByLabelText([bgCardIncludeFeesText])
// Expected pattern:
// За вашия превод от {totalChargedAmountText} лв., таксата на Stripe ще е {feeAmountText} лв., а кампанията ще получи {donationAmountText} лв.
const totalChargedAmountText = await donationPage.getTotalChargedAmountsAsText()
const feeAmountText = await donationPage.getFeeAmountsAsText()
const donationAmountText = await donationPage.getDonationAmountsAsText()
expect.soft(totalChargedAmountText).toEqual('8,10 лв.')
expect.soft(feeAmountText).toEqual('0,60 лв.')
expect(donationAmountText).toEqual('7,50 лв.')
expect.soft(totalChargedAmountText).toEqual('76,42 лв.')
expect.soft(feeAmountText).toEqual('1,42 лв.')
expect(donationAmountText).toEqual('75,00 лв.')
})

test('The total charge, fee tax and donation amount are recalculated correctly when the donation amount is changed', async () => {
await donationPage.fillOtherAmountInputField('12.90')
await donationPage.fillOtherAmountInputField('120')
// Expected pattern:
// За вашия превод от {totalChargedAmountText} лв., таксата на Stripe ще е {feeAmountText} лв., а кампанията ще получи {donationAmountText} лв.
const totalChargedAmountText = await donationPage.getTotalChargedAmountsAsText()
const feeAmountText = await donationPage.getFeeAmountsAsText()
const donationAmountText = await donationPage.getDonationAmountsAsText()
expect.soft(totalChargedAmountText).toEqual('13,56 лв.')
expect.soft(feeAmountText).toEqual('0,66 лв.')
expect(donationAmountText).toEqual('12,90 лв.')
expect.soft(totalChargedAmountText).toEqual('121,96 лв.')
expect.soft(feeAmountText).toEqual('1,96 лв.')
expect(donationAmountText).toEqual('120,00 лв.')
})

test('The user is able to fill in e-mail for anonymous donation', async () => {
Expand All @@ -107,7 +111,7 @@ test.describe.serial(
const actualStripeEmail = await stripeCheckoutPage.getReadonlyEmailText()
expect
.soft(stripeTotalAmount, 'The Stripe total donation amount is not correct.')
.toContain('13.56')
.toContain('121,96')
expect(actualStripeEmail, 'The user e-mail is not sent correctly to Stripe.').toEqual(
testEmail,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.describe.serial(
// For local executions use method navigateToLocalhostHomepage();
// await homepage.navigateToLocalhostHomepage();
await homepage.navigateToEnvHomepage()
await headerPage.changeanguageHeaderButtonToBe(LanguagesEnum.EN)
await headerPage.changeLanguageToBe(LanguagesEnum.EN)
})

test.afterAll(async () => {
Expand Down
Loading

0 comments on commit 740545a

Please sign in to comment.