Skip to content

Commit

Permalink
[dotnet] Updating tests to work with v110
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Feb 17, 2023
1 parent 4f09bf0 commit e11ab24
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 132 deletions.
4 changes: 2 additions & 2 deletions dotnet/test/common/DevTools/DevToolsConsoleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public class DevToolsConsoleTest : DevToolsTestFixture
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task VerifyMessageAdded()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
string consoleMessage = "Hello Selenium";

ManualResetEventSlim sync = new ManualResetEventSlim(false);
EventHandler<V109.Console.MessageAddedEventArgs> messageAddedHandler = (sender, e) =>
EventHandler<V110.Console.MessageAddedEventArgs> messageAddedHandler = (sender, e) =>
{
Assert.That(e.Message.Text, Is.EqualTo(consoleMessage));
sync.Set();
Expand Down
6 changes: 3 additions & 3 deletions dotnet/test/common/DevTools/DevToolsLogTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ public class DevToolsLogTest : DevToolsTestFixture
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task VerifyEntryAddedAndClearLog()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
ManualResetEventSlim sync = new ManualResetEventSlim(false);
EventHandler<V109.Log.EntryAddedEventArgs> entryAddedHandler = (sender, e) =>
EventHandler<V110.Log.EntryAddedEventArgs> entryAddedHandler = (sender, e) =>
{
Assert.That(e.Entry.Text.Contains("404"));
Assert.That(e.Entry.Level == V109.Log.LogEntryLevelValues.Error);
Assert.That(e.Entry.Level == V110.Log.LogEntryLevelValues.Error);
sync.Set();
};

Expand Down
144 changes: 72 additions & 72 deletions dotnet/test/common/DevTools/DevToolsNetworkTest.cs

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions dotnet/test/common/DevTools/DevToolsPerformanceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class DevToolsPerformanceTest : DevToolsTestFixture
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task EnableAndDisablePerformance()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
await domains.Performance.Enable(new V109.Performance.EnableCommandSettings());
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Performance.Enable(new V110.Performance.EnableCommandSettings());
driver.Url = simpleTestPage;
await domains.Performance.Disable();
}
Expand All @@ -24,7 +24,7 @@ public async Task EnableAndDisablePerformance()
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task DisablePerformance()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Performance.Disable();
driver.Url = simpleTestPage;
await domains.Performance.Disable();
Expand All @@ -36,13 +36,13 @@ public async Task DisablePerformance()
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task SetTimeDomainTimeTickPerformance()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Performance.Disable();
await domains.Performance.SetTimeDomain(new V109.Performance.SetTimeDomainCommandSettings()
await domains.Performance.SetTimeDomain(new V110.Performance.SetTimeDomainCommandSettings()
{
TimeDomain = "timeTicks"
});
await domains.Performance.Enable(new V109.Performance.EnableCommandSettings());
await domains.Performance.Enable(new V110.Performance.EnableCommandSettings());
driver.Url = simpleTestPage;
await domains.Performance.Disable();
}
Expand All @@ -54,13 +54,13 @@ await domains.Performance.SetTimeDomain(new V109.Performance.SetTimeDomainComman
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task SetTimeDomainsThreadTicksPerformance()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Performance.Disable();
await domains.Performance.SetTimeDomain(new V109.Performance.SetTimeDomainCommandSettings()
await domains.Performance.SetTimeDomain(new V110.Performance.SetTimeDomainCommandSettings()
{
TimeDomain = "threadTicks"
});
await domains.Performance.Enable(new V109.Performance.EnableCommandSettings());
await domains.Performance.Enable(new V110.Performance.EnableCommandSettings());
driver.Url = simpleTestPage;
await domains.Performance.Disable();
}
Expand All @@ -71,12 +71,12 @@ await domains.Performance.SetTimeDomain(new V109.Performance.SetTimeDomainComman
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task GetMetricsByTimeTicks()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
await domains.Performance.SetTimeDomain(new V109.Performance.SetTimeDomainCommandSettings()
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Performance.SetTimeDomain(new V110.Performance.SetTimeDomainCommandSettings()
{
TimeDomain = "timeTicks"
});
await domains.Performance.Enable(new V109.Performance.EnableCommandSettings());
await domains.Performance.Enable(new V110.Performance.EnableCommandSettings());
driver.Url = simpleTestPage;
var response = await domains.Performance.GetMetrics();
var metrics = response.Metrics;
Expand All @@ -92,12 +92,12 @@ await domains.Performance.SetTimeDomain(new V109.Performance.SetTimeDomainComman
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task GetMetricsByThreadTicks()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
await domains.Performance.SetTimeDomain(new V109.Performance.SetTimeDomainCommandSettings()
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Performance.SetTimeDomain(new V110.Performance.SetTimeDomainCommandSettings()
{
TimeDomain = "threadTicks"
});
await domains.Performance.Enable(new V109.Performance.EnableCommandSettings());
await domains.Performance.Enable(new V110.Performance.EnableCommandSettings());
driver.Url = simpleTestPage;
var response = await domains.Performance.GetMetrics();
var metrics = response.Metrics;
Expand Down
18 changes: 9 additions & 9 deletions dotnet/test/common/DevTools/DevToolsProfilerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DevToolsProfilerTest : DevToolsTestFixture
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task SimpleStartStopAndGetProfilerTest()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Profiler.Enable();
await domains.Profiler.Start();
var response = await domains.Profiler.Stop();
Expand All @@ -32,10 +32,10 @@ public async Task SimpleStartStopAndGetProfilerTest()
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task SampleGetBestEffortProfilerTest()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Profiler.Enable();
driver.Url = simpleTestPage;
await domains.Profiler.SetSamplingInterval(new V109.Profiler.SetSamplingIntervalCommandSettings()
await domains.Profiler.SetSamplingInterval(new V110.Profiler.SetSamplingIntervalCommandSettings()
{
Interval = 30
});
Expand All @@ -53,10 +53,10 @@ await domains.Profiler.SetSamplingInterval(new V109.Profiler.SetSamplingInterval
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task SampleSetStartPreciseCoverageTest()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Profiler.Enable();
driver.Url = simpleTestPage;
await domains.Profiler.StartPreciseCoverage(new V109.Profiler.StartPreciseCoverageCommandSettings()
await domains.Profiler.StartPreciseCoverage(new V110.Profiler.StartPreciseCoverageCommandSettings()
{
CallCount = true,
Detailed = true
Expand All @@ -78,11 +78,11 @@ await domains.Profiler.StartPreciseCoverage(new V109.Profiler.StartPreciseCovera
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task SampleProfileEvents()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Profiler.Enable();
driver.Url = simpleTestPage;
ManualResetEventSlim startSync = new ManualResetEventSlim(false);
EventHandler<V109.Profiler.ConsoleProfileStartedEventArgs> consoleProfileStartedHandler = (sender, e) =>
EventHandler<V110.Profiler.ConsoleProfileStartedEventArgs> consoleProfileStartedHandler = (sender, e) =>
{
Assert.That(e, Is.Not.Null);
startSync.Set();
Expand All @@ -94,7 +94,7 @@ public async Task SampleProfileEvents()
driver.Navigate().Refresh();

ManualResetEventSlim finishSync = new ManualResetEventSlim(false);
EventHandler<V109.Profiler.ConsoleProfileFinishedEventArgs> consoleProfileFinishedHandler = (sender, e) =>
EventHandler<V110.Profiler.ConsoleProfileFinishedEventArgs> consoleProfileFinishedHandler = (sender, e) =>
{
Assert.That(e, Is.Not.Null);
finishSync.Set();
Expand All @@ -109,7 +109,7 @@ public async Task SampleProfileEvents()
await domains.Profiler.Disable();
}

private void ValidateProfile(V109.Profiler.Profile profiler)
private void ValidateProfile(V110.Profiler.Profile profiler)
{
Assert.That(profiler, Is.Not.Null);
Assert.That(profiler.Nodes, Is.Not.Null);
Expand Down
10 changes: 5 additions & 5 deletions dotnet/test/common/DevTools/DevToolsSecurityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ public class DevToolsSecurityTest : DevToolsTestFixture
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task LoadInsecureWebsite()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Security.Enable();

await domains.Security.SetIgnoreCertificateErrors(new V109.Security.SetIgnoreCertificateErrorsCommandSettings()
await domains.Security.SetIgnoreCertificateErrors(new V110.Security.SetIgnoreCertificateErrorsCommandSettings()
{
Ignore = false
});

string summary = null;
ManualResetEventSlim sync = new ManualResetEventSlim(false);
EventHandler<V109.Security.SecurityStateChangedEventArgs> securityStateChangedHandler = (sender, e) =>
EventHandler<V110.Security.SecurityStateChangedEventArgs> securityStateChangedHandler = (sender, e) =>
{
summary = e.Summary;
sync.Set();
Expand All @@ -50,10 +50,10 @@ await domains.Security.SetIgnoreCertificateErrors(new V109.Security.SetIgnoreCer
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task LoadSecureWebsite()
{
var domains = session.GetVersionSpecificDomains<V109.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<V110.DevToolsSessionDomains>();
await domains.Security.Enable();

await domains.Security.SetIgnoreCertificateErrors(new V109.Security.SetIgnoreCertificateErrorsCommandSettings()
await domains.Security.SetIgnoreCertificateErrors(new V110.Security.SetIgnoreCertificateErrorsCommandSettings()
{
Ignore = true
});
Expand Down
Loading

0 comments on commit e11ab24

Please sign in to comment.