lundi 30 novembre 2020

JUnit 4 Test Execution in the order how they are programmed in class

I am using JUnit and RestAssured create API tests.

I was wondering if there is a way to execute test cases in the order how they are written in the class file. Currently when I execute them it seems random.

I tried @TestMethodOrder(MethodOrderer.OrderAnnotation.class) and adding @Order(xy) into the tests but I think that this didn't help me.

Just to describe my problem:

I have multiple tests in the following order in the class: Post tests, Get Tests, Delete tests. As you may already know I want Delete tests to be executed as very last.

Is it possible to do it somehow?

Thanks

Aucun commentaire:

Enregistrer un commentaire