fix(e2e, playwright): stabilize page navigation in hotkeys.spec.ts (#52236)

This commit is contained in:
Huyen Nguyen
2023-11-07 11:50:13 +05:30
committed by GitHub
parent c597de022a
commit 6678963b1f
+8
View File
@@ -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();