-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: unified e2e tests for Checkly and playwright
- Loading branch information
Showing
4 changed files
with
57 additions
and
90 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,50 @@ | ||
import { expect, test } from '@playwright/test'; | ||
|
||
if (process.env.ENVIRONMENT_URL) { | ||
test.use({ | ||
baseURL: process.env.ENVIRONMENT_URL, | ||
}); | ||
} | ||
|
||
test.describe('Sanity', () => { | ||
test.describe('Static pages', () => { | ||
test('should display the homepage', async ({ page }) => { | ||
await page.goto('/'); | ||
|
||
await expect( | ||
page.getByRole('heading', { | ||
name: 'Boilerplate code for your Nextjs project with Tailwind CSS', | ||
}), | ||
).toBeVisible(); | ||
}); | ||
|
||
test('should navigate to the about page', async ({ page }) => { | ||
await page.goto('/'); | ||
|
||
await page.getByRole('link', { name: 'About' }).click(); | ||
await expect(page).toHaveURL('/about'); | ||
|
||
await expect( | ||
page.getByText('Lorem ipsum dolor sit amet', { exact: false }), | ||
).toHaveCount(2); | ||
}); | ||
|
||
test('should navigate to the portfolio page', async ({ page }) => { | ||
await page.goto('/'); | ||
|
||
await page.getByRole('link', { name: 'Portfolio' }).click(); | ||
await expect(page).toHaveURL('/portfolio'); | ||
|
||
await expect(page.locator('main').getByRole('link')).toHaveCount(6); | ||
}); | ||
|
||
test('should navigate to the blog page', async ({ page }) => { | ||
await page.goto('/'); | ||
|
||
await page.getByRole('link', { name: 'Blog' }).click(); | ||
await expect(page).toHaveURL('/blog'); | ||
|
||
await expect(page.locator('main').getByRole('link')).toHaveCount(10); | ||
}); | ||
}); | ||
}); |