We will cache the login token in the browser storage and reuse it between tests. This will speed up the tests and reduce the load on the server.
27 lines
724 B
TypeScript
27 lines
724 B
TypeScript
import { expect, test } from '@playwright/test';
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto('/');
|
|
});
|
|
|
|
test.describe('Language', () => {
|
|
test('checks the language picker', async ({ page }) => {
|
|
await expect(
|
|
page.getByRole('button', {
|
|
name: 'Create a new document',
|
|
}),
|
|
).toBeVisible();
|
|
|
|
const header = page.locator('header').first();
|
|
await header.getByRole('combobox').getByText('EN').click();
|
|
await header.getByRole('option', { name: 'FR' }).click();
|
|
await expect(header.getByRole('combobox').getByText('FR')).toBeVisible();
|
|
|
|
await expect(
|
|
page.getByRole('button', {
|
|
name: 'Créer un nouveau document',
|
|
}),
|
|
).toBeVisible();
|
|
});
|
|
});
|