Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation @Param doesn't work with TestNG framework #893

Open
DLukov opened this issue Mar 6, 2023 · 1 comment · May be fixed by #1130
Open

Annotation @Param doesn't work with TestNG framework #893

DLukov opened this issue Mar 6, 2023 · 1 comment · May be fixed by #1130
Labels
theme:testng TestNG related issue type:bug Something isn't working

Comments

@DLukov
Copy link

DLukov commented Mar 6, 2023

Describe the bug
Annotation @param doesn't work with TestNG framework

To Reproduce

  1. Mark data provider parameters with @param annotation
  2. Run test
  3. See allure report
public class AllureParameterizedTest {
    @DataProvider
    public static Object[][] numbers() {
        return new Object[][] {
                {1, 1, 2},
                {2, 2, 4}
        };
    }
    @Test(dataProvider = "numbers")
    public void sumTest(
            @Param("First Number") Integer a,
            @Param("Second Number") Integer b,
            @Param(value = "Result", excluded = true) Integer r) { 

        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;
        });
    }

}

Actual behavior
Params in allure report marked as arg0, arg1, etc.

Expected behavior
Params marked with text from @param annotation

Screenshots
image

Versions:

  • allure-testng 2.13.1
  • testng 7.5
@cheshi-mantu cheshi-mantu added the type:bug Something isn't working label Mar 21, 2023
@sleepstream
Copy link

io.qameta.allure 2.21.0
testng 7.7.0

but in report has correct names of parameters
изображение

but i have flag exclude = true - and it's not working for me

@baev baev added the theme:testng TestNG related issue label Aug 23, 2023
mr-possible added a commit to mr-possible/allure-java that referenced this issue Sep 22, 2024
mr-possible added a commit to mr-possible/allure-java that referenced this issue Sep 22, 2024
mr-possible added a commit to mr-possible/allure-java that referenced this issue Sep 22, 2024
…t-showing-names-in-report

Fix for allure-framework#893 - param annotation name not coming up in report
mr-possible added a commit to mr-possible/allure-java that referenced this issue Sep 22, 2024
mr-possible added a commit to mr-possible/allure-java that referenced this issue Sep 25, 2024
…t-showing-names-in-report

Fix for allure-framework#893 - param annotation name not coming up in report
mr-possible pushed a commit to mr-possible/allure-java that referenced this issue Sep 25, 2024
@mr-possible mr-possible linked a pull request Sep 25, 2024 that will close this issue
2 tasks
mr-possible added a commit to mr-possible/allure-java that referenced this issue Sep 25, 2024
mr-possible added a commit to mr-possible/allure-java that referenced this issue Sep 25, 2024
mr-possible added a commit to mr-possible/allure-java that referenced this issue Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:testng TestNG related issue type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants