Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs: update page object model example (#14917)

Jye Rueydb9ff4b7c97a
diff --git a/docs/src/test-pom-js.md b/docs/src/test-pom-js.md
index 99ddc19e8d..9fecb220c7 100644
--- a/docs/src/test-pom-js.md
+++ b/docs/src/test-pom-js.md
@@ -21,7 +21,7 @@ exports.PlaywrightDevPage = class PlaywrightDevPage {
this.getStartedLink = page.locator('a', { hasText: 'Get started' });
this.gettingStartedHeader = page.locator('h1', { hasText: 'Getting started' });
this.pomLink = page.locator('li', { hasText: 'Playwright Test' }).locator('a', { hasText: 'Page Object Model' });
- this.tocList = page.locator('article ul > li > a');
+ this.tocList = page.locator('article div.markdown ul > li > a');
}
async goto() {
@@ -56,7 +56,7 @@ export class PlaywrightDevPage {
this.getStartedLink = page.locator('a', { hasText: 'Get started' });
this.gettingStartedHeader = page.locator('h1', { hasText: 'Getting started' });
this.pomLink = page.locator('li', { hasText: 'Playwright Test' }).locator('a', { hasText: 'Page Object Model' });
- this.tocList = page.locator('article ul > li > a');
+ this.tocList = page.locator('article div.markdown ul > li > a');
}
async goto() {
@@ -93,6 +93,7 @@ test('getting started should contain table of contents', async ({ page }) => {
'Writing assertions',
'Using test fixtures',
'Using test hooks',
+ 'VS Code extension',
'Command line',
'Configure NPM scripts',
'Release notes'
@@ -123,6 +124,7 @@ test('getting started should contain table of contents', async ({ page }) => {
'Writing assertions',
'Using test fixtures',
'Using test hooks',
+ 'VS Code extension',
'Command line',
'Configure NPM scripts',
'Release notes'