我希望在自动化测试中拥有更直观的主张。我有一个断言来验证是否显示错误消息,这让您有点头疼。
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 and False使我感到困惑:D