mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs(clock): Fix C# version of clock documentation (#31560)
This commit is contained in:
parent
21c4531618
commit
1d930542e1
@ -152,9 +152,9 @@ assertThat(locator).hasText("2/2/2024, 10:30:00 AM");
|
|||||||
```csharp
|
```csharp
|
||||||
// Initialize clock with some time before the test time and let the page load naturally.
|
// Initialize clock with some time before the test time and let the page load naturally.
|
||||||
// `Date.now` will progress as the timers fire.
|
// `Date.now` will progress as the timers fire.
|
||||||
await Page.Clock.InstallAsync(new
|
await Page.Clock.InstallAsync(new()
|
||||||
{
|
{
|
||||||
Time = new DateTime(2024, 2, 2, 8, 0, 0)
|
TimeDate = new DateTime(2024, 2, 2, 8, 0, 0)
|
||||||
});
|
});
|
||||||
await Page.GotoAsync("http://localhost:3333");
|
await Page.GotoAsync("http://localhost:3333");
|
||||||
|
|
||||||
@ -370,9 +370,9 @@ assertThat(locator).hasText("2/2/2024, 10:00:02 AM");
|
|||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
// Initialize clock with a specific time, let the page load naturally.
|
// Initialize clock with a specific time, let the page load naturally.
|
||||||
await Page.Clock.InstallAsync(new
|
await Page.Clock.InstallAsync(new()
|
||||||
{
|
{
|
||||||
Time = new DateTime(2024, 2, 2, 8, 0, 0, DateTimeKind.Pst)
|
TimeDate = new DateTime(2024, 2, 2, 8, 0, 0, DateTimeKind.Pst)
|
||||||
});
|
});
|
||||||
await page.GotoAsync("http://localhost:3333");
|
await page.GotoAsync("http://localhost:3333");
|
||||||
var locator = page.GetByTestId("current-time");
|
var locator = page.GetByTestId("current-time");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user