Skip to content

Commit

Permalink
feat(roll): roll to ToT Playwright (19-09-22) (microsoft#782)
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 Sep 19, 2022
1 parent c39bd41 commit acbc70d
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 235 deletions.
27 changes: 0 additions & 27 deletions dotnet/docs/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,6 @@ title: "Release notes"
toc_max_heading_level: 2
---

## Version 1.26

### Assertions
- [Expect(Locator).ToHaveAttributeAsync(name, options)](/test-assertions.mdx#locator-assertions-to-have-attribute-2) can now be used for asserting attribute existence.
- New option `Enabled` for [Expect(Locator).ToBeEnabledAsync(options)](/test-assertions.mdx#locator-assertions-to-be-enabled).
- [Expect(Locator).ToHaveTextAsync(expected, options)](/test-assertions.mdx#locator-assertions-to-have-text) now pierces open shadow roots.
- New option `Editable` for [Expect(Locator).ToBeEditableAsync(options)](/test-assertions.mdx#locator-assertions-to-be-editable).
- New option `Visible` for [Expect(Locator).ToBeVisibleAsync(options)](/test-assertions.mdx#locator-assertions-to-be-visible).
- [Expect(ApiResponse).ToBeOKAsync()](/test-assertions.mdx#api-response-assertions-to-be-ok) is now available.

### Other highlights
- New option `MaxRedirects` for [ApiRequestContext.GetAsync(url, options)](/api/class-apirequestcontext.mdx#api-request-context-get) and others to limit redirect count.
- Codegen now supports NUnit and MSTest frameworks.
- ASP .NET is now supported.

### Behavior Change

A bunch of Playwright APIs already support the `WaitUntil: WaitUntilState.DOMContentLoaded` option. For example:

```csharp
await Page.GotoAsync("https://playwright.dev", new() { WaitUntil = WaitUntilState.DOMContentLoaded });
```

Prior to 1.26, this would wait for all iframes to fire the `DOMContentLoaded` event.

To align with web specification, the `WaitUntilState.DOMContentLoaded` value only waits for the target frame to fire the `'DOMContentLoaded'` event. Use `WaitUntil: WaitUntilState.Load` to wait for all iframes.

## Version 1.25

### New .runsettings file support
Expand Down
34 changes: 8 additions & 26 deletions dotnet/docs/test-assertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ By default, the timeout for assertions is set to 5 seconds.
- [Expect(Locator).ToBeHiddenAsync(options)](/test-assertions.mdx#locator-assertions-to-be-hidden)
- [Expect(Locator).ToBeVisibleAsync(options)](/test-assertions.mdx#locator-assertions-to-be-visible)
- [Expect(Locator).ToContainTextAsync(expected, options)](/test-assertions.mdx#locator-assertions-to-contain-text)
- [Expect(Locator).ToHaveAttributeAsync(name, value, options)](/test-assertions.mdx#locator-assertions-to-have-attribute-1)
- [Expect(Locator).ToHaveAttributeAsync(name, options)](/test-assertions.mdx#locator-assertions-to-have-attribute-2)
- [Expect(Locator).ToHaveAttributeAsync(name, value, options)](/test-assertions.mdx#locator-assertions-to-have-attribute)
- [Expect(Locator).ToHaveClassAsync(expected, options)](/test-assertions.mdx#locator-assertions-to-have-class)
- [Expect(Locator).ToHaveCountAsync(count, options)](/test-assertions.mdx#locator-assertions-to-have-count)
- [Expect(Locator).ToHaveCSSAsync(name, value, options)](/test-assertions.mdx#locator-assertions-to-have-css)
Expand Down Expand Up @@ -244,40 +243,23 @@ await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Some 33"
await Expect(Page.Locator("ul")).ToContainTextAsync(new string[] {"Text 3"});
```

## Expect(Locator).ToHaveAttributeAsync(name, value, options) {#locator-assertions-to-have-attribute-1}
## Expect(Locator).ToHaveAttributeAsync(name, value, options) {#locator-assertions-to-have-attribute}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.18</font>
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font>

- `name`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-1-option-name"/> &#60;[string]&#62; Attribute name.<a href="#locator-assertions-to-have-attribute-1-option-name" class="list-anchor">#</a>
- `value`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-1-option-value"/> &#60;[string]|[Regex]&#62; Expected attribute value.<a href="#locator-assertions-to-have-attribute-1-option-value" class="list-anchor">#</a>
- `name`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-option-name"/> &#60;[string]&#62; Attribute name. <font size="2">Added in: v1.18</font><a href="#locator-assertions-to-have-attribute-option-name" class="list-anchor">#</a>
- `value`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-option-value"/> &#60;[string]|[Regex]&#62; Expected attribute value. <font size="2">Added in: v1.18</font><a href="#locator-assertions-to-have-attribute-option-value" class="list-anchor">#</a>
- `options` &#60;`LocatorAssertionsToHaveAttributeOptions?`&#62;
- `Timeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-1-option-timeout"/> &#60;[double]?&#62; Time to retry the assertion for.<a href="#locator-assertions-to-have-attribute-1-option-timeout" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-1-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-have-attribute-1-return" class="list-anchor">#</a>
- `Timeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-option-timeout"/> &#60;[double]?&#62; Time to retry the assertion for. <font size="2">Added in: v1.18</font><a href="#locator-assertions-to-have-attribute-option-timeout" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-have-attribute-return" class="list-anchor">#</a>

Ensures the [Locator] points to an element with given attribute value.
Ensures the [Locator] points to an element with given attribute.

```csharp
var locator = Page.Locator("input");
await Expect(locator).ToHaveAttributeAsync("type", "text");
```

## Expect(Locator).ToHaveAttributeAsync(name, options) {#locator-assertions-to-have-attribute-2}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.26</font>

- `name`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-2-option-name"/> &#60;[string]&#62; Attribute name.<a href="#locator-assertions-to-have-attribute-2-option-name" class="list-anchor">#</a>
- `options` &#60;`LocatorAssertionsToHaveAttributeOptions?`&#62;
- `Timeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-2-option-timeout"/> &#60;[double]?&#62; Time to retry the assertion for.<a href="#locator-assertions-to-have-attribute-2-option-timeout" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-2-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-have-attribute-2-return" class="list-anchor">#</a>

Ensures the [Locator] points to an element with given attribute. The method will assert attribute presence.

```csharp
var locator = Page.Locator("input");
await Expect(locator).ToHaveAttributeAsync("disabled");
await Expect(locator).Not.ToHaveAttributeAsync("open");
```

## Expect(Locator).ToHaveClassAsync(expected, options) {#locator-assertions-to-have-class}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font>
Expand Down
21 changes: 0 additions & 21 deletions java/docs/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,6 @@ title: "Release notes"
toc_max_heading_level: 2
---

## Version 1.26

### Assertions
- [assertThat(locator).hasAttribute(name[, options])](/test-assertions.mdx#locator-assertions-to-have-attribute-2) can now be used for asserting attribute existence.
- New option `enabled` for [assertThat(locator).isEnabled([options])](/test-assertions.mdx#locator-assertions-to-be-enabled).
- [assertThat(locator).hasText(expected[, options])](/test-assertions.mdx#locator-assertions-to-have-text) now pierces open shadow roots.
- New option `editable` for [assertThat(locator).isEditable([options])](/test-assertions.mdx#locator-assertions-to-be-editable).
- New option `visible` for [assertThat(locator).isVisible([options])](/test-assertions.mdx#locator-assertions-to-be-visible).

### Other highlights
- New option `setMaxRedirects` for [APIRequestContext.get(url[, options])](/api/class-apirequestcontext.mdx#api-request-context-get) and others to limit redirect count.
- Docker images are now using OpenJDK 17.

### Behavior Change

A bunch of Playwright APIs already support the `setWaitUntil(WaitUntilState.DOMCONTENTLOADED)` option. For example:

Prior to 1.26, this would wait for all iframes to fire the `DOMContentLoaded` event.

To align with web specification, the `WaitUntilState.DOMCONTENTLOADED` value only waits for the target frame to fire the `'DOMContentLoaded'` event. Use `setWaitUntil(WaitUntilState.LOAD)` to wait for all iframes.

## Version 1.25

### New APIs & changes
Expand Down
33 changes: 8 additions & 25 deletions java/docs/test-assertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ By default, the timeout for assertions is set to 5 seconds.
- [assertThat(locator).isHidden([options])](/test-assertions.mdx#locator-assertions-to-be-hidden)
- [assertThat(locator).isVisible([options])](/test-assertions.mdx#locator-assertions-to-be-visible)
- [assertThat(locator).containsText(expected[, options])](/test-assertions.mdx#locator-assertions-to-contain-text)
- [assertThat(locator).hasAttribute(name, value[, options])](/test-assertions.mdx#locator-assertions-to-have-attribute-1)
- [assertThat(locator).hasAttribute(name[, options])](/test-assertions.mdx#locator-assertions-to-have-attribute-2)
- [assertThat(locator).hasAttribute(name, value[, options])](/test-assertions.mdx#locator-assertions-to-have-attribute)
- [assertThat(locator).hasClass(expected[, options])](/test-assertions.mdx#locator-assertions-to-have-class)
- [assertThat(locator).hasCount(count[, options])](/test-assertions.mdx#locator-assertions-to-have-count)
- [assertThat(locator).hasCSS(name, value[, options])](/test-assertions.mdx#locator-assertions-to-have-css)
Expand Down Expand Up @@ -231,38 +230,22 @@ assertThat(page.locator("ul > li")).containsText(new String[] {"Some 33"});
assertThat(page.locator("ul")).containsText(new String[] {"Text 3"});
```

## assertThat(locator).hasAttribute(name, value[, options]) {#locator-assertions-to-have-attribute-1}
## assertThat(locator).hasAttribute(name, value[, options]) {#locator-assertions-to-have-attribute}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.18</font>
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font>

- `name`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-1-option-name"/> &#60;[String]&#62; Attribute name.<a href="#locator-assertions-to-have-attribute-1-option-name" class="list-anchor">#</a>
- `value`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-1-option-value"/> &#60;[String]|[Pattern]&#62; Expected attribute value.<a href="#locator-assertions-to-have-attribute-1-option-value" class="list-anchor">#</a>
- `name`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-option-name"/> &#60;[String]&#62; Attribute name. <font size="2">Added in: v1.18</font><a href="#locator-assertions-to-have-attribute-option-name" class="list-anchor">#</a>
- `value`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-option-value"/> &#60;[String]|[Pattern]&#62; Expected attribute value. <font size="2">Added in: v1.18</font><a href="#locator-assertions-to-have-attribute-option-value" class="list-anchor">#</a>
- `options` &#60;`LocatorAssertions.HasAttributeOptions`&#62;
- `setTimeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-1-option-timeout"/> &#60;[double]&#62; Time to retry the assertion for.<a href="#locator-assertions-to-have-attribute-1-option-timeout" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-1-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-have-attribute-1-return" class="list-anchor">#</a>
- `setTimeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-option-timeout"/> &#60;[double]&#62; Time to retry the assertion for. <font size="2">Added in: v1.18</font><a href="#locator-assertions-to-have-attribute-option-timeout" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-have-attribute-return" class="list-anchor">#</a>

Ensures the [Locator] points to an element with given attribute value.
Ensures the [Locator] points to an element with given attribute.

```java
assertThat(page.locator("input")).hasAttribute("type", "text");
```

## assertThat(locator).hasAttribute(name[, options]) {#locator-assertions-to-have-attribute-2}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.26</font>

- `name`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-2-option-name"/> &#60;[String]&#62; Attribute name.<a href="#locator-assertions-to-have-attribute-2-option-name" class="list-anchor">#</a>
- `options` &#60;`LocatorAssertions.HasAttributeOptions`&#62;
- `setTimeout`<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-2-option-timeout"/> &#60;[double]&#62; Time to retry the assertion for.<a href="#locator-assertions-to-have-attribute-2-option-timeout" class="list-anchor">#</a>
- returns:<a aria-hidden="true" tabindex="-1" class="list-anchor-link" id="locator-assertions-to-have-attribute-2-return"/> &#60;[void]&#62;<a href="#locator-assertions-to-have-attribute-2-return" class="list-anchor">#</a>

Ensures the [Locator] points to an element with given attribute. The method will assert attribute presence.

```java
assertThat(page.locator("input")).hasAttribute("disabled");
assertThat(page.locator("input")).not().hasAttribute("open");
```

## assertThat(locator).hasClass(expected[, options]) {#locator-assertions-to-have-class}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.20</font>
Expand Down
1 change: 0 additions & 1 deletion nodejs/docs/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ With this integration, only **browser binaries** are running inside a Docker con
Read more in [our documentation](./docker#experimental-playwright-test-docker-integration).

### Assertions
- [expect(locator).toHaveAttribute(name[, options])](/test-assertions.mdx#locator-assertions-to-have-attribute-2) can now be used for asserting attribute existence.
- New option `enabled` for [expect(locator).toBeEnabled([options])](/test-assertions.mdx#locator-assertions-to-be-enabled).
- [expect(locator).toHaveText(expected[, options])](/test-assertions.mdx#locator-assertions-to-have-text) now pierces open shadow roots.
- New option `editable` for [expect(locator).toBeEditable([options])](/test-assertions.mdx#locator-assertions-to-be-editable).
Expand Down
Loading

0 comments on commit acbc70d

Please sign in to comment.