fix(tests): wait for api to respond during e2e tests (#56730)

This commit is contained in:
Oliver Eyton-Williams
2024-10-21 10:49:40 +02:00
committed by GitHub
parent 02f6e1a76d
commit 07c3067db1
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -65,6 +65,7 @@ test.describe('When the user has not accepted the Academic Honesty Policy', () =
name: translations.buttons['agree-honesty']
});
await agreeButton.click();
await alertToBeVisible(page, translations.buttons['accepted-honesty']);
await page.reload();
+3
View File
@@ -4,6 +4,7 @@ import { test, expect, Page } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import { clearEditor, focusEditor, getEditors } from './utils/editor';
import { alertToBeVisible } from './utils/alerts';
const expectToRenderResetModal = async (page: Page) => {
await expect(
@@ -241,6 +242,7 @@ test.describe('Signed in user', () => {
await clearEditor({ page, browserName });
await getEditors(page).fill(savedText);
await page.keyboard.press('Control+S');
await alertToBeVisible(page, translations.flash['code-saved']);
await page.reload();
@@ -281,6 +283,7 @@ test.describe('Signed in user', () => {
await clearEditor({ page, browserName });
await getEditors(page).fill(savedText);
await page.keyboard.press('Control+S');
await alertToBeVisible(page, translations.flash['code-saved']);
// This second edit should be reset
await focusEditor({ page, isMobile });