import { expect, test } from '@playwright/test';
test.beforeEach(async ({ page }) => {
await page.goto('/docs/');
});
test.describe('Home page', () => {
test.use({ storageState: { cookies: [], origins: [] } });
test('checks all the elements are visible', async ({ page }) => {
// Check header content
const header = page.locator('header').first();
const footer = page.locator('footer').first();
await expect(header).toBeVisible();
await expect(
header.getByRole('button', { name: /Language/ }),
).toBeVisible();
header.getByRole('button', { name: 'Les services de La Suite numé' }),
header.getByRole('img', { name: 'Gouvernement Logo' }),
await expect(header.getByRole('img', { name: 'Docs logo' })).toBeVisible();
await expect(header.getByRole('heading', { name: 'Docs' })).toBeVisible();
await expect(header.getByText('BETA')).toBeVisible();
// Check the titles
const h2 = page.locator('h2');
h2.getByText('Collaborative writing, Simplified.'),
h2.getByText('An uncompromising writing experience.'),
h2.getByText('Simple and secure collaboration.'),
await expect(h2.getByText('Flexible export.')).toBeVisible();
h2.getByText('A new way to organize knowledge.'),
page.getByText('Docs is already available, log in to use it now.'),
page.getByRole('button', { name: 'Proconnect Login' }),
).toHaveCount(2);
await expect(footer).toBeVisible();