diff --git a/e2e/notes.spec.ts b/e2e/notes.spec.ts index 168a2100c86..9bc571d0306 100644 --- a/e2e/notes.spec.ts +++ b/e2e/notes.spec.ts @@ -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(); });