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:
Rahul Suresh
2023-12-06 09:54:59 -06:00
committed by GitHub
parent 061e40328e
commit f24b93599d
2 changed files with 8 additions and 4 deletions
+7 -2
View File
@@ -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([