Skip to content

Commit dfd9e9e

Browse files
committed
Attempt to fix build by ignoring bad versions
1 parent 63958b0 commit dfd9e9e

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

CSF.Extensions.WebDriver.Tests/Factories/WebDriverFromOptionsFactoryTests.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@ public void GetWebDriverShouldCreateALocalChromeDriverFromAppropriateOptions([St
2626
{
2727
Assert.Pass("Despite the exception raised, this is only because the driver isn't installed on the environment running the test; this is more than enough to prove that the driver was being created.");
2828
}
29-
29+
catch(TargetInvocationException e) when (e is { InnerException: InvalidOperationException } invOpEx)
30+
{
31+
if(invOpEx.Message.StartsWith("session not created:"))
32+
Assert.Pass("Despite the exception raised, this is only because the wrong version of the driver is installed on the environment running the test; this is more than enough to prove that the driver was being created.");
33+
throw;
34+
}
35+
catch(InvalidOperationException invOpEx)
36+
{
37+
if(invOpEx.Message.StartsWith("session not created:"))
38+
Assert.Pass("Despite the exception raised, this is only because the wrong version of the driver is installed on the environment running the test; this is more than enough to prove that the driver was being created.");
39+
throw;
40+
}
3041
}
3142

3243
[Test,AutoMoqData]
@@ -48,6 +59,14 @@ public void GetWebDriverShouldCustomiseDriverOptionsWithCallbackWhenItIsSpecifie
4859
{
4960
// Intentionally ignore this exception; we know it's going to fail but I care only about how the options were manipulated in this test.
5061
}
62+
catch(TargetInvocationException e) when (e is { InnerException: InvalidOperationException })
63+
{
64+
// Intentionally ignore this exception; we know it's going to fail but I care only about how the options were manipulated in this test.
65+
}
66+
catch(InvalidOperationException)
67+
{
68+
// Intentionally ignore this exception; we know it's going to fail but I care only about how the options were manipulated in this test.
69+
}
5170

5271
Assert.That(driverOptions.ToCapabilities()["Foo"], Is.EqualTo("Bar"));
5372
}

0 commit comments

Comments
 (0)