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.getStartedLink = page.locator('a', { hasText: 'Get started' });
this.gettingStartedHeader = page.locator('h1', { hasText: 'Getting started' }); this.gettingStartedHeader = page.locator('h1', { hasText: 'Getting started' });
this.pomLink = page.locator('li', { hasText: 'Playwright Test' }).locator('a', { hasText: 'Page Object Model' }); 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() { async goto() {
@ -56,7 +56,7 @@ export class PlaywrightDevPage {
this.getStartedLink = page.locator('a', { hasText: 'Get started' }); this.getStartedLink = page.locator('a', { hasText: 'Get started' });
this.gettingStartedHeader = page.locator('h1', { hasText: 'Getting started' }); this.gettingStartedHeader = page.locator('h1', { hasText: 'Getting started' });
this.pomLink = page.locator('li', { hasText: 'Playwright Test' }).locator('a', { hasText: 'Page Object Model' }); 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() { async goto() {
@ -93,6 +93,7 @@ test('getting started should contain table of contents', async ({ page }) => {
'Writing assertions', 'Writing assertions',
'Using test fixtures', 'Using test fixtures',
'Using test hooks', 'Using test hooks',
'VS Code extension',
'Command line', 'Command line',
'Configure NPM scripts', 'Configure NPM scripts',
'Release notes' 'Release notes'
@ -123,6 +124,7 @@ test('getting started should contain table of contents', async ({ page }) => {
'Writing assertions', 'Writing assertions',
'Using test fixtures', 'Using test fixtures',
'Using test hooks', 'Using test hooks',
'VS Code extension',
'Command line', 'Command line',
'Configure NPM scripts', 'Configure NPM scripts',
'Release notes' 'Release notes'