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

How can i use different test data for multiple test methods inside a test class? #1517

Closed
skaluva opened this issue Jan 10, 2019 · 6 comments
Labels

Comments

@skaluva
Copy link

skaluva commented Jan 10, 2019

hi,
I want to use different test data for different test methods in serenity. In straight junit, i could find various alternatives. But in serenity, im not able to find a way to do it. My scenario:
TestClass
Test Method 1 with test data 1
Test Method 2 with test data 2

@testdata
public static Collection<Object[]> testData() throws IOException{

}

Tried to use SerenityParameterizedRunner but each test method executes with all test data, which is causing failures during execution.

Please suggest.

@wakaleo
Copy link
Member

wakaleo commented Jan 10, 2019

What would you do in plain JUnit?

@skaluva
Copy link
Author

skaluva commented Jan 10, 2019

@wakaleo there is a plugin available to support my requirement in junit where i can provide test data specific to test method.
https://github.com/TNG/junit-dataprovider

I'm not sure how can i use it with serenity.

@wakaleo
Copy link
Member

wakaleo commented Jan 10, 2019

The Serenity parameterised runner extends the normal JUnit one, which doesn't support this feature. It may be possible when we implement JUnit 5 integration (not sure, haven't checked).

@bahunov
Copy link

bahunov commented Dec 31, 2019

Any update on this?

@kishoreccaus
Copy link

Even I was looking for this option. Sad to hear its not available.

@Saurav6789
Copy link

Any update on this issue ?

@wakaleo wakaleo closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants