Skip to content

Commit

Permalink
fix(tests): wait for api to respond during e2e tests (freeCodeCamp#56730
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ojeytonwilliams authored Oct 21, 2024
1 parent 02f6e1a commit 07c3067
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions e2e/academic-honesty.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
3 changes: 3 additions & 0 deletions e2e/challenge-reset-modal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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 });
Expand Down

0 comments on commit 07c3067

Please sign in to comment.