Test Method

Structure

  • Test methods are compromised of test steps

  • Test steps are compromised of

    • Step comment

    • Data object

    • Panel action

    • Verify_Login_Test.java
      TestLog.When("I login with admin user");
      UserObject user = UserObject.user().withAdminLogin();
      app.webApp.login.login(user);

Step Comments

  • Verify_Login_Test.java
    TestLog.When("I login with admin user");
  • Comments follow the Gherkins natural language model

  • These comments are displayed in the extent test report

  • Options are: Given, When, And, Then, But, Background

Data Objects

  • Data objects describe the data we want to use in the actions

  • Verify_Login_Test.java
    UserObject user = UserObject.user().withAdminLogin();
  • Refer to Test Object section for more info

Panel Action

  • Actions refer to methods described in Panel classes

  • app.webApp.login.login(user);
  • Syntax: app.<module>.<panel>.<action>

  • We can call any of the modules and actions in our test environment

  • This allows for cross platform and cross application testing

  • eg. testing android and web together in one test method