Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

api(dotnet): use jsonelement (#6749)

Pavel Feldman792f3d41e9b5
diff --git a/docs/src/api/class-accessibility.md b/docs/src/api/class-accessibility.md
index 0747cc83d6..834e13046d 100644
--- a/docs/src/api/class-accessibility.md
+++ b/docs/src/api/class-accessibility.md
@@ -98,27 +98,8 @@ function findFocusedNode(node) {
```
```csharp
-static AccessibilitySnapshotResult findFocusedNode(AccessibilitySnapshotResult root)
-{
- var nodes = new Stack<AccessibilitySnapshotResult>(new[] { root });
- while (nodes.Count > 0)
- {
- var node = nodes.Pop();
- if (node.Focused) return node;
- foreach (var innerNode in node.Children)
- {
- nodes.Push(innerNode);
- }
- }
-
- return null;
-}
-
var accessibilitySnapshot = await page.Accessibility.SnapshotAsync();
Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot));
-var focusedNode = findFocusedNode(accessibilitySnapshot);
-if (focusedNode != null)
- Console.WriteLine(focusedNode.Name);
```
```java
diff --git a/docs/src/api/class-response.md b/docs/src/api/class-response.md
index defff7ec7f..385ca95536 100644
--- a/docs/src/api/class-response.md
+++ b/docs/src/api/class-response.md
@@ -32,7 +32,7 @@ This method will throw if the response body is not parsable via `JSON.parse`.
## async method: Response.json
* langs: csharp
-- returns: <[JsonDocument]>
+- returns: <[JsonElement?]>
Returns the JSON representation of response body.
diff --git a/docs/src/api/csharp.md b/docs/src/api/csharp.md
index f0d8008f09..2a8e24ec05 100644
--- a/docs/src/api/csharp.md
+++ b/docs/src/api/csharp.md
@@ -1,6 +1,6 @@
## method: Request.PostDataJSON
* langs: csharp
-- returns: <[JsonDocument]>
+- returns: <[JsonElement?]>
Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any.