mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
fix(e2e, playwright): resolved mobile test failures on notes.spec.ts (#52475)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
import translations from '../client/i18n/locales/english/translations.json';
|
||||
|
||||
const notesButtonLabel = translations.learn['editor-tabs'].notes;
|
||||
|
||||
test('User can see notes', async ({ page }) => {
|
||||
test('User can see notes', async ({ page, isMobile }) => {
|
||||
const noteContent = 'This is a test note';
|
||||
|
||||
await page.route(
|
||||
@@ -22,7 +22,10 @@ test('User can see notes', async ({ page }) => {
|
||||
await page.goto(
|
||||
'learn/2022/responsive-web-design/learn-html-by-building-a-cat-photo-app/step-30'
|
||||
);
|
||||
|
||||
await page.getByRole('button', { name: notesButtonLabel }).click();
|
||||
if (isMobile) {
|
||||
await page.getByRole('tab', { name: notesButtonLabel }).click();
|
||||
} else {
|
||||
await page.getByRole('button', { name: notesButtonLabel }).click();
|
||||
}
|
||||
await expect(page.getByText(noteContent)).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user