Skip to content

feat(roll): roll to ToT Playwright (roll/30-09-23) #1174

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

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions dotnet/docs/api/class-locator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ foreach (var li in await page.GetByRole("listitem").AllAsync())

Returns an array of `node.innerText` values for all matching nodes.

:::caution Asserting text
If you need to assert text on the page, prefer [Expect(Locator).ToHaveTextAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) with `useInnerText` option to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand All @@ -61,6 +65,10 @@ var texts = await page.GetByRole(AriaRole.Link).AllInnerTextsAsync();

Returns an array of `node.textContent` values for all matching nodes.

:::caution Asserting text
If you need to assert text on the page, prefer [Expect(Locator).ToHaveTextAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand Down Expand Up @@ -322,6 +330,10 @@ When all steps combined have not finished during the specified `timeout`, this m

Returns the number of elements matching the locator.

:::caution Asserting count
If you need to assert the number of elements on the page, prefer [Expect(Locator).ToHaveCountAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand Down Expand Up @@ -766,6 +778,10 @@ await locator.ClickAsync();

Returns the matching element's attribute value.

:::caution Asserting attributes
If you need to assert an element's attribute, prefer [Expect(Locator).ToHaveAttributeAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand Down Expand Up @@ -1208,6 +1224,10 @@ await Locator.InnerHTMLAsync(options);

Returns the [`element.innerText`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText).

:::caution Asserting text
If you need to assert text on the page, prefer [Expect(Locator).ToHaveTextAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) with `useInnerText` option to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand All @@ -1231,6 +1251,10 @@ await Locator.InnerTextAsync(options);

Returns the value for the matching `<input>` or `<textarea>` or `<select>` element.

:::caution Asserting value
If you need to assert input value, prefer [Expect(Locator).ToHaveValueAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-value) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand Down Expand Up @@ -1258,6 +1282,10 @@ Throws elements that are not an input, textarea or a select. However, if the ele

Returns whether the element is checked. Throws if the element is not a checkbox or radio input.

:::caution Asserting checked state
If you need to assert that checkobx is checked, prefer [Expect(Locator).ToBeCheckedAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-be-checked) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand All @@ -1281,6 +1309,10 @@ var isChecked = await page.GetByRole(AriaRole.Checkbox).IsCheckedAsync();

Returns whether the element is disabled, the opposite of [enabled](../actionability.mdx#enabled).

:::caution Asserting disabled state
If you need to assert that an element is disabled, prefer [Expect(Locator).ToBeDisabledAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-be-disabled) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand All @@ -1304,6 +1336,10 @@ Boolean disabled = await page.GetByRole(AriaRole.Button).IsDisabledAsync();

Returns whether the element is [editable](../actionability.mdx#editable).

:::caution Asserting editable state
If you need to assert that an element is editable, prefer [Expect(Locator).ToBeEditableAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-be-editable) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand All @@ -1327,6 +1363,10 @@ Boolean editable = await page.GetByRole(AriaRole.Textbox).IsEditableAsync();

Returns whether the element is [enabled](../actionability.mdx#enabled).

:::caution Asserting enabled state
If you need to assert that an element is enabled, prefer [Expect(Locator).ToBeEnabledAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-be-enabled) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand All @@ -1350,6 +1390,10 @@ Boolean enabled = await page.GetByRole(AriaRole.Button).IsEnabledAsync();

Returns whether the element is hidden, the opposite of [visible](../actionability.mdx#visible).

:::caution Asserting visibility
If you need to assert that element is hidden, prefer [Expect(Locator).ToBeHiddenAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-be-hidden) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand All @@ -1376,6 +1420,10 @@ Boolean hidden = await page.GetByRole(AriaRole.Button).IsHiddenAsync();

Returns whether the element is [visible](../actionability.mdx#visible).

:::caution Asserting visibility
If you need to assert that element is visible, prefer [Expect(Locator).ToBeVisibleAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-be-visible) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand Down Expand Up @@ -1960,6 +2008,10 @@ When all steps combined have not finished during the specified `timeout`, this m

Returns the [`node.textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent).

:::caution Asserting text
If you need to assert text on the page, prefer [Expect(Locator).ToHaveTextAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```csharp
Expand Down
52 changes: 52 additions & 0 deletions java/docs/api/class-locator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ for (Locator li : page.getByRole('listitem').all())

Returns an array of `node.innerText` values for all matching nodes.

:::caution Asserting text
If you need to assert text on the page, prefer [assertThat(locator).hasText()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) with `useInnerText` option to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand All @@ -61,6 +65,10 @@ String[] texts = page.getByRole(AriaRole.LINK).allInnerTexts();

Returns an array of `node.textContent` values for all matching nodes.

:::caution Asserting text
If you need to assert text on the page, prefer [assertThat(locator).hasText()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand Down Expand Up @@ -322,6 +330,10 @@ When all steps combined have not finished during the specified `timeout`, this m

Returns the number of elements matching the locator.

:::caution Asserting count
If you need to assert the number of elements on the page, prefer [assertThat(locator).hasCount()](/api/class-locatorassertions.mdx#locator-assertions-to-have-count) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand Down Expand Up @@ -766,6 +778,10 @@ locator.click();

Returns the matching element's attribute value.

:::caution Asserting attributes
If you need to assert an element's attribute, prefer [assertThat(locator).hasAttribute()](/api/class-locatorassertions.mdx#locator-assertions-to-have-attribute) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand Down Expand Up @@ -1208,6 +1224,10 @@ Locator.innerHTML(options);

Returns the [`element.innerText`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText).

:::caution Asserting text
If you need to assert text on the page, prefer [assertThat(locator).hasText()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) with `useInnerText` option to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand All @@ -1232,6 +1252,10 @@ Locator.innerText(options);

Returns the value for the matching `<input>` or `<textarea>` or `<select>` element.

:::caution Asserting value
If you need to assert input value, prefer [assertThat(locator).hasValue()](/api/class-locatorassertions.mdx#locator-assertions-to-have-value) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand Down Expand Up @@ -1259,6 +1283,10 @@ Throws elements that are not an input, textarea or a select. However, if the ele

Returns whether the element is checked. Throws if the element is not a checkbox or radio input.

:::caution Asserting checked state
If you need to assert that checkobx is checked, prefer [assertThat(locator).isChecked()](/api/class-locatorassertions.mdx#locator-assertions-to-be-checked) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand All @@ -1282,6 +1310,10 @@ boolean checked = page.getByRole(AriaRole.CHECKBOX).isChecked();

Returns whether the element is disabled, the opposite of [enabled](../actionability.mdx#enabled).

:::caution Asserting disabled state
If you need to assert that an element is disabled, prefer [assertThat(locator).isDisabled()](/api/class-locatorassertions.mdx#locator-assertions-to-be-disabled) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand All @@ -1305,6 +1337,10 @@ boolean disabled = page.getByRole(AriaRole.BUTTON).isDisabled();

Returns whether the element is [editable](../actionability.mdx#editable).

:::caution Asserting editable state
If you need to assert that an element is editable, prefer [assertThat(locator).isEditable()](/api/class-locatorassertions.mdx#locator-assertions-to-be-editable) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand All @@ -1328,6 +1364,10 @@ boolean editable = page.getByRole(AriaRole.TEXTBOX).isEditable();

Returns whether the element is [enabled](../actionability.mdx#enabled).

:::caution Asserting enabled state
If you need to assert that an element is enabled, prefer [assertThat(locator).isEnabled()](/api/class-locatorassertions.mdx#locator-assertions-to-be-enabled) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand All @@ -1351,6 +1391,10 @@ boolean enabled = page.getByRole(AriaRole.BUTTON).isEnabled();

Returns whether the element is hidden, the opposite of [visible](../actionability.mdx#visible).

:::caution Asserting visibility
If you need to assert that element is hidden, prefer [assertThat(locator).isHidden()](/api/class-locatorassertions.mdx#locator-assertions-to-be-hidden) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand All @@ -1377,6 +1421,10 @@ boolean hidden = page.getByRole(AriaRole.BUTTON).isHidden();

Returns whether the element is [visible](../actionability.mdx#visible).

:::caution Asserting visibility
If you need to assert that element is visible, prefer [assertThat(locator).isVisible()](/api/class-locatorassertions.mdx#locator-assertions-to-be-visible) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand Down Expand Up @@ -1960,6 +2008,10 @@ When all steps combined have not finished during the specified `timeout`, this m

Returns the [`node.textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent).

:::caution Asserting text
If you need to assert text on the page, prefer [assertThat(locator).hasText()](/api/class-locatorassertions.mdx#locator-assertions-to-have-text) to avoid flakiness. See [assertions guide](../test-assertions.mdx) for more details.
:::

**Usage**

```java
Expand Down
Loading