【发布时间】:2021-11-24 19:24:48
【问题描述】:
我正在使用带有 selenide 的 cucumber,当我在 Selenide 配置和运行场景中添加 assertionMode = SOFT 时,我收到此错误。
您必须使用 https://github.com/selenide/selenide/wiki/SoftAssertions 中记录的 JUnit4/JUnit5/TestNG 机制配置您的类
看来我应该在 before 和 after 方法的钩子中使用 ErrorsCollector。
我在 hooks 包中设置了驱动程序,并在方法之前设置了 selenide 功能。
谁能告诉我在哪里以及如何使用ErrorsCollector?
或者还有别的什么?
【问题讨论】:
-
如何运行测试?你用的是哪个跑步者?您是否还在
openBrowser中设置了软断言? -
@AlexeyR。我通过功能文件运行我的测试。 Runner 是 TestRunner 类: (@RunWith(Cucumber.class) @CucumberOptions(features = "src/test/resources/features", glue = {"hooks", "steps"},) 软断言设置: assertionMode = SOFT