Skip to content

Commit

Permalink
feat(roll): roll to ToT Playwright (03-05-22) (microsoft#560)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed May 3, 2022
1 parent 60f8fa9 commit 3824c65
Show file tree
Hide file tree
Showing 131 changed files with 706 additions and 426 deletions.
35 changes: 35 additions & 0 deletions dotnet/docs/api/class-frame.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,45 @@ Returns whether the element is [visible](../actionability.mdx#visible). `selecto
## Frame.Locator(selector, options) {#frame-locator}
- `selector`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-option-selector"/> &#60;[string]&#62; A selector to use when resolving DOM element. See [working with selectors](../selectors.mdx) for more details.<a href="#frame-locator-option-selector" class="list-anchor">#</a>
- `options` &#60;`FrameLocatorOptions?`&#62;
- `Above`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-option-above"/> &#60;[Locator]?|Above?&#62; Matches elements that are above any of the elements matching the inner locator, at any horizontal position. Inner locator is queried against the same root as the outer one. More details in [layout selectors](../selectors.mdx#selecting-elements-based-on-layout) guide.<a href="#frame-locator-option-above" class="list-anchor">#</a>
- `Locator` &#60;[Locator]&#62; The inner locator.
- `MaxDistance` &#60;[double]?&#62; Maximum vertical distance between the elements in pixels, unlimited by default.

<br />

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- `Below`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-option-below"/> &#60;[Locator]?|Below?&#62; Matches elements that are below any of the elements matching the inner locator, at any horizontal position. Inner locator is queried against the same root as the outer one. More details in [layout selectors](../selectors.mdx#selecting-elements-based-on-layout) guide.<a href="#frame-locator-option-below" class="list-anchor">#</a>
- `Locator` &#60;[Locator]&#62; The inner locator.
- `MaxDistance` &#60;[double]?&#62; Maximum vertical distance between the elements in pixels, unlimited by default.

<br />

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- `Has`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-option-has"/> &#60;[Locator]?&#62; Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one. For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.<a href="#frame-locator-option-has" class="list-anchor">#</a>

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- `HasText`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-option-has-text"/> &#60;[string]?|[Regex]?&#62; Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches `<article><div>Playwright</div></article>`.<a href="#frame-locator-option-has-text" class="list-anchor">#</a>
- `LeftOf`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-option-left-of"/> &#60;[Locator]?|LeftOf?&#62; Matches elements that are to the left of any element matching the inner locator, at any vertical position. Inner locator is queried against the same root as the outer one. More details in [layout selectors](../selectors.mdx#selecting-elements-based-on-layout) guide.<a href="#frame-locator-option-left-of" class="list-anchor">#</a>
- `Locator` &#60;[Locator]&#62; The inner locator.
- `MaxDistance` &#60;[double]?&#62; Maximum horizontal distance between the elements in pixels, unlimited by default.

<br />

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- `Near`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-option-near"/> &#60;[Locator]?|Near?&#62; Matches elements that are near any of the elements matching the inner locator. Inner locator is queried against the same root as the outer one. More details in [layout selectors](../selectors.mdx#selecting-elements-based-on-layout) guide.<a href="#frame-locator-option-near" class="list-anchor">#</a>
- `Locator` &#60;[Locator]&#62; The inner locator.
- `MaxDistance` &#60;[double]?&#62; Maximum distance between the elements in pixels, 50 by default.

<br />

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- `RightOf`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-option-right-of"/> &#60;[Locator]?|RightOf?&#62; Matches elements that are to the right of any element matching the inner locator, at any vertical position. Inner locator is queried against the same root as the outer one. More details in [layout selectors](../selectors.mdx#selecting-elements-based-on-layout) guide.<a href="#frame-locator-option-right-of" class="list-anchor">#</a>
- `Locator` &#60;[Locator]&#62; The inner locator.
- `MaxDistance` &#60;[double]?&#62; Maximum horizontal distance between the elements in pixels, unlimited by default.

<br />

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-return"/> &#60;[Locator]&#62;<a href="#frame-locator-return" class="list-anchor">#</a>

The method returns an element locator that can be used to perform actions in the frame. Locator is resolved to the element immediately before performing an action, so a series of actions on the same locator can in fact be performed on different DOM elements. That would happen if the DOM structure between those actions has changed.
Expand Down
35 changes: 35 additions & 0 deletions dotnet/docs/api/class-framelocator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,45 @@ Returns locator to the last matching frame.
## FrameLocator.Locator(selector, options) {#frame-locator-locator}
- `selector`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-locator-option-selector"/> &#60;[string]&#62; A selector to use when resolving DOM element. See [working with selectors](../selectors.mdx) for more details.<a href="#frame-locator-locator-option-selector" class="list-anchor">#</a>
- `options` &#60;`FrameLocatorLocatorOptions?`&#62;
- `Above`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-locator-option-above"/> &#60;[Locator]?|Above?&#62; Matches elements that are above any of the elements matching the inner locator, at any horizontal position. Inner locator is queried against the same root as the outer one. More details in [layout selectors](../selectors.mdx#selecting-elements-based-on-layout) guide.<a href="#frame-locator-locator-option-above" class="list-anchor">#</a>
- `Locator` &#60;[Locator]&#62; The inner locator.
- `MaxDistance` &#60;[double]?&#62; Maximum vertical distance between the elements in pixels, unlimited by default.

<br />

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- `Below`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-locator-option-below"/> &#60;[Locator]?|Below?&#62; Matches elements that are below any of the elements matching the inner locator, at any horizontal position. Inner locator is queried against the same root as the outer one. More details in [layout selectors](../selectors.mdx#selecting-elements-based-on-layout) guide.<a href="#frame-locator-locator-option-below" class="list-anchor">#</a>
- `Locator` &#60;[Locator]&#62; The inner locator.
- `MaxDistance` &#60;[double]?&#62; Maximum vertical distance between the elements in pixels, unlimited by default.

<br />

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- `Has`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-locator-option-has"/> &#60;[Locator]?&#62; Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one. For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.<a href="#frame-locator-locator-option-has" class="list-anchor">#</a>

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- `HasText`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-locator-option-has-text"/> &#60;[string]?|[Regex]?&#62; Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches `<article><div>Playwright</div></article>`.<a href="#frame-locator-locator-option-has-text" class="list-anchor">#</a>
- `LeftOf`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-locator-option-left-of"/> &#60;[Locator]?|LeftOf?&#62; Matches elements that are to the left of any element matching the inner locator, at any vertical position. Inner locator is queried against the same root as the outer one. More details in [layout selectors](../selectors.mdx#selecting-elements-based-on-layout) guide.<a href="#frame-locator-locator-option-left-of" class="list-anchor">#</a>
- `Locator` &#60;[Locator]&#62; The inner locator.
- `MaxDistance` &#60;[double]?&#62; Maximum horizontal distance between the elements in pixels, unlimited by default.

<br />

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- `Near`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-locator-option-near"/> &#60;[Locator]?|Near?&#62; Matches elements that are near any of the elements matching the inner locator. Inner locator is queried against the same root as the outer one. More details in [layout selectors](../selectors.mdx#selecting-elements-based-on-layout) guide.<a href="#frame-locator-locator-option-near" class="list-anchor">#</a>
- `Locator` &#60;[Locator]&#62; The inner locator.
- `MaxDistance` &#60;[double]?&#62; Maximum distance between the elements in pixels, 50 by default.

<br />

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- `RightOf`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-locator-option-right-of"/> &#60;[Locator]?|RightOf?&#62; Matches elements that are to the right of any element matching the inner locator, at any vertical position. Inner locator is queried against the same root as the outer one. More details in [layout selectors](../selectors.mdx#selecting-elements-based-on-layout) guide.<a href="#frame-locator-locator-option-right-of" class="list-anchor">#</a>
- `Locator` &#60;[Locator]&#62; The inner locator.
- `MaxDistance` &#60;[double]?&#62; Maximum horizontal distance between the elements in pixels, unlimited by default.

<br />

Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="frame-locator-locator-return"/> &#60;[Locator]&#62;<a href="#frame-locator-locator-return" class="list-anchor">#</a>

The method finds an element matching the specified selector in the FrameLocator's subtree.
Expand Down

0 comments on commit 3824c65

Please sign in to comment.