forked from podkrepi-bg/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds tests for Wishes and Donors sections on the top of Campaign page (…
…podkrepi-bg#1646) * feat: adds campaign summary section tests
- Loading branch information
1 parent
7e3c89a
commit 6172dc1
Showing
6 changed files
with
86 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
}) | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters