问题标签 [thucydides]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
3932 浏览

intellij-idea - “为了运行故事文件,您需要首先在 JBehave 设置中设置一个主类” intellij

我第一次使用 intellij 来使用 jbehave。我已经将一个预先存在的 maven jbehave 项目导入到我的 intellij IDE 中。当我尝试使用“运行故事”命令运行它时。我收到错误“为了运行故事文件,您需要首先在 JBehave 设置中设置一个主类”

有人能告诉我为什么我会收到这个错误吗?

0 投票
1 回答
342 浏览

cucumber - 在 Serenity 中的报告之间导航时遇到问题

我可以使用 gradle 运行 serenity 测试用例。我使用命令$ gradle clean test aggregate。报告也会生成,但是当我单击报告中提供的链接时,它无法导航并给出错误消息。我已经创建了下面链接中提到的包结构。 http://thucydides.info/docs/articles/an-introduction-to-serenity-bdd-with-cucumber.html 但是我仍然无法解决这个问题。下面是我的 Runner、Step 定义和存储库类。跑者类:

步骤定义类:

存储库类

你能帮我解决这个问题吗?提前致谢

0 投票
1 回答
546 浏览

internet-explorer - 在修昔底德中为ie驱动设置路径不起作用

在我的 thucydides.properties 文件中,我有以下内容:

chrome 工作正常 Internet Explorer 没有。为了让 ie 运行,我必须在我的测试中手动设置系统属性。

未能创建新的 WEBDRIVER_DRIVER 实例

有没有人知道为什么一个会起作用而另一个不起作用?

创建驱动程序的位置

0 投票
1 回答
1912 浏览

java - BDD:带有 serenity 和 jbehave 的嵌入式表

我正在尝试使用 jbehave 扩展创建一个带有宁静(前修昔底德)的 BDD 测试,这是我的故事(源自宁静的 jbehave 示例)

生成的java代码如下:

如何在我的测试中检索表参数?

我试过了ExamplesTable按照关于 jbehave 表格参数的文档尝试了参数,但没有奏效。

有没有办法使given注释更具可读性(通过不添加表参数)?

0 投票
1 回答
661 浏览

java - 执行 serenity selenium 脚本时出现错误:net.serenitybdd.core.pages.WebElementFacadeImpl$

使用 maven3 和 Serenity Runner 执行 selenium 脚本时出现错误:net.serenitybdd.core.pages.WebElementFacadeImpl$

我收到错误的语句: element(createButton).waitUntilVisible();

waitUntilVisible 导致错误定义为“net.serenitybdd.core.pages.WebElementFacade.waitUntilVisible()”

请帮我解决错误。

0 投票
1 回答
773 浏览

cucumber-jvm - 在 Cucumber-JVM 中排序执行功能文件

我正在Serenity使用Cucumber-JVM. Serenity有助于在执行后生成测试报告。

由于默认情况下功能文件是按字母顺序选取的,因此报告也是按此顺序排列的。

是否有任何解决方法可以按照在文件夹Cucumber-JVM中创建的顺序来获取/features文件?

0 投票
2 回答
3021 浏览

java - 如何使用元过滤跳过同一故事中的特定/个别场景?

在使用 JBehave/Thucydides 进行 bdd/测试时,我想跳过某些我知道暂时起作用的场景。最终,我想重新运行整个测试套件。然而,随着我的开发,重新运行旧测试只是为了获得我编写的新测试需要太多时间。

这是我正在谈论的一个例子:

loggingIn.story

我知道第一个场景有效,当我使用 JUnit 运行故事时,如何跳过它而不是重新浏览它?

从 JBehave 网站链接 Meta Info , Meta Filtering

我收集到我可以做以下事情:

loggingIn.story

然后在将测试作为 JUnit 测试用例运行时,我传递了一个 jvm 参数,如下所示 -Dmetafilter="+ignored"

但是,这会跳过这两种情况,而不仅仅是第一种。

0 投票
0 回答
194 浏览

java - 识别找到的 xpath WebElement 的对象类型

我有一个包含几个不同输入字段和类型的对话框,如果该字段是,我想根据输入字段前面的书面名称进行检查

  1. 提出了
  2. 只读

困难在于我要检查不同类型的输入:

  1. 输入
  2. 文本区域
  3. div
  4. 选择

所以 HTML 就像:

我的方法只获取字段前面的名称,以及是否应该显示它并且是只读的:

我的 xpath 返回任何类型(可能是 div、select、input 等)....有没有一种很好的方法来找出类型WebElement?我考虑过查找类型,然后执行一些 if/else 语句<input>来检查状态,具体取决于输入类型,例如 for 类型元素是可写的。clear()sendKeys("..")

还是他们有任何其他可能的解决方案?

0 投票
1 回答
704 浏览

android - 如何在 serenity-bdd 框架中使用 appium 来使用 Androiddrier?

我正在使用 serenity-bdd 和 cucumber-jvm 作为我的测试框架。我想使用 Appium 在 android 模拟器上运行我的测试。

Serenity-bdd 默认实例化打开 Firefox 的 webdriver。如何在 android 模拟器上执行我的 webdriver 测试?

0 投票
1 回答
1464 浏览

java - Best practice on exception and error handling with Selenium and SerenityBDD (thucydides)

Actually I'm writing a bunch of tests but I'm not sure how I should handle exceptions/errors best.

There a different types of exceptions, e.g. AssertException if a result was not as expected using assertThat(..). This is O.K. and understandable.

But what if I have a FileNotFound / SOAPException / DOMException and so on...?

For example in my @BeforeStory method I create some testdata by reading testfiles and sending them to a webservice and there I could possibly get the above mentioned exceptions. I would like to present these errors by using an own error message also in the living documentation. But how should I manage this? Actually I'm thinking about two approaches:

1.) I catch the exception and throw my own new exception with an individual error message. The testexecution is aborted for the scenario and the exception is presented in the living documentation.

2.) I catch the exception, implement a string based return statement with the error message and use an assertThat(...) in my low-level specifications so I only should get AssertException in the end.

3.) ..?

Question: And advice or common best practices how to handle exceptions or errors with selenium/serenity ?