Here is the code :
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
class TCSix {
@BeforeAll
static void setUpBeforeClass() throws Exception {
}
@AfterAll
static void tearDownAfterClass() throws Exception {
}
@Test
void aTestBlankEmailValidation() {
fail("Not yet implemented");
}
@Test
void bTestRegistrationORLogin() {
fail("Not yet implemented");
}
}
Here the bTestRegistrationORLogin()
will run first in place of aTestBlankEmailValidation()
, where as I declared FixMethodOrder
on top.
It is recommended that test methods be written so that they are independent of the order that they are executed
However, for your case, make sure two things: