Skip to content

Commit 986f673

Browse files
authored
Bidi: Browser.version and Browser.userAgent (#2834)
* Bidi Browser.version * add user agent tests
1 parent f07f043 commit 986f673

File tree

4 files changed

+33
-6
lines changed

4 files changed

+33
-6
lines changed

.github/workflows/dotnet.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
paths:
1212
- '**.yml'
1313
- '**.cs'
14+
- '**.json'
1415
- '**.csproj'
1516
- '**.runsettings'
1617

lib/PuppeteerSharp.Nunit/TestExpectations/TestExpectations.local.json

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,37 @@
9292
},
9393
{
9494
"comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one",
95-
"testIdPattern": "[browser.spec] *",
95+
"testIdPattern": "[browser.spec] *Browser.isConnected*",
96+
"platforms": [
97+
"darwin",
98+
"linux",
99+
"win32"
100+
],
101+
"parameters": [
102+
"webDriverBiDi"
103+
],
104+
"expectations": [
105+
"FAIL"
106+
]
107+
},
108+
{
109+
"comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one",
110+
"testIdPattern": "[browser.spec] *Browser.process*",
111+
"platforms": [
112+
"darwin",
113+
"linux",
114+
"win32"
115+
],
116+
"parameters": [
117+
"webDriverBiDi"
118+
],
119+
"expectations": [
120+
"FAIL"
121+
]
122+
},
123+
{
124+
"comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one",
125+
"testIdPattern": "[browser.spec] *Browser.target*",
96126
"platforms": [
97127
"darwin",
98128
"linux",

lib/PuppeteerSharp.Tests/BrowserTests/UserAgentTests.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ namespace PuppeteerSharp.Tests.BrowserTests
66
{
77
public class UserAgentTests : PuppeteerBrowserBaseTest
88
{
9-
public UserAgentTests() : base()
10-
{
11-
}
12-
139
[Test, Retry(2), PuppeteerTest("browser.spec", "Browser.userAgent", "should include WebKit")]
1410
public async Task ShouldIncludeWebKit()
1511
{

lib/PuppeteerSharp/Bidi/BidiBrowser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private BidiBrowser(Core.Browser browserCore, LaunchOptions options, ILoggerFact
8989
public override Task<string> GetVersionAsync() => Task.FromResult($"{BrowserName}/{BrowserVersion}");
9090

9191
/// <inheritdoc />
92-
public override Task<string> GetUserAgentAsync() => throw new NotImplementedException();
92+
public override Task<string> GetUserAgentAsync() => Task.FromResult(BrowserCore.Session.Info.Capabilities.UserAgent);
9393

9494
/// <inheritdoc />
9595
public override void Disconnect() => throw new NotImplementedException();

0 commit comments

Comments
 (0)