allure-framework / allure1

Allure 1 isn't supported any more, please consider using Allure 2 https://github.com/allure-framework/allure2 instead
Apache License 2.0
712 stars 169 forks source link

regarding multiple testcase ids #799

Closed hemanthsridhar closed 8 years ago

hemanthsridhar commented 8 years ago

Can I give multiple test case IDs. Because I am not able to use @TestCaseId("","",""). Just like how we give multiple Issues I feel it is better to have @TestCaseId as an array. Or if there is a way to do it, please help me out.

baev commented 8 years ago

Hi there!

Currently Allure doesn't support multiply test IDs. Could you please explain in more details why did you need such feature?

volkovs commented 8 years ago

Linking similar issue #773

hemanthsridhar commented 8 years ago

@baev Hi bro. I need this feature because, sometimes I write a method which handles multiple test cases. Hence I need to give what test cases the particular method covers.(Trust me it is pretty much needed). Also, I would like to add that if I am using testng parameters and I give multiple test IDs(assuming you will agree to do this) the test case id should map to test data set.

Eg : @TestCaseId("001","002","003")

 @Test(I will read the data from the data provider)
public void testForAllure(String username,String password)
{
sysout("username")
sysout("password")
}

From the data provider I read data sets

{'hemanth','sridhar'},
{'yo','yo'}
{'bla','bla'}

In the report testForAllure[hemanth,sridhar] should have 001 as test case ID testForAllure[yo,yo] should have 002 as test case ID testForAllure[bla,bla] should have 003 as test case ID

thasherwin commented 8 years ago

You can put your test case id if you want to in your data provider.

@TestCaseId("{0}")
    public void test(String testcase,String usernaame, String password){
}
hemanthsridhar commented 8 years ago

That's nice. Thank you :).

hemanthsridhar commented 8 years ago

But then again. I wish to have @Test case Id being multiple

hemanthsridhar commented 8 years ago

Any update on this?

irushah commented 8 years ago

Placeholder in TestCaseId does not work. It shows as String Test ID: {0} in the report.

I am looking for a similar feature. I have manual tests for each dataset and there is no way to tag each test case with these multiple testIds.

hemanthsridhar commented 8 years ago

@irushah when you are doing the same solution given by @thasherwin right? meaning reading from data provider

irushah commented 8 years ago

@hemanthsridhar Yup, exactly, i am reading the first parameter from data provider Eg: For @TestCaseId("{0}") where first param is testcaseId = 123 below

@DataProvider(name = "dataset")
    private Object[][] getDataSet() {
        return new Object[][] {
                { "123" , "username", "password"},
            };
}
hemanthsridhar commented 8 years ago

i am having the same problem too. @thasherwin

thasherwin commented 8 years ago

I checked also and it those not work indeed. I would expect this to work. Guess an issue or this was never implemented

baev commented 8 years ago

Closed as duplicate (see #773)