Skip to content

Commit bf6375f

Browse files
committed
Tests
1 parent 8eadea7 commit bf6375f

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

dotnet/src/webdriver/BiDi/Browser/SetDownloadBehaviorCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace OpenQA.Selenium.BiDi.Browser;
2626
internal sealed class SetDownloadBehaviorCommand(SetDownloadBehaviorParameters @params)
2727
: Command<SetDownloadBehaviorParameters, EmptyResult>(@params, "browser.setDownloadBehavior");
2828

29-
internal sealed record SetDownloadBehaviorParameters(DownloadBehavior? DownloadBehavior, IEnumerable<UserContext>? UserContexts) : Parameters;
29+
internal sealed record SetDownloadBehaviorParameters([property: JsonIgnore(Condition = JsonIgnoreCondition.Never)] DownloadBehavior? DownloadBehavior, IEnumerable<UserContext>? UserContexts) : Parameters;
3030

3131
[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
3232
[JsonDerivedType(typeof(DownloadBehaviorAllowed), "allowed")]

dotnet/test/common/BiDi/Browser/BrowserTest.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,37 @@ public async Task CanGetClientWindows()
6969
Assert.That(clientWindows, Has.Count.GreaterThanOrEqualTo(1));
7070
Assert.That(clientWindows[0].ClientWindow, Is.Not.Null);
7171
}
72+
73+
[Test]
74+
[IgnoreBrowser(Selenium.Browser.Chrome, "Not supported yet?")]
75+
[IgnoreBrowser(Selenium.Browser.Edge, "Not supported yet?")]
76+
[IgnoreBrowser(Selenium.Browser.Firefox, "Not supported yet?")]
77+
public async Task CanSetDownloadBehaviorAllowed()
78+
{
79+
var result = await bidi.Browser.SetDownloadBehaviorAllowedAsync("/my/path");
80+
81+
Assert.That(result, Is.Not.Null);
82+
}
83+
84+
[Test]
85+
[IgnoreBrowser(Selenium.Browser.Chrome, "Not supported yet?")]
86+
[IgnoreBrowser(Selenium.Browser.Edge, "Not supported yet?")]
87+
[IgnoreBrowser(Selenium.Browser.Firefox, "Not supported yet?")]
88+
public async Task CanSetDownloadBehaviorAllowedDefault()
89+
{
90+
var result = await bidi.Browser.SetDownloadBehaviorAllowedAsync();
91+
92+
Assert.That(result, Is.Not.Null);
93+
}
94+
95+
[Test]
96+
[IgnoreBrowser(Selenium.Browser.Chrome, "Not supported yet?")]
97+
[IgnoreBrowser(Selenium.Browser.Edge, "Not supported yet?")]
98+
[IgnoreBrowser(Selenium.Browser.Firefox, "Not supported yet?")]
99+
public async Task CanSetDownloadBehaviorDenied()
100+
{
101+
var result = await bidi.Browser.SetDownloadBehaviorDeniedAsync();
102+
103+
Assert.That(result, Is.Not.Null);
104+
}
72105
}

0 commit comments

Comments
 (0)