简体   繁体   中英

What is the equivalent of Cucumber BDD scenario examples feature in JUnit 5 (JUnit Jupiter)?

How do I setup my test class so I can run the same set of tests for multiple scenarios using JUnit 5? For example, I need to run the same test case for different user accounts by passing the account usernames into login text field as a parameter on the test case level. I am moving away from Cucumber BDD to JUnit 5 and in my Cucumber BDD test framework this has been done using the Cucumber scenario examples. If JUnit 5 provides such a feature, a simple code example would be appreciated.

If I understand you correctly you want to run your tests with different sets of parameters (in your case users). Fort that you can have a look at Parametrized Junit Tests . Some examples (I don't have any affiliation with them)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM