mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(e2e): stabilize editor test (#66565)
This commit is contained in:
+7
-8
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user