🐛(e2e) fix flaky tests

3 tests were flags are flaky or bringing flakiness.
We improved them.
This commit is contained in:
Anthony LC
2024-12-17 12:30:56 +01:00
committed by Anthony LC
parent 4e7f095b0f
commit 59e74e6eeb
2 changed files with 7 additions and 6 deletions

View File

@@ -233,7 +233,7 @@ test.describe('Doc Editor', () => {
test.skip(browserName === 'webkit', 'This test is very flaky with webkit');
// Check the first doc
const doc = await goToGridDoc(page);
const [doc] = await createDoc(page, 'doc-quit-1', browserName, 1);
await expect(page.locator('h2').getByText(doc)).toBeVisible();
const editor = page.locator('.ProseMirror');
@@ -272,8 +272,8 @@ test.describe('Doc Editor', () => {
).toBeVisible();
});
test('it adds an image to the doc editor', async ({ page }) => {
await goToGridDoc(page);
test('it adds an image to the doc editor', async ({ page, browserName }) => {
await createDoc(page, 'doc-image', browserName, 1);
const fileChooserPromise = page.waitForEvent('filechooser');

View File

@@ -120,13 +120,14 @@ test.describe('Doc Header', () => {
await editor.locator('h1').fill('');
// eslint-disable-next-line playwright/no-wait-for-timeout
await page.waitForTimeout(500);
await docHeader
.getByRole('heading', { name: 'Top World', level: 2 })
.fill(' ');
await page.getByText('Created at').click({
delay: 200,
});
await page.getByText('Created at').click();
await expect(
docHeader.getByRole('heading', { name: 'Untitled document', level: 2 }),