Skip to content

Commit

Permalink
Merge pull request #1892 from dscho/fix-playwright-test-on-iPhone
Browse files Browse the repository at this point in the history
playwright(book): let the tests pass on small screens
  • Loading branch information
ttaylorr authored Oct 1, 2024
2 parents 58628f3 + bdc9b5e commit 425f204
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/git-scm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ test('book', async ({ page }) => {
await expect(chaptersDropdown.locator('.active')).toHaveCount(1)

// Navigate to the French translation
if (await page.evaluate(() => matchMedia('(max-width: 940px)').matches)) {
// On small screens, the links to the translated versions of the ProGit book
// are hidden by default, and have to be "un-hidden" by clicking on the
// sidebar button first.
await page.locator('.sidebar-btn').click();
}
await page.getByRole('link', { name: 'Français' }).click()
await expect(page).toHaveURL(/book\/fr/)
await expect(page.getByRole('link', { name: 'Démarrage rapide' })).toBeVisible()
Expand Down

0 comments on commit 425f204

Please sign in to comment.