gpt4 book ai didi

java - Allure @Step 未出现在 allure 报告中(Selenide TestNG Gradle Allure)

转载 作者:行者123 更新时间:2023-12-02 04:50:32 26 4
gpt4 key购买 nike

帮助解决以下问题:通过命令 ./gradlew luma_magento_ui: test 进行测试运行报告生成成功,但测试用例中没有出现Step。

   @Step("registration user")
public Response registerNewUser(Customer customer) {
return setup()
.body(customer)
.when()
.post("/rest/V1/customers");
}

构建.gradle

 buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "io.franzbecker:gradle-lombok:2.1"
classpath "io.qameta.allure:allure-gradle:2.5"

}

}

subprojects {
apply plugin: 'java'
apply plugin: 'io.franzbecker.gradle-lombok'
apply plugin: 'io.qameta.allure'

test{
useTestNG()
}

allure {
version = '2.7.0'
configuration = 'compile'
}
repositories {
jcenter()
}
dependencies{
compile group: 'io.qameta.allure', name: 'allure-testng', version: '2.12.1'
compile group: 'org.testng', name: 'testng', version: '6.14.3'
}


}

项目 - https://github.com/dissid/luma_magento

最佳答案

我做了一个类似的示例,该示例运行正常,并且步骤包含在报告中。请看一下代码:

import static io.qameta.allure.Allure.step;

@Test
public void test1_login () throws TestException {

step("Login to app");
LoginPage loginPage = new LoginPage(super.driver,20);
loginPage.login();

step("Open main page");

step("Logout from the app");

}

关于java - Allure @Step 未出现在 allure 报告中(Selenide TestNG Gradle Allure),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56446599/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com