jeudi 21 septembre 2017

Rerun test within another test

@Test
public void createUser() {
   //perform MVC post user
}

@Test
public void deleteUser() {
   //perform MVC delete user
}

@Test
public void deleteUserByUsername() {
   //perform MVC delete user
}

In deleteUserByUsername() I want to run the createUser again since user is already deleted. I can easily accomplished this by abstracting the createUser() code to a private method. What is the best practice for this kind of situations or if testng has a standard way of dealing with this?

Aucun commentaire:

Enregistrer un commentaire