docs: update page object model example (#14917)

This commit is contained in:
Jye Ruey 2022-06-21 11:08:57 +09:00 committed by GitHub
parent 21c510ee0d
commit db9ff4b7c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'