Created
July 28, 2021 06:05
-
-
Save simple-elf/22d4724a497ffe2ff561c5e6b46ea62e to your computer and use it in GitHub Desktop.
Allure TestOps junit5 ParameterizedTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ParameterizedTest(name = "{displayName}[{0} {1} {2}]") | |
@DisplayName("Выполнение запроса без отправки токена") | |
@MethodSource("allMethodProvider") | |
void noTokenTest(String method, String endpoint, ContentType contentType) { | |
Allure.parameter("method", method); | |
Allure.parameter("endpoint", endpoint); | |
Allure.parameter("contentType", contentType); | |
// OR Allure.label("TMS", testCaseId) | |
} | |
// Когда параметром выступает сложный объект с полями | |
@ParameterizedTest(name = "{displayName}[{index}]") | |
@DisplayName("Выполнение запроса без отправки токена") | |
@MethodSource("allMethodProviderData") | |
void noTokenTest(Object data) { | |
Allure.getLifecycle().updateTestCase( test -> | |
test.setName(String.format( | |
"Выполнение запроса без отправки токена %s %s %s", | |
data.method, data.endpoint, data.contentType )) | |
); | |
Allure.parameter("method", data.method); | |
Allure.parameter("endpoint", data.endpoint); | |
Allure.parameter("contentType", data.contentType); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment