2

I recently started using QAF Java framework for testing. I really liked there dashboard which is detailed and attractive. However, I unable to utilize most of framework due to limited knowledge and documentation in Qmetry website.

How to place checkpoints as shown in the screenshot below? Kindly explain with basic examples.

Screenshot from Qmetry documentation

I've tried searching for this but I didn't get clear understanding.

James Z
  • 12,209
  • 10
  • 24
  • 44
Satish A
  • 83
  • 6

2 Answers2

2

Assertion and verification in the test case are checkpoints. Each checkpoints will be found in report. If it is UI test, it will automatically attach screenshot with each checkpoint message. You can refer documentation for Assertion/Verification.

EDIT:

Steps are also considered as Checkpoint. When there is a step call all checkpoints (step/assertion/verification) inside it will become sub checkpoint. Step is any java method annotated with @QAFTestStep for example:

@QAFTestStep(description = "search for {term}")
public static void searchFor(String searchTerm) {
   $("name=q").sendKeys("test");
   $("searchpage.searchbtn.loc").click();
}

When step called it will be reported as checkpoint. Step can be called in test case or in feature file. Below is sample testcase in feature file:

Scenario: SampleTest
   Given get '/'
   When search for 'qaf github infostretch'
   Then verify link with partial text 'qaf' is present

Below is sample test case in java

@Test
public void testGoogleSearch() {
    get("/");
    searchFor("qaf github infostretch");
    $("partialLink=qaf").verifyPresent();
}

Regardless of test case in java or in bdd, report will be same.

Another way to create dynamic step in test written in java is using runtime is using runtime scenario factory.

public void testWithGivenWhenThen() {
    scenario().
    given("a precondition",()->{
        //write appropriate code...
    }).
    when("some action performed",()->{
        //write appropriate code...
    }).
    then("it should have expected outcome",()->{
        //write appropriate code...
    }).
    execute();
} 
user861594
  • 5,733
  • 3
  • 29
  • 45
1

You can also use Reporter class to add checkpoints. Refer below code snippets.

import com.qmetry.qaf.automation.util.Reporter;

//Checkpoint with message
Reporter.log("you message");

//Checkpoint with message and screenshot
Reporter.logWithScreenShot("you message");

//Checkpoint with message types
Reporter.logWithScreenShot("you message", MessageTypes.Info);

Reporter class must be imported from com.qmetry.qaf.automation.util package.

Amit Bhoraniya
  • 621
  • 3
  • 14