Skip to content

Commit

Permalink
test: ✅ E2E - Kooperativa (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
krsiakdaniel authored Nov 30, 2024
1 parent 75fb6dc commit 3093859
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ test.afterEach(async () => {
})

test.describe('Projects Work - Page links', () => {
test('Project - Kooperativa', async () => {
await testProjectLink(page, PAGES_URL.work.kooperativa, PROJECT_ID.work.kooperativa)
})

test('Project - Smartsupp Dashboard', async () => {
await testProjectLink(page, PAGES_URL.work.smartsupp.dashboard, PROJECT_ID.work.smartsupp.dashboard)
})
Expand All @@ -41,6 +45,10 @@ test.describe('Projects Work - Page links', () => {
await testProjectLink(page, PAGES_URL.work.smartsupp.help, PROJECT_ID.work.smartsupp.help)
})

test('Project - Groupon', async () => {
await testProjectLink(page, PAGES_URL.work.groupon, PROJECT_ID.work.groupon)
})

test('Project - Moravia', async () => {
await testProjectLink(page, PAGES_URL.work.moravia, PROJECT_ID.work.moravia)
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Browser, BrowserContext, Page, chromium, expect, test } from '@playwright/test'

let browser: Browser
let context: BrowserContext
let page: Page

test.beforeAll(async () => {
browser = await chromium.launch()
})

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

test.beforeEach(async () => {
context = await browser.newContext()
page = await context.newPage()
await page.goto('/')
})

test.afterEach(async () => {
await context.close()
})

test.describe('Project - Kooperativa', () => {
test('Links', async ({ page }) => {
await test.step('Go to page', async () => {
await page.goto('/work-experience/kooperativa')
})

await test.step('Check Website link', async () => {
const link1 = page.getByRole('link', { name: 'Website →', exact: true })
const href1 = await link1.getAttribute('href')
const expectedUrl1 = 'https://www.koop.cz/pojisteni/pojisteni-majetku'
expect(href1).toBe(expectedUrl1)
})
})
})

0 comments on commit 3093859

Please sign in to comment.