Test, Naming Convention - epam/Gepard GitHub Wiki

Test Class Name

The Name format is a free text to describe the purpose of the TC in short format. ( Sample:  Basic Sign In )

  • Writing one Test Class per Test Case is the preferred and default approach. Implement more than one Test Case in one Test Class only, if the TCs are designed to be used in this form.
  • Give meaningful and descriptive names like LoginToApplicationTest, this is often similar to the title of the corresponding Test Case Set documentation. The best is to use the name of the implemented TC. (Sample: BasicSignInTest.java) Note: If you put more than one TC into a single class, you should find a descriptive name for it.

Mandatory @TestClass annotation for the Test Class

  • The form is @TestClass(id = "TEST_SCRIPT_ID", name = "TEST_SCRIPT_NAME")
  • TEST_SCRIPT_ID - Set it as Test Script Group ID of the implemented TC (grouping is up-to-you)
  • TEST_SCRIPT_NAME - Set it as Test Script Name

Note: Gepard's data driven test approach means that all test methods within a test class will use the same set of test data. If the test methods need to use not the same set of test data, then your implementation is wrong (and the class should be split).  

Sample:

  • TC Name in your test management system: Basic Sign In
  • Test Class Name: BasicSignInTest.java
  • TEST_SCRIPT_ID = "AccountHandling" (Assuming that in your test management system the similar TCs are grouped into this group)
  • TEST_SCRIPT_NAME = "Basic Sign In"

Note: If you implement more than one TC into a single Test Class, then set this value to the Test Class name, but in a more readable format, sample: TClass: UserAccountMainFlowsTest.java then the TEST_SCRIPT_NAME = "User Account Main Flows"

Test Method names within the Test Class

Mark the method with JUnit @Test annotation, otherwise the framework (i.e. JUnit) will not run it. This means that you can create as many methods as you like in a test class, allowing for separation of util methods from the test methods.

Constants

If you need a constant in your test case or helper, use the static final modifier and the variable name should be uppercase letters with underscores.