Skip to content

Commit

Permalink
docs(dotnet): fix assertion snippets (#33622)
Browse files Browse the repository at this point in the history
  • Loading branch information
Honyii authored Nov 15, 2024
1 parent 2aa9e11 commit e61cea5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/src/api/class-locatorassertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ expect(locator).to_be_enabled()

```csharp
var locator = Page.Locator("button.submit");
await Expect(locator).toBeEnabledAsync();
await Expect(locator).ToBeEnabledAsync();
```

### option: LocatorAssertions.toBeEnabled.enabled
Expand Down Expand Up @@ -1181,7 +1181,7 @@ expect(locator).to_have_accessible_description("Save results to disk")

```csharp
var locator = Page.GetByTestId("save-button");
await Expect(locator).toHaveAccessibleDescriptionAsync("Save results to disk");
await Expect(locator).ToHaveAccessibleDescriptionAsync("Save results to disk");
```

### param: LocatorAssertions.toHaveAccessibleDescription.description
Expand Down Expand Up @@ -1231,7 +1231,7 @@ expect(locator).to_have_accessible_name("Save to disk")

```csharp
var locator = Page.GetByTestId("save-button");
await Expect(locator).toHaveAccessibleNameAsync("Save to disk");
await Expect(locator).ToHaveAccessibleNameAsync("Save to disk");
```

### param: LocatorAssertions.toHaveAccessibleName.name
Expand Down
4 changes: 2 additions & 2 deletions docs/src/clock.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ await Page.GotoAsync("http://localhost:3333");
await Page.Clock.PauseAtAsync(new DateTime(2024, 2, 2, 10, 0, 0));

// Assert the page state.
await Expect(Page.GetByTestId("current-time")).ToHaveText("2/2/2024, 10:00:00 AM");
await Expect(Page.GetByTestId("current-time")).ToHaveTextAsync("2/2/2024, 10:00:00 AM");

// Close the laptop lid again and open it at 10:30am.
await Page.Clock.FastForwardAsync("30:00");
await Expect(Page.GetByTestId("current-time")).ToHaveText("2/2/2024, 10:30:00 AM");
await Expect(Page.GetByTestId("current-time")).ToHaveTextAsync("2/2/2024, 10:30:00 AM");
```

## Test inactivity monitoring
Expand Down
2 changes: 1 addition & 1 deletion docs/src/release-notes-csharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ All the same methods are also available on [Locator], [FrameLocator] and [Frame]
- [`method: LocatorAssertions.toHaveAttribute`] with an empty value does not match missing attribute anymore. For example, the following snippet will succeed when `button` **does not** have a `disabled` attribute.

```csharp
await Expect(Page.GetByRole(AriaRole.Button)).ToHaveAttribute("disabled", "");
await Expect(Page.GetByRole(AriaRole.Button)).ToHaveAttributeAsync("disabled", "");
```

### Browser Versions
Expand Down

0 comments on commit e61cea5

Please sign in to comment.