Skip to content

Commit 59e74e6

Browse files
committed
🐛(e2e) fix flaky tests
3 tests were flags are flaky or bringing flakiness. We improved them.
1 parent 4e7f095 commit 59e74e6

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ test.describe('Doc Editor', () => {
233233
test.skip(browserName === 'webkit', 'This test is very flaky with webkit');
234234

235235
// Check the first doc
236-
const doc = await goToGridDoc(page);
236+
const [doc] = await createDoc(page, 'doc-quit-1', browserName, 1);
237237
await expect(page.locator('h2').getByText(doc)).toBeVisible();
238238

239239
const editor = page.locator('.ProseMirror');
@@ -272,8 +272,8 @@ test.describe('Doc Editor', () => {
272272
).toBeVisible();
273273
});
274274

275-
test('it adds an image to the doc editor', async ({ page }) => {
276-
await goToGridDoc(page);
275+
test('it adds an image to the doc editor', async ({ page, browserName }) => {
276+
await createDoc(page, 'doc-image', browserName, 1);
277277

278278
const fileChooserPromise = page.waitForEvent('filechooser');
279279

src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,14 @@ test.describe('Doc Header', () => {
120120

121121
await editor.locator('h1').fill('');
122122

123+
// eslint-disable-next-line playwright/no-wait-for-timeout
124+
await page.waitForTimeout(500);
125+
123126
await docHeader
124127
.getByRole('heading', { name: 'Top World', level: 2 })
125128
.fill(' ');
126129

127-
await page.getByText('Created at').click({
128-
delay: 200,
129-
});
130+
await page.getByText('Created at').click();
130131

131132
await expect(
132133
docHeader.getByRole('heading', { name: 'Untitled document', level: 2 }),

0 commit comments

Comments
 (0)