Skip to content

Commit 07c3067

Browse files
fix(tests): wait for api to respond during e2e tests (freeCodeCamp#56730)
1 parent 02f6e1a commit 07c3067

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

e2e/academic-honesty.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ test.describe('When the user has not accepted the Academic Honesty Policy', () =
6565
name: translations.buttons['agree-honesty']
6666
});
6767
await agreeButton.click();
68+
await alertToBeVisible(page, translations.buttons['accepted-honesty']);
6869

6970
await page.reload();
7071

e2e/challenge-reset-modal.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { test, expect, Page } from '@playwright/test';
44

55
import translations from '../client/i18n/locales/english/translations.json';
66
import { clearEditor, focusEditor, getEditors } from './utils/editor';
7+
import { alertToBeVisible } from './utils/alerts';
78

89
const expectToRenderResetModal = async (page: Page) => {
910
await expect(
@@ -241,6 +242,7 @@ test.describe('Signed in user', () => {
241242
await clearEditor({ page, browserName });
242243
await getEditors(page).fill(savedText);
243244
await page.keyboard.press('Control+S');
245+
await alertToBeVisible(page, translations.flash['code-saved']);
244246

245247
await page.reload();
246248

@@ -281,6 +283,7 @@ test.describe('Signed in user', () => {
281283
await clearEditor({ page, browserName });
282284
await getEditors(page).fill(savedText);
283285
await page.keyboard.press('Control+S');
286+
await alertToBeVisible(page, translations.flash['code-saved']);
284287

285288
// This second edit should be reset
286289
await focusEditor({ page, isMobile });

0 commit comments

Comments
 (0)