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 (#16661)

depa panjie purnama1730f33b8772
diff --git a/docs/src/test-pom-js.md b/docs/src/test-pom-js.md
index 9fecb220c7..288ce62f95 100644
--- a/docs/src/test-pom-js.md
+++ b/docs/src/test-pom-js.md
@@ -19,7 +19,7 @@ exports.PlaywrightDevPage = class PlaywrightDevPage {
constructor(page) {
this.page = page;
this.getStartedLink = page.locator('a', { hasText: 'Get started' });
- this.gettingStartedHeader = page.locator('h1', { hasText: 'Getting started' });
+ this.gettingStartedHeader = page.locator('h1', { hasText: 'Installation' });
this.pomLink = page.locator('li', { hasText: 'Playwright Test' }).locator('a', { hasText: 'Page Object Model' });
this.tocList = page.locator('article div.markdown ul > li > a');
}
@@ -54,7 +54,7 @@ export class PlaywrightDevPage {
constructor(page: Page) {
this.page = page;
this.getStartedLink = page.locator('a', { hasText: 'Get started' });
- this.gettingStartedHeader = page.locator('h1', { hasText: 'Getting started' });
+ this.gettingStartedHeader = page.locator('h1', { hasText: 'Installation' });
this.pomLink = page.locator('li', { hasText: 'Playwright Test' }).locator('a', { hasText: 'Page Object Model' });
this.tocList = page.locator('article div.markdown ul > li > a');
}
@@ -87,16 +87,14 @@ test('getting started should contain table of contents', async ({ page }) => {
await playwrightDev.goto();
await playwrightDev.getStarted();
await expect(playwrightDev.tocList).toHaveText([
- 'Installation',
- 'First test',
- 'Configuration file',
- 'Writing assertions',
- 'Using test fixtures',
- 'Using test hooks',
- 'VS Code extension',
- 'Command line',
- 'Configure NPM scripts',
- 'Release notes'
+ `How to install Playwright`,
+ `What's Installed`,
+ `How to run the example test`,
+ `How to open the HTML test report`,
+ `Write tests using web first assertions, page fixtures and locators`,
+ `Run single tests, multiple tests, headed mode`,
+ `Generate tests with Codegen`,
+ `See a trace of your tests`
]);
});
@@ -118,16 +116,14 @@ test('getting started should contain table of contents', async ({ page }) => {
await playwrightDev.goto();
await playwrightDev.getStarted();
await expect(playwrightDev.tocList).toHaveText([
- 'Installation',
- 'First test',
- 'Configuration file',
- 'Writing assertions',
- 'Using test fixtures',
- 'Using test hooks',
- 'VS Code extension',
- 'Command line',
- 'Configure NPM scripts',
- 'Release notes'
+ `How to install Playwright`,
+ `What's Installed`,
+ `How to run the example test`,
+ `How to open the HTML test report`,
+ `Write tests using web first assertions, page fixtures and locators`,
+ `Run single tests, multiple tests, headed mode`,
+ `Generate tests with Codegen`,
+ `See a trace of your tests`
]);
});