将 AssertNotSame 转换为 AssertThat
Converting AssertNotSame to AssertThat
我希望在我的自动化测试中有更直观的断言。我有一个断言来验证是否出现错误消息,这让人有点头疼。
Assert.assertNotSame((ExpectedConditions.textToBePresentInElementLocated(By.className("notification-title"), "Error message")), "Error message");
关于如何转换它有什么建议吗?
结果比我想象的要简单:
assertThat((ExpectedConditions.textToBePresentInElementLocated(By.className("notification-title"), "Error message")), is(not("Error message")));
notSame 和 False 让我很困惑 :D
我希望在我的自动化测试中有更直观的断言。我有一个断言来验证是否出现错误消息,这让人有点头疼。
Assert.assertNotSame((ExpectedConditions.textToBePresentInElementLocated(By.className("notification-title"), "Error message")), "Error message");
关于如何转换它有什么建议吗?
结果比我想象的要简单:
assertThat((ExpectedConditions.textToBePresentInElementLocated(By.className("notification-title"), "Error message")), is(not("Error message")));
notSame 和 False 让我很困惑 :D