Skip to content

Commit

Permalink
feat(roll): roll to ToT Playwright (02-06-22) (microsoft#583)
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
playwrightmachine and github-actions[bot] authored Jun 2, 2022
1 parent 89e1576 commit ba95543
Show file tree
Hide file tree
Showing 6 changed files with 272 additions and 5 deletions.
1 change: 1 addition & 0 deletions dotnet/docs/api/class-route.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ await page.RouteAsync("**/*", route =>
- `ContentType`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="route-fulfill-option-content-type"/> &#60;[string]?&#62; If set, equals to setting `Content-Type` response header.<a href="#route-fulfill-option-content-type" class="list-anchor">#</a>
- `Headers`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="route-fulfill-option-headers"/> &#60;[IDictionary]?<[string], [string]>&#62; Response headers. Header values will be converted to a string.<a href="#route-fulfill-option-headers" class="list-anchor">#</a>
- `Path`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="route-fulfill-option-path"/> &#60;[string]?&#62; File path to respond with. The content type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory.<a href="#route-fulfill-option-path" class="list-anchor">#</a>
- `Response`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="route-fulfill-option-response"/> &#60;[APIResponse]?&#62; [APIResponse] to fulfill route's request with. Individual fields of the response (such as headers) can be overridden using fulfill options.<a href="#route-fulfill-option-response" class="list-anchor">#</a>
- `Status`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="route-fulfill-option-status"/> &#60;[int]?&#62; Response status code, defaults to `200`.<a href="#route-fulfill-option-status" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="route-fulfill-return"/> &#60;[void]&#62;<a href="#route-fulfill-return" class="list-anchor">#</a>

Expand Down
4 changes: 3 additions & 1 deletion dotnet/docs/test-assertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ await Expect(locator).ToBeVisibleAsync();
## Expect(Locator).ToContainTextAsync(expected, options) {#locator-assertions-to-contain-text}
- `expected`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-expected"/> &#60;[string]|[Regex]|[IEnumerable]<[string]>|[IEnumerable]<[Regex]>&#62; Expected substring or RegExp or a list of those.<a href="#locator-assertions-to-contain-text-option-expected" class="list-anchor">#</a>
- `options` &#60;`LocatorAssertionsToContainTextOptions?`&#62;
- `IgnoreCase`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-ignore-case"/> &#60;[bool]?&#62; Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified.<a href="#locator-assertions-to-contain-text-option-ignore-case" class="list-anchor">#</a>
- `Timeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-timeout"/> &#60;[double]?&#62; Time to retry the assertion for.<a href="#locator-assertions-to-contain-text-option-timeout" class="list-anchor">#</a>
- `UseInnerText`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-use-inner-text"/> &#60;[bool]?&#62; Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.<a href="#locator-assertions-to-contain-text-option-use-inner-text" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-contain-text-return" class="list-anchor">#</a>
Expand Down Expand Up @@ -273,6 +274,7 @@ await Expect(locator).ToHaveJSPropertyAsync("loaded", true);
## Expect(Locator).ToHaveTextAsync(expected, options) {#locator-assertions-to-have-text}
- `expected`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-expected"/> &#60;[string]|[Regex]|[IEnumerable]<[string]>|[IEnumerable]<[Regex]>&#62; Expected substring or RegExp or a list of those.<a href="#locator-assertions-to-have-text-option-expected" class="list-anchor">#</a>
- `options` &#60;`LocatorAssertionsToHaveTextOptions?`&#62;
- `IgnoreCase`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-ignore-case"/> &#60;[bool]?&#62; Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified.<a href="#locator-assertions-to-have-text-option-ignore-case" class="list-anchor">#</a>
- `Timeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-timeout"/> &#60;[double]?&#62; Time to retry the assertion for.<a href="#locator-assertions-to-have-text-option-timeout" class="list-anchor">#</a>
- `UseInnerText`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-use-inner-text"/> &#60;[bool]?&#62; Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.<a href="#locator-assertions-to-have-text-option-use-inner-text" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-have-text-return" class="list-anchor">#</a>
Expand All @@ -293,7 +295,7 @@ await Expect(locator).toHaveTextAsync(new string[]{ "Text 1", "Text 2", "Text 3"
```

## Expect(Locator).ToHaveValueAsync(value, options) {#locator-assertions-to-have-value}
- `value`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-option-value"/> &#60;[string]|[Regex]&#62; Expected value.<a href="#locator-assertions-to-have-value-option-value" class="list-anchor">#</a>
- `value`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-option-value"/> &#60;[string]|[Regex]|[IEnumerable]<[string]|[Regex]>&#62; Expected value. A list of expected values can be used if the Locator is a `select` element with the `multiple` attribute.<a href="#locator-assertions-to-have-value-option-value" class="list-anchor">#</a>
- `options` &#60;`LocatorAssertionsToHaveValueOptions?`&#62;
- `Timeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-option-timeout"/> &#60;[double]?&#62; Time to retry the assertion for.<a href="#locator-assertions-to-have-value-option-timeout" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-have-value-return" class="list-anchor">#</a>
Expand Down
4 changes: 3 additions & 1 deletion java/docs/test-assertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ assertThat(page.locator(".my-element")).isVisible();
## assertThat(locator).containsText(expected[, options]) {#locator-assertions-to-contain-text}
- `expected`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-expected"/> &#60;[String]|[Pattern]|[String]&#91;&#93;|[Pattern]&#91;&#93;&#62; Expected substring or RegExp or a list of those.<a href="#locator-assertions-to-contain-text-option-expected" class="list-anchor">#</a>
- `options` &#60;`LocatorAssertions.ContainsTextOptions`&#62;
- `setIgnoreCase`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-ignore-case"/> &#60;[boolean]&#62; Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified.<a href="#locator-assertions-to-contain-text-option-ignore-case" class="list-anchor">#</a>
- `setTimeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-timeout"/> &#60;[double]&#62; Time to retry the assertion for.<a href="#locator-assertions-to-contain-text-option-timeout" class="list-anchor">#</a>
- `setUseInnerText`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-use-inner-text"/> &#60;[boolean]&#62; Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.<a href="#locator-assertions-to-contain-text-option-use-inner-text" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-contain-text-return" class="list-anchor">#</a>
Expand Down Expand Up @@ -252,6 +253,7 @@ assertThat(page.locator("input")).hasJSProperty("loaded", true);
## assertThat(locator).hasText(expected[, options]) {#locator-assertions-to-have-text}
- `expected`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-expected"/> &#60;[String]|[Pattern]|[String]&#91;&#93;|[Pattern]&#91;&#93;&#62; Expected substring or RegExp or a list of those.<a href="#locator-assertions-to-have-text-option-expected" class="list-anchor">#</a>
- `options` &#60;`LocatorAssertions.HasTextOptions`&#62;
- `setIgnoreCase`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-ignore-case"/> &#60;[boolean]&#62; Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified.<a href="#locator-assertions-to-have-text-option-ignore-case" class="list-anchor">#</a>
- `setTimeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-timeout"/> &#60;[double]&#62; Time to retry the assertion for.<a href="#locator-assertions-to-have-text-option-timeout" class="list-anchor">#</a>
- `setUseInnerText`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-use-inner-text"/> &#60;[boolean]&#62; Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.<a href="#locator-assertions-to-have-text-option-use-inner-text" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-have-text-return" class="list-anchor">#</a>
Expand All @@ -270,7 +272,7 @@ assertThat(page.locator("list > .component")).hasText(new String[] {"Text 1", "T
```

## assertThat(locator).hasValue(value[, options]) {#locator-assertions-to-have-value}
- `value`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-option-value"/> &#60;[String]|[Pattern]&#62; Expected value.<a href="#locator-assertions-to-have-value-option-value" class="list-anchor">#</a>
- `value`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-option-value"/> &#60;[String]|[Pattern]|[List]<[String]|[Pattern]>&#62; Expected value. A list of expected values can be used if the Locator is a `select` element with the `multiple` attribute.<a href="#locator-assertions-to-have-value-option-value" class="list-anchor">#</a>
- `options` &#60;`LocatorAssertions.HasValueOptions`&#62;
- `setTimeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-option-timeout"/> &#60;[double]&#62; Time to retry the assertion for.<a href="#locator-assertions-to-have-value-option-timeout" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-have-value-return" class="list-anchor">#</a>
Expand Down
4 changes: 3 additions & 1 deletion nodejs/docs/test-assertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ await expect(locator).toBeVisible();
## expect(locator).toContainText(expected[, options]) {#locator-assertions-to-contain-text}
- `expected`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-expected"/> &#60;[string]|[RegExp]|[Array]<[string]|[RegExp]>&#62; Expected substring or RegExp or a list of those.<a href="#locator-assertions-to-contain-text-option-expected" class="list-anchor">#</a>
- `options?` &#60;[Object]&#62;
- `ignoreCase?`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-ignore-case"/> &#60;[boolean]&#62; Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified.<a href="#locator-assertions-to-contain-text-option-ignore-case" class="list-anchor">#</a>
- `timeout?`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-timeout"/> &#60;[number]&#62; Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.<a href="#locator-assertions-to-contain-text-option-timeout" class="list-anchor">#</a>
- `useInnerText?`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-option-use-inner-text"/> &#60;[boolean]&#62; Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.<a href="#locator-assertions-to-contain-text-option-use-inner-text" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-contain-text-return"/> &#60;[Promise]<[void]>&#62;<a href="#locator-assertions-to-contain-text-return" class="list-anchor">#</a>
Expand Down Expand Up @@ -433,6 +434,7 @@ await expect(locator).toHaveScreenshot();
## expect(locator).toHaveText(expected[, options]) {#locator-assertions-to-have-text}
- `expected`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-expected"/> &#60;[string]|[RegExp]|[Array]<[string]|[RegExp]>&#62; Expected substring or RegExp or a list of those.<a href="#locator-assertions-to-have-text-option-expected" class="list-anchor">#</a>
- `options?` &#60;[Object]&#62;
- `ignoreCase?`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-ignore-case"/> &#60;[boolean]&#62; Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified.<a href="#locator-assertions-to-have-text-option-ignore-case" class="list-anchor">#</a>
- `timeout?`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-timeout"/> &#60;[number]&#62; Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.<a href="#locator-assertions-to-have-text-option-timeout" class="list-anchor">#</a>
- `useInnerText?`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-option-use-inner-text"/> &#60;[boolean]&#62; Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.<a href="#locator-assertions-to-have-text-option-use-inner-text" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-text-return"/> &#60;[Promise]<[void]>&#62;<a href="#locator-assertions-to-have-text-return" class="list-anchor">#</a>
Expand All @@ -453,7 +455,7 @@ await expect(locator).toHaveText(['Text 1', 'Text 2', 'Text 3']);
```
## expect(locator).toHaveValue(value[, options]) {#locator-assertions-to-have-value}
- `value`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-option-value"/> &#60;[string]|[RegExp]&#62; Expected value.<a href="#locator-assertions-to-have-value-option-value" class="list-anchor">#</a>
- `value`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-option-value"/> &#60;[string]|[RegExp]|[Array]<[string]|[RegExp]>&#62; Expected value. A list of expected values can be used if the Locator is a `select` element with the `multiple` attribute.<a href="#locator-assertions-to-have-value-option-value" class="list-anchor">#</a>
- `options?` &#60;[Object]&#62;
- `timeout?`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-option-timeout"/> &#60;[number]&#62; Time to retry the assertion for. Defaults to `timeout` in `TestConfig.expect`.<a href="#locator-assertions-to-have-value-option-timeout" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-value-return"/> &#60;[Promise]<[void]>&#62;<a href="#locator-assertions-to-have-value-return" class="list-anchor">#</a>
Expand Down
Loading

0 comments on commit ba95543

Please sign in to comment.