-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use faker instead of Math.random, simply playwright config
- Loading branch information
Showing
10 changed files
with
54 additions
and
29 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -1,27 +1,29 @@ | ||
import { expect, test } from '@playwright/test'; | ||
|
||
test.describe('I18n', () => { | ||
test.describe('Static pages', () => { | ||
test('should take screenshot of the homepage', async ({ page }) => { | ||
test.describe('Language Switching', () => { | ||
test('should switch language from English to French using dropdown and verify text on the homepage', async ({ page }) => { | ||
await page.goto('/'); | ||
|
||
await expect( | ||
page.getByRole('heading', { name: 'Boilerplate Code for Your Next.js Project with Tailwind CSS' }), | ||
).toBeVisible(); | ||
|
||
await page.getByRole('link', { name: 'About' }).click(); | ||
await page.getByLabel('lang-switcher').selectOption('fr'); | ||
|
||
await expect(page.getByText('Welcome to our About page')).toBeVisible(); | ||
await expect( | ||
page.getByRole('heading', { name: 'Code de démarrage pour Next.js avec Tailwind CSS' }), | ||
).toBeVisible(); | ||
}); | ||
|
||
await page.getByRole('combobox', { name: 'lang-switcher' }).selectOption({ label: 'FR' }); | ||
test('should switch language from English to French using URL and verify text on the sign-in page', async ({ page }) => { | ||
await page.goto('/sign-in'); | ||
|
||
await expect(page.getByText('Bienvenue sur notre page À propos')).toBeVisible(); | ||
await expect(page.getByText('Email address')).toBeVisible(); | ||
|
||
await page.getByRole('link', { name: 'Accueil' }).click(); | ||
await page.goto('/fr/sign-in'); | ||
|
||
await expect( | ||
page.getByRole('heading', { name: 'Code de démarrage pour Next.js avec Tailwind CSS' }), | ||
).toBeVisible(); | ||
await expect(page.getByText('Adresse e-mail')).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