问题标签 [allure]

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 投票
2 回答
2820 浏览

automated-tests - Allure reports. Screenshots are added to wrong reports using AfterMethod

On my project I have maven and TestNG tools. And I'm trying to add screenshots to Allure reports. If I call the method with "@Attachment" annotation directly from my tests, everything is okay.

But if I call it in "@AfterMethod" part, the screenshots are added to wrong reports and are mixed up.

In both cases screenshots are generated and saved on the disk correctly.

I've already seen the question here: Allure Framework: TestNG adapter incorrectly places @AfterMethod in report

And I guess, my difficulties might be because of TestNG adaptor.

What is the correct way of calling the "@Attachment" method? What adaptor do I have to use in order to avoid this problem? Maybe someone could provide me with example of using ITestListener to make screenshots only if a test is failed?

0 投票
4 回答
657 浏览

java - Use of @Test in JUnit while data driving

I am trying to figure out if something is possible (or if I am being a bit silly.)

I have a very simple Excel sheet - 2 columns, one column is a list of search terms, the second column is a list of expected URLS. I run this via selenium, it will navigate to google, open the Excel sheet, search for the term and if the expected result appears pass the test. It does this for the three rows in the sheet. All good. However, I was hoping to @Test each of the rows - but I can't quite figure out how to achieve this.

Below is the test code, like I said I can't quite get this to work - at present it runs but appears as a single test which has had 3 different searches.

0 投票
1 回答
1743 浏览

java - 使用 Allure 存储多个测试报告

我使用 Jenkins 运行测试,并使用 Allure Framework 生成测试报告。我需要为 Jenkins 上的不同启动保存和切换不同的测试报告,有什么方法/插件可以做到这一点吗?

0 投票
1 回答
3730 浏览

java - 引诱框架:无法使用 @Step , @Parameter 和 @Attachments 注释与 TestNG 和 Maven 已经启用 AspectJ

我正在尝试使用 @Step 、 @Parameter 和 @Attachments 参数,但它们没有显示在报告中,@Title 和 @Feature 工作正常。我的 pom.xml:

下面是我的类 testng.xml 类:

我的Java代码:

公共类 RegisterNewUser 扩展 OpenAndCloseBrowser {

我已经彻底搜索了包括 Allure 官方网站上的文档,但我找不到解决方法。

0 投票
2 回答
4319 浏览

java - 如何为 Allure 附件标题插入变量名称,例如步骤或方法名称?

我正在为 Java 项目使用 Allure 测试框架。在定义附件名称时,我只允许在注释中使用常量。

例如:

参考value,如果我将其用于多个步骤,它们将始终以标题出现在报告中My Screenshot

我怎样才能使它像 Allure@Step注释那样更具动态性,即在字符串中使用诸如{0}和方法名称之类的参数{method}

0 投票
1 回答
282 浏览

nunit - 如果从 TeamCity 的命令行运行测试,则会形成错误的 Allure 报告

我遇到了以下问题:我使用 TeamCity 的命令行通过 NUnit 控制台运行测试。在输出中,我得到了错误的 Allure 报告:错误的状态并且没有错误截图。如果通过 cmd 手动运行,则正确生成报告。这个问题有什么解决办法吗?

引诱日志:

在此处输入图像描述

0 投票
1 回答
643 浏览

jenkins - Jenkins 使用 Allure 框架构建健康阈值

我开始在 Jenkins 中使用 Allure Framework Plugin,并且想知道如果测试用例失败的数量低于 5%,是否有办法将构建标记为成功。我认为为此,我需要使用 XUnit 插件,但我想知道是否有人之前设置过它。

0 投票
2 回答
5502 浏览

java - Selenium 中的 Allure AShot() 截图

我正在尝试使用 Allure aShot() 类在我正在处理的网站上截取特定 WebElements 的屏幕截图,下面是我在 selenium 中使用的代码来实现它。请访问此链接,其中显示了 aShot() 项目文档:

https://github.com/yandex-qatools/ashot

所以我的问题是,这些 WebElement 的 Ashot() 屏幕截图实际保存在哪里?我使用 testNG 执行以下方法并成功生成了魅力报告,但我在这些报告或我的框架中的任何地方都看不到这些屏幕截图。请检查下面的代码,很难确定这些图像的位置。

再说一次,我的基本问题是:我们如何指定 selenium 将 WebElement 的这些 AShot() 屏幕截图存储到我们想要的特定文件中?

我尝试将下面提到的 Screenshot 类转换为 BufferedImage 或 TakesScreenshot 类,并使用 ImageIO.write 或 FileUtils.copyFile 方法将这些图像复制到一个文件中并将这些图像存储在那里,但我收到一条错误消息,例如,“java .lang.ClassCastException: ru.yandex.qatools.ashot.Screenshot 无法转换为 org.openqa.selenium.TakesScreenshot”,我也尝试了其他方法,但均未成功。

请帮我解决这个问题,我们如何知道/指定这些 AShot() 屏幕截图的保存位置?

0 投票
0 回答
818 浏览

selenium - 引诱报告断言中多个浏览器故障的问题

我有一个测试在 Firefox 和 Chrome 中都失败了。执行顺序是先Firefox,后Chrome。但是在 Allure 报告中,当我单击测试套件时,它仅显示 chrome 的断言错误。(Assertion Error: For value: chrome)仅显示。对于 Firefox,它不显示。

我正在使用 JUnit Maven 配置。用于生成报告的 Allure cli。倾城版 1.4.11。

0 投票
1 回答
4033 浏览

java - 在运行时设置 Allure 结果目录

我们如何更改Allure xml reports生成的文件目录?

我想在运行时更改它。

我正在使用 java 8 和 TestNG。