Skip to content
Draft
Show file tree
Hide file tree
Changes from 9 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
28 changes: 3 additions & 25 deletions dotnet/src/webdriver/BiDi/Communication/Broker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,38 +71,16 @@ internal Broker(BiDi bidi, Uri url)
Converters =
{
new BrowsingContextConverter(_bidi),
new BrowserUserContextConverter(bidi),
new BrowserClientWindowConverter(),
new NavigationConverter(),
new BrowserUserContextConverter(_bidi),
new InterceptConverter(_bidi),
new RequestConverter(_bidi),
new ChannelConverter(),
new HandleConverter(_bidi),
new InternalIdConverter(_bidi),
new PreloadScriptConverter(_bidi),
new RealmConverter(_bidi),
new RealmTypeConverter(),
new DateTimeOffsetConverter(),
new PrintPageRangeConverter(),
new InputOriginConverter(),
new SubscriptionConverter(),
new JsonStringEnumConverter(JsonNamingPolicy.CamelCase),

// https://github.com/dotnet/runtime/issues/72604
new Json.Converters.Polymorphic.MessageConverter(),
new Json.Converters.Polymorphic.EvaluateResultConverter(),
new Json.Converters.Polymorphic.RemoteValueConverter(),
new Json.Converters.Polymorphic.RealmInfoConverter(),
new Json.Converters.Polymorphic.LogEntryConverter(),
//

// Enumerable
new Json.Converters.Enumerable.GetCookiesResultConverter(),
new Json.Converters.Enumerable.LocateNodesResultConverter(),
new Json.Converters.Enumerable.InputSourceActionsConverter(),
new Json.Converters.Enumerable.GetUserContextsResultConverter(),
new Json.Converters.Enumerable.GetClientWindowsResultConverter(),
new Json.Converters.Enumerable.GetRealmsResultConverter(),
new BiDiDateTimeOffsetConverter(),
new JsonStringEnumConverter(JsonNamingPolicy.CamelCase),
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="DateTimeOffsetConverter.cs" company="Selenium Committers">
// <copyright file="BiDiDateTimeOffsetConverter.cs" company="Selenium Committers">
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
Expand All @@ -23,7 +23,7 @@

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters;

internal class DateTimeOffsetConverter : JsonConverter<DateTimeOffset>
internal class BiDiDateTimeOffsetConverter : JsonConverter<DateTimeOffset>
{
public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
Expand Down
4 changes: 4 additions & 0 deletions dotnet/src/webdriver/BiDi/Communication/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
// under the License.
// </copyright>

using OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication;

// https://github.com/dotnet/runtime/issues/72604
[JsonConverter(typeof(MessageConverter))]

//[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
//[JsonDerivedType(typeof(MessageSuccess), "success")]
//[JsonDerivedType(typeof(MessageError), "error")]
Expand Down
4 changes: 4 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Browser/ClientWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
// under the License.
// </copyright>

using OpenQA.Selenium.BiDi.Communication.Json.Converters;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Browser;

[JsonConverter(typeof(BrowserClientWindowConverter))]
public record ClientWindow
{
internal ClientWindow(string id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
// </copyright>

using OpenQA.Selenium.BiDi.Communication;
using OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
using System.Collections;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Browser;

Expand All @@ -28,6 +30,7 @@ internal class GetClientWindowsCommand()

public record GetClientWindowsOptions : CommandOptions;

[JsonConverter(typeof(GetClientWindowsResultConverter))]
public record GetClientWindowsResult : IReadOnlyList<ClientWindowInfo>
{
private readonly IReadOnlyList<ClientWindowInfo> _clientWindows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
// </copyright>

using OpenQA.Selenium.BiDi.Communication;
using OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
using System.Collections;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Browser;

Expand All @@ -28,6 +30,7 @@ internal class GetUserContextsCommand()

public record GetUserContextsOptions : CommandOptions;

[JsonConverter(typeof(GetUserContextsResultConverter))]
public record GetUserContextsResult : IReadOnlyList<UserContextInfo>
{
private readonly IReadOnlyList<UserContextInfo> _userContexts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
// </copyright>

using OpenQA.Selenium.BiDi.Communication;
using OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
using System.Collections;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;

Expand All @@ -37,6 +39,7 @@ public record LocateNodesOptions : CommandOptions
public IEnumerable<Script.ISharedReference>? StartNodes { get; set; }
}

[JsonConverter(typeof(LocateNodesResultConverter))]
public record LocateNodesResult : IReadOnlyList<Script.NodeRemoteValue>
{
private readonly IReadOnlyList<Script.NodeRemoteValue> _nodes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
// under the License.
// </copyright>

using OpenQA.Selenium.BiDi.Communication.Json.Converters;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;

[JsonConverter(typeof(NavigationConverter))]
public record Navigation(string Id);
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
// </copyright>

using OpenQA.Selenium.BiDi.Communication;
using OpenQA.Selenium.BiDi.Communication.Json.Converters;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;

Expand Down Expand Up @@ -69,6 +71,7 @@ public struct PrintPage
public double? Width { get; set; }
}

[JsonConverter(typeof(PrintPageRangeConverter))]
public readonly record struct PrintPageRange(int? Start, int? End)
{
public static implicit operator PrintPageRange(int index) { return new PrintPageRange(index, index); }
Expand Down
4 changes: 4 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Input/Origin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
// under the License.
// </copyright>

using OpenQA.Selenium.BiDi.Communication.Json.Converters;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Input;

[JsonConverter(typeof(InputOriginConverter))]
public abstract record Origin;

public record ViewportOrigin() : Origin;
Expand Down
2 changes: 2 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Input/SourceActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
// under the License.
// </copyright>

using OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Input;

[JsonConverter(typeof(InputSourceActionsConverter))]
public abstract record SourceActions
{
public string Id { get; } = Guid.NewGuid().ToString();
Expand Down
4 changes: 4 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Log/LogEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
// under the License.
// </copyright>

using OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Log;

// https://github.com/dotnet/runtime/issues/72604
[JsonConverter(typeof(LogEntryConverter))]

//[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
//[JsonDerivedType(typeof(ConsoleLogEntry), "console")]
//[JsonDerivedType(typeof(JavascriptLogEntry), "javascript")]
Expand Down
4 changes: 4 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Script/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
// under the License.
// </copyright>

using OpenQA.Selenium.BiDi.Communication.Json.Converters;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Script;

[JsonConverter(typeof(ChannelConverter))]
public record Channel(string Id);
4 changes: 4 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Script/EvaluateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// </copyright>

using OpenQA.Selenium.BiDi.Communication;
using OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Script;

Expand All @@ -36,6 +38,8 @@ public record EvaluateOptions : CommandOptions
}

// https://github.com/dotnet/runtime/issues/72604
[JsonConverter(typeof(EvaluateResultConverter))]

//[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
//[JsonDerivedType(typeof(Success), "success")]
//[JsonDerivedType(typeof(Exception), "exception")]
Expand Down
3 changes: 3 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Script/GetRealmsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
// </copyright>

using OpenQA.Selenium.BiDi.Communication;
using OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
using System.Collections;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Script;

Expand All @@ -35,6 +37,7 @@ public record GetRealmsOptions : CommandOptions
public RealmType? Type { get; set; }
}

[JsonConverter(typeof(GetRealmsResultConverter))]
public record GetRealmsResult : IReadOnlyList<RealmInfo>
{
private readonly IReadOnlyList<RealmInfo> _realms;
Expand Down
4 changes: 4 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Script/RealmInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
// under the License.
// </copyright>

using OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Script;

// https://github.com/dotnet/runtime/issues/72604
[JsonConverter(typeof(RealmInfoConverter))]

//[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
//[JsonDerivedType(typeof(WindowRealmInfo), "window")]
//[JsonDerivedType(typeof(DedicatedWorkerRealmInfo), "dedicated-worker")]
Expand Down
4 changes: 4 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Script/RealmType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
// under the License.
// </copyright>

using OpenQA.Selenium.BiDi.Communication.Json.Converters;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Script;

[JsonConverter(typeof(RealmTypeConverter))]
public enum RealmType
{
Window,
Expand Down
3 changes: 3 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Script/RemoteValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// under the License.
// </copyright>

using OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;
using System;
using System.Collections.Generic;
using System.Numerics;
Expand All @@ -26,6 +27,8 @@
namespace OpenQA.Selenium.BiDi.Modules.Script;

// https://github.com/dotnet/runtime/issues/72604
[JsonConverter(typeof(RemoteValueConverter))]

//[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
//[JsonDerivedType(typeof(NumberRemoteValue), "number")]
//[JsonDerivedType(typeof(BooleanRemoteValue), "boolean")]
Expand Down
4 changes: 4 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Session/Subscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
// under the License.
// </copyright>

using OpenQA.Selenium.BiDi.Communication.Json.Converters;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Session;

[JsonConverter(typeof(SubscriptionConverter))]
public sealed class Subscription
{
internal Subscription(string id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// </copyright>

using OpenQA.Selenium.BiDi.Communication;
using OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
using System;
using System.Collections;
using System.Collections.Generic;
Expand All @@ -37,6 +38,7 @@ public record GetCookiesOptions : CommandOptions
public PartitionDescriptor? Partition { get; set; }
}

[JsonConverter(typeof(GetCookiesResultConverter))]
public record GetCookiesResult : IReadOnlyList<Network.Cookie>
{
private readonly IReadOnlyList<Network.Cookie> _cookies;
Expand Down
Empty file modified py/docs/source/index.rst
100644 → 100755
Empty file.