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

Create the docs for the locator api for xk6-browser #743

Merged

Conversation

ankur22
Copy link
Contributor

@ankur22 ankur22 commented Jul 27, 2022

Closes: grafana/xk6-browser#459

This change documents all the methods for the locator api for xk6-browser. It was tested against grafana/xk6-browser@dbede12. Several issues were also raised that need to be resolved. Testing was only done on a Mac, and not on a Windows or Linux based system.

@ankur22 ankur22 requested a review from imiric July 27, 2022 11:28
@ankur22 ankur22 force-pushed the docs/459-xk6-browser-locator-class-docs branch 2 times, most recently from b5779c5 to 8b9912d Compare July 27, 2022 16:40
Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! Just left some minor suggestions.

Also, I think we need examples, at least for some of the trickier methods like click(), selectOption(), type(), etc. We can follow Playwright's lead here and not include a fully working script, but just an example usage of each method.

We might want to add a full script to the main Locator page though. Maybe one of the scripts that @inancgumus added to the xk6-browser repo?

@@ -1437,6 +1437,8 @@ const createRedirects = ({ actions }) => {
'/javascript-api/xk6-browser/jshandle/',
'/javascript-api/k6-x-browser/keyboard/':
'/javascript-api/xk6-browser/keyboard/',
'/javascript-api/k6-x-browser/locator/':
'/javascript-api/xk6-browser/locator/',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's silly that we need these redirects for every xk6-browser page 😕 These are not some unique pages, so we should try to get rid of this (not in this PR, of course).

... Wait, we also have this for some k6 JS API pages. 😦

@ppcano Any ideas why this is needed? Can we change the directory-to-URL mapping instead?

@ankur22 ankur22 force-pushed the docs/459-xk6-browser-locator-class-docs branch 3 times, most recently from 3ca9b89 to 4afb73c Compare July 29, 2022 08:55
ankur22 added a commit that referenced this pull request Jul 29, 2022
ankur22 added a commit that referenced this pull request Jul 29, 2022
ankur22 added a commit that referenced this pull request Aug 1, 2022
ankur22 added a commit that referenced this pull request Aug 1, 2022
ankur22 added a commit that referenced this pull request Aug 1, 2022
@ankur22 ankur22 force-pushed the docs/459-xk6-browser-locator-class-docs branch from 8d0fc6b to 2a3d1d6 Compare August 1, 2022 10:34
@ankur22 ankur22 requested a review from imiric August 1, 2022 10:53
ankur22 added a commit that referenced this pull request Aug 1, 2022
ankur22 added a commit that referenced this pull request Aug 1, 2022
Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Just a couple minor suggestions, and maybe clean up the history before merging if you have time. Not necessarily squashing it into a single commit, though that might be OK in this case.

Great job with the examples!

ankur22 added a commit that referenced this pull request Aug 2, 2022
ankur22 added a commit that referenced this pull request Aug 2, 2022
ankur22 added a commit that referenced this pull request Aug 2, 2022
ankur22 added a commit that referenced this pull request Aug 2, 2022
ankur22 added a commit that referenced this pull request Aug 2, 2022
ankur22 added a commit that referenced this pull request Aug 2, 2022
@ankur22 ankur22 force-pushed the docs/459-xk6-browser-locator-class-docs branch from 19d2a60 to 5ed89cc Compare August 2, 2022 10:31
ankur22 added a commit that referenced this pull request Aug 2, 2022
ankur22 added a commit that referenced this pull request Aug 2, 2022
ankur22 added a commit that referenced this pull request Aug 2, 2022
ankur22 added a commit that referenced this pull request Aug 2, 2022
ankur22 added a commit that referenced this pull request Aug 2, 2022
ankur22 added a commit that referenced this pull request Aug 2, 2022
@ankur22 ankur22 force-pushed the docs/459-xk6-browser-locator-class-docs branch 2 times, most recently from cd978b0 to 6775f46 Compare August 2, 2022 12:00
This adds the locator docs for xk6-browser, and all the options that go
along with it. It only documents the APIs that work or have known
issues.

Closes: grafana/xk6-browser#459
@ankur22 ankur22 force-pushed the docs/459-xk6-browser-locator-class-docs branch from 6775f46 to 573258c Compare August 2, 2022 12:01
@ankur22 ankur22 merged commit 70a5ec5 into docs/582-xk6-browser Aug 2, 2022
@ankur22 ankur22 deleted the docs/459-xk6-browser-locator-class-docs branch August 2, 2022 12:02
@inancgumus inancgumus added the Area: browser The browser module label Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: browser The browser module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants