mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
fix(e2e, playwright): stabilize page navigation in hotkeys.spec.ts (#52236)
This commit is contained in:
@@ -36,10 +36,18 @@ test('User can interact with the app using the keyboard', async ({
|
||||
await page.keyboard.press('n');
|
||||
const nextCourse = '**/declare-javascript-variables';
|
||||
await page.waitForURL(nextCourse);
|
||||
// Ensure that the page content is loaded before simulating user interactions.
|
||||
await expect(
|
||||
page.getByRole('heading', { name: 'Declare JavaScript Variables' })
|
||||
).toBeVisible();
|
||||
|
||||
await page.keyboard.press('p');
|
||||
const previousCourse = '**/comment-your-javascript-code';
|
||||
await page.waitForURL(previousCourse);
|
||||
// Ensure that the page content is loaded before simulating user interactions.
|
||||
await expect(
|
||||
page.getByRole('heading', { name: 'Comment Your JavaScript Code' })
|
||||
).toBeVisible();
|
||||
|
||||
await page.keyboard.press('e');
|
||||
await expect(page.getByLabel(editorPaneLabel)).toBeFocused();
|
||||
|
||||
Reference in New Issue
Block a user