Skip to content

OE-1455: Set up Playwright#164

Merged
clarissarichard merged 5 commits intomainfrom
OE-1455/setup-playwright
Mar 14, 2025
Merged

OE-1455: Set up Playwright#164
clarissarichard merged 5 commits intomainfrom
OE-1455/setup-playwright

Conversation

@clarissarichard
Copy link
Copy Markdown
Collaborator

@clarissarichard clarissarichard commented Mar 13, 2025

This PR adds Playwright to the web-reader repo and creates a test to open the direct link to an epub and verify that the Back button is visible.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web-reader ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 14, 2025 3:47pm

Copy link
Copy Markdown
Collaborator

@samanthaandrews samanthaandrews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a few small changes. looks great!

//await expect(page.getByRole('link', { name: 'Back' })).toBeVisible(); // does not work
//await expect(page.getByRole('paragraph', { name: 'Back' })).toBeVisible(); // does not work
//await expect(page.getByText('Back')).toBeVisible(); // works but could be found in epub
await expect(page.getByLabel('Return to Homepage')).toBeVisible(); // works
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice getByLabel is good because it also tests that the site is accessible

Comment on lines +5 to +7
//await expect(page.getByRole('link', { name: 'Back' })).toBeVisible(); // does not work
//await expect(page.getByRole('paragraph', { name: 'Back' })).toBeVisible(); // does not work
//await expect(page.getByText('Back')).toBeVisible(); // works but could be found in epub
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just delete these 3 lines

import { test, expect } from '@playwright/test';

test('Open moby-epub3', async ({ page }) => {
await page.goto('http://localhost:1234/html/moby-epub3');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we can put http://localhost:1234 into the Playwright config file somewhere https://playwright.dev/docs/test-configuration

Copy link
Copy Markdown
Collaborator

@samanthaandrews samanthaandrews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@clarissarichard clarissarichard merged commit 4858ad4 into main Mar 14, 2025
3 checks passed
@clarissarichard clarissarichard deleted the OE-1455/setup-playwright branch March 14, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants