fix(e2e): stabilize editor test (#66565)

This commit is contained in:
Huyen Nguyen
2026-03-20 09:59:57 +07:00
committed by GitHub
parent ac69d0a4c7
commit 922e133013
+7 -8
View File
@@ -17,7 +17,7 @@ const setTheme = async (
});
const testPage =
'/learn/2022/responsive-web-design/learn-html-by-building-a-cat-photo-app/step-3';
'/learn/responsive-web-design-v9/workshop-cat-photo-app/step-3';
test.describe('Editor Component', () => {
test('should allow the user to insert text', async ({ page, isMobile }) => {
@@ -36,9 +36,7 @@ test.describe('Python Terminal', () => {
browserName,
isMobile
}) => {
await page.goto(
'learn/scientific-computing-with-python/learn-string-manipulation-by-building-a-cipher/step-2'
);
await page.goto('/learn/python-v9/workshop-caesar-cipher/step-2');
// First enter code that does not generate output
await focusEditor({ page, isMobile });
@@ -72,9 +70,7 @@ test.describe('Python Terminal', () => {
isMobile,
browserName
}) => {
await page.goto(
'learn/scientific-computing-with-python/learn-string-manipulation-by-building-a-cipher/step-2'
);
await page.goto('learn/python-v9/workshop-caesar-cipher/step-2');
await focusEditor({ page, isMobile });
await clearEditor({ page, browserName, isMobile });
@@ -173,7 +169,10 @@ test.describe('Editor theme if the system theme is light', () => {
await setTheme(request, 'default');
await page.goto(testPage);
// Open the nav menu and toggle the theme
await page.getByRole('button', { name: 'Menu' }).click();
const menuButton = page.getByRole('button', { name: 'Menu' });
await menuButton.click();
const menu = page.getByRole('list', { name: 'Menu' });
await expect(menu).toBeVisible();
const toggle = page.getByRole('button', { name: 'Night Mode' });
await expect(toggle).toBeVisible();