mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(e2e, playwright): resolved mobile test failure on action-row.spec.ts (#52446)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { test, expect, type Page, type Locator } from '@playwright/test';
|
||||
import translations from '../client/i18n/locales/english/translations.json';
|
||||
|
||||
const challengeButtons = [
|
||||
'Instructions',
|
||||
@@ -25,7 +26,9 @@ function getTabsRowLocator(page: Page): Locator {
|
||||
|
||||
test('Action row buttons are visible', async ({ isMobile, page }) => {
|
||||
const previewPaneButton = page.getByTestId('preview-pane-button');
|
||||
const previewPortalButton = page.getByTestId('preview-portal-button');
|
||||
const previewPortalButton = page.getByRole('button', {
|
||||
name: translations.aria['move-preview-to-new-window']
|
||||
});
|
||||
const actionRow = getActionRowLocator(page);
|
||||
const tabsRow = getTabsRowLocator(page);
|
||||
|
||||
@@ -106,7 +109,9 @@ test('Clicking Preview Pane button hides preview', async ({
|
||||
test('Clicking Preview Portal button opens the preview in a new tab', async ({
|
||||
page
|
||||
}) => {
|
||||
const previewPortalButton = page.getByTestId('preview-portal-button');
|
||||
const previewPortalButton = page.getByRole('button', {
|
||||
name: translations.aria['move-preview-to-new-window']
|
||||
});
|
||||
const browserContext = page.context();
|
||||
|
||||
const [newPage] = await Promise.all([
|
||||
|
||||
Reference in New Issue
Block a user