-
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.
test(playwright): ✅ update goto() urls
- Loading branch information
1 parent
961b198
commit 53e0d16
Showing
23 changed files
with
53 additions
and
94 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
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
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
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
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
19 changes: 6 additions & 13 deletions
19
__tests__/playwright/header/desktop-menu/linkAboutMe.spec.ts
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
19 changes: 6 additions & 13 deletions
19
__tests__/playwright/header/desktop-menu/linkPersonalProjects.spec.ts
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
19 changes: 6 additions & 13 deletions
19
__tests__/playwright/header/desktop-menu/linkResume.spec.ts
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
19 changes: 6 additions & 13 deletions
19
__tests__/playwright/header/desktop-menu/linkWorkExperience.spec.ts
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 |
---|---|---|
@@ -1,39 +1,32 @@ | ||
import { getDataTestId } from '@/__tests__/playwright/utils/getDataTestId' | ||
import { DATA_TEST_IDS } from '@/utils/dataTestIds' | ||
import { expect, test } from '@playwright/test' | ||
|
||
const Selectors = { | ||
HEADER_LOGO: 'data-testid=header-logo', | ||
} | ||
|
||
const Paths = { | ||
HOME: '/', | ||
HOME_PAGE_URL: 'http://localhost:3000/', | ||
} | ||
|
||
test.describe('Header - Logo', () => { | ||
test('Check link and text', async ({ page }) => { | ||
await test.step('Go to home page', async () => { | ||
await page.goto(Paths.HOME) | ||
await page.goto('/') | ||
}) | ||
|
||
await test.step('Check if the link is visible', async () => { | ||
const isLinkVisible = await page.isVisible(Selectors.HEADER_LOGO) | ||
const isLinkVisible = await page.isVisible(getDataTestId(DATA_TEST_IDS.header)) | ||
expect(isLinkVisible).toBe(true) | ||
}) | ||
|
||
await test.step('Check if the link text is correct', async () => { | ||
const linkText = await page.textContent(Selectors.HEADER_LOGO) | ||
const linkText = await page.textContent(getDataTestId(DATA_TEST_IDS.header)) | ||
expect(linkText).toBe('krsiak.cz') | ||
}) | ||
|
||
await test.step('Check if link is correct', async () => { | ||
const linkUrl = await page.getAttribute(Selectors.HEADER_LOGO, 'href') | ||
expect(linkUrl).toBe(Paths.HOME) | ||
const linkUrl = await page.getAttribute(getDataTestId(DATA_TEST_IDS.header), 'href') | ||
expect(linkUrl).toBe('/') | ||
}) | ||
|
||
await test.step('Check if the link redirects to the home page when clicked', async () => { | ||
await page.click(Selectors.HEADER_LOGO) | ||
await page.click(getDataTestId(DATA_TEST_IDS.header)) | ||
await page.waitForLoadState('networkidle') | ||
expect(page.url()).toBe(Paths.HOME_PAGE_URL) | ||
expect(page.url()).toBe('http://localhost:3000/') | ||
}) | ||
}) | ||
}) |
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
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