From 99654899df1f1f5f252ffdf4d4f8a4ba4cedda83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C5=BEe=20Vodovnik?= Date: Thu, 5 Aug 2021 20:17:34 +0200 Subject: [PATCH] docs(dotnet): update core concepts with correct code examples (#8002) --- docs/src/core-concepts.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/src/core-concepts.md b/docs/src/core-concepts.md index c9893cc30c..4552644fc5 100644 --- a/docs/src/core-concepts.md +++ b/docs/src/core-concepts.md @@ -72,7 +72,7 @@ class Program public static async Task Main() { using var playwright = await Playwright.CreateAsync(); - await using var firefox = playwright.Firefox.LaunchAsync(new BrowserTypeLaunchOptions + await using var firefox = playwright.Firefox.LaunchAsync(new() { Headless = false }); @@ -208,7 +208,7 @@ class PlaywrightExample await using var browser = await playwright.Webkit.LaunchAsync(); var options = new BrowserContextNewOptions(Playwright.Devices["iPhone 11 Pro"]) { - Geolocation = new Geolocation() { Longitude = 12.492507f, Latitude = 41.889938f }, + Geolocation = new() { Longitude = 12.492507f, Latitude = 41.889938f }, Permissions = new[] { "geolocation" }, Locale = "de-DE" }; @@ -716,7 +716,7 @@ page.wait_for_selector('#promo') ```csharp // Wait for #search to appear in the DOM. -await page.WaitForSelectorAsync("#search", WaitForSelectorState.Attached); +await page.WaitForSelectorAsync("#search", new() { State = WaitForSelectorState.Attached }); // Wait for #promo to become visible, for example with `visibility:visible`. await page.WaitForSelectorAsync("#promo"); ``` @@ -755,9 +755,9 @@ page.wait_for_selector('#promo', state='detached') ```csharp // Wait for #details to become hidden, for example with "display:none". -await page.WaitForSelectorAsync("#details", WaitForSelectorState.Hidden); +await page.WaitForSelectorAsync("#details", new() { State = WaitForSelectorState.Hidden }); // Wait for #promo to be removed from the DOM. -await page.WaitForSelectorAsync("#promo", WaitForSelectorState.Detached); +await page.WaitForSelectorAsync("#promo", new() { State = WaitForSelectorState.Detached }); ``` ### API reference