Skip to content

Commit

Permalink
Updating .NET visibility test to check for proper exception type or s…
Browse files Browse the repository at this point in the history
…ubclass
  • Loading branch information
jimevans committed Mar 9, 2018
1 parent 955e5bb commit 616793e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dotnet/test/common/VisibilityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void ShouldNotBeAbleToClickOnAnElementThatIsNotDisplayed()
{
driver.Url = javascriptPage;
IWebElement element = driver.FindElement(By.Id("unclickable"));
Assert.Throws<ElementNotInteractableException>(() => element.Click());
Assert.That(() => element.Click(), Throws.InstanceOf<ElementNotInteractableException>());
}

[Test]
Expand All @@ -86,7 +86,7 @@ public void ShouldNotBeAbleToTypeAnElementThatIsNotDisplayed()
{
driver.Url = javascriptPage;
IWebElement element = driver.FindElement(By.Id("unclickable"));
Assert.Throws<ElementNotInteractableException>(() => element.SendKeys("You don't see me"));
Assert.That(() => element.SendKeys("You don't see me"), Throws.InstanceOf<ElementNotInteractableException>());

Assert.AreNotEqual(element.GetAttribute("value"), "You don't see me");
}
Expand All @@ -97,7 +97,7 @@ public void ShouldNotBeAbleToSelectAnElementThatIsNotDisplayed()
{
driver.Url = javascriptPage;
IWebElement element = driver.FindElement(By.Id("untogglable"));
Assert.Throws<ElementNotInteractableException>(() => element.Click());
Assert.That(() => element.Click(), Throws.InstanceOf<ElementNotInteractableException>());
}

[Test]
Expand Down

0 comments on commit 616793e

Please sign in to comment.