我在noraUI源代码中看到了下面的步骤
@And("I expect to have {page-element} with the text {string}(\\?)")
public void expectText(Page.PageElement pageElement, String textOrKey, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException {
this.expectText(pageElement, textOrKey, new Object[0]);
}我想使用此步骤,但无法传递此步骤的{page-element}。它应该是什么样的?
根据doc,我看到它应该以$开头,但是这个步骤在特性文件中没有定义。
发布于 2022-11-22 16:26:14
像这样的东西怎么样?
@And('I expect to have $pageElement with the text $string
public void expectText(String pageElement, String string) {
// code to check if the pageElement exists and if it matches the string
}发布于 2022-11-23 17:20:58
在阅读了文档之后,我们仍然无法在黄瓜文件中传递对象,因为步骤将被标记为“未定义”,noraUI有自己的步骤解析器,如果我在我的特性文件中编写这个步骤:当我单击noraUi时,这个步骤将在noraUi中定义,这个pageObject将从nora的.ini文件中解析
https://stackoverflow.com/questions/74444435
复制相似问题