Skip to content
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

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

arjunattam
Copy link
Contributor

@arjunattam arjunattam commented Aug 11, 2020

  • 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() {
Copy link
Contributor

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) {
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor Author

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!

@arjunattam arjunattam merged commit 9375cc6 into microsoft:master Aug 11, 2020
@arjunattam arjunattam deleted the pom-docs branch August 11, 2020 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants