I have 3 test cases i.e. 1 2 3. How will i give priority as 2 1 3 while executing maven command.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume you want to do it because you need some prerequisition prior the test can be run. You can do it by
@BeforeAnnotation prior the actual testcase, or you can call other tests from the test method.Say,
testClient()test will test and verify that new client can be added to the system. Then you can do this:In that case you have assured that prerequisites are fullfilled and dont have to worry much about the testcases order
EDIT
I think I understand your needs, because I am in quite similar situation. How I solved it:
For
createI have special class, which can create me a data and return needed data. So, i have something like:And my class to solve the create is something like this
Its just an outline – but basically, I have these “crucial” entities as standalone objects, called by the test class. Inside test, i verify everything throgh getters. Like: