Test methods

Test methods can have unique names, generic names, or really any name that tells the user something about what it is testing. But there are some important aspects of the method names to consider.

First, if a sequential numbering scheme is used, then it forces TestNG to run in a particular order and the priority attribute is not required.

Second, it makes sense to include a functional area and action in the name as well. So, if creating Create, Read, Update, and Delete (CRUD) tests for the Google Mail functional area of the application, we can name them:

  • tc001_gmailCreateAccount
  • tc002_gmailReadAccount
  • tc003_gmailUpdateAccount
  • tc004_gmailDeleteAccount

To build upon the RockBandsTest.java class, here are the methods following a similar naming convention:

/**
* Rock Bands Test Class
*
* @author Name
*
*/
public class RockBandsTest {

// test methods
@Test
public void tc001_getBandInfo() throws Exception {
....
}

@Test
public void tc002_getBandInfo() throws Exception {
....
}

}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.122.162