-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: introduce docs for page object models #3391
Conversation
arjunattam
commented
Aug 11, 2020
•
edited
Loading
edited
- Added docs for page object models, since we've seen interest on it from users.
- Also added a new section to docs called "tutorials" to complement "guides". While guides focus on specific actions (like input or console logs), tutorials will cover use-cases/scenarios. Name suggestions welcome!
docs/pom.md
Outdated
constructor(page) { | ||
this.page = page; | ||
} | ||
async navigate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async goto()
docs/pom.md
Outdated
async navigate() { | ||
await this.page.goto('https://bing.com'); | ||
} | ||
async fill(text) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async search(text) {
await this.page.fill('[aria-label="Enter your search term"]', text);
await this.page.keyboard.press('Enter');
}
docs/pom.md
Outdated
Page objects can then be used inside a test. | ||
|
||
```js | ||
// in search.spec.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment hints that we see a test file, but content does not. Maybe just a short snippet for now, without requires/launch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Thanks for the review!