forked from allure-framework/allure-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for allure-framework#893 - param annotation name not coming up in…
… report
- Loading branch information
1 parent
3d361dd
commit b85e6ae
Showing
3 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,11 +15,13 @@ | |
*/ | ||
package io.qameta.allure.testng.samples; | ||
|
||
import io.qameta.allure.Step; | ||
import io.qameta.allure.Param; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.DataProvider; | ||
import org.testng.annotations.Test; | ||
|
||
import static io.qameta.allure.Allure.step; | ||
|
||
/** | ||
* @author Egor Borisov [email protected] | ||
*/ | ||
|
@@ -38,13 +40,36 @@ public Object[][] testData() { | |
}; | ||
} | ||
|
||
@DataProvider | ||
public static Object[][] testDataForParamNames() { | ||
return new Object[][]{ | ||
{1, 1, 2, 5}, | ||
{2, 2, 4, 5} | ||
}; | ||
} | ||
|
||
@Test(dataProvider = "testData") | ||
public void parameterizedTest(String param) { | ||
step(param); | ||
} | ||
|
||
@Step | ||
public void step(String param) { | ||
@Test(dataProvider = "testDataForParamNames") | ||
public void sumTest( | ||
@Param(name = "First") Integer a, | ||
@Param(name = "Second") Integer b, | ||
@Param(name = "Third") Integer r, | ||
@Param(name = "Fourth") Integer s) { | ||
|
||
step(("Arrange"), () -> { | ||
step(String.format("Take collection №[%s] of parameters", a)); | ||
}); | ||
step(("Act"), () -> { | ||
step(String.format("Add [%s]", a) + String.format("to [%s]", b)); | ||
}); | ||
step(("Assert"), () -> { | ||
step("Compare the sum"); | ||
assert a + b == r; | ||
}); | ||
|
||
} | ||
} |
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