mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(tests): wait for api to respond during e2e tests (#56730)
This commit is contained in:
committed by
GitHub
parent
02f6e1a76d
commit
07c3067db1
@@ -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();
|
||||
|
||||
|
||||
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user