Test using QMetry Automation Framework

Introduction

QMetry Automation Framework is designed to solve common industry problems related to testing complex web systems. The framework is best suited for writing Automated Web, Mobile Web and Mobile Native Application UI Tests simulate real user activities on the page. The framework is built upon java and integrates TestNG, Selenium/Webdriver, Appium and Perfecto. 

Due to the framework’s thorough design, test developer does not need to worry about common tasks such as thread safe browser session for running test in parallel, reporting or to incorporate result with test management tools. The tests run can be configured through standard testing configuration files, the test run filters and behavior can be changed within the config File.

Import Test Results generated from .feature file

QMetry uses following tags of QAF output result file to create Test cases and Steps.

Test Case TagTest Step Tag
methods > metadata > Name PropertycheckPoints


Supported file types : ZIP

Sample Test Result File

Click to download a sample file: Feature json.zip


Meta-info.json


→ “Skip” status in the automation result file will be applied as "Not Applicable" instead of "Not Run" for automation test executions upload into QMetry.

Test Case Reusability and Requirement Linkage

While importing test result file, if you want to reuse Test Case and Requirements here are the annotations that need to be provided in the feature file. 


KeywordDescription
@testEntityKey
  • If the executed test steps match with the steps and summary of any version of the existing test case, then the existing test case version (i.e. testEntityKey) will be reused and updated.

  • If the executed test steps do not match with the steps of any version of the existing test case, then a new version of the test case (i.e. testEntityKey) will be created.

  • In the absence of the defined test case key (i.e. testEntityKey):

    • If the executed test steps match with the steps and summary of any version of the existing test case, then the existing test case version will be reused.

    • If the executed test steps do not match with the steps and summary of any version of the existing test case, then a new test case will be created.

  • If an invalid/archived test case entity is passed through the result XML file:

    • If the executed test steps match with the steps and summary of any version of the existing test case, then the existing test case version will be reused.

    • If the executed test steps match with the steps and summary of any version of the existing test case, then a new test case will be created using that <class>.

  • Multiple test case keys (i.e. testEntityKeys) can be defined for a single scenario, which will update/create multiple test cases for that single scenario and link these test cases with an automated test suite.

@requirementKey
  • Created/Linked Test Case will be linked to Requirement Key.
  • Multiple requirementKey can be used in the same tag in the file to link multiple requirements to the test cases. e.g.

"requirementKey": "FIT-RQ-813 FIT-RQ-814 JA-RQ-816 FIT-RQ-81378"
  • Users can also link cross project requirements to the test case.

    • Users should have access to the cross project.

    • The user role should have the "Link" permission for Test Case and Requirement modules.

  • If multiple test case keys are mentioned, then the multiple requirements will be linked individually with the test cases.

Note: In scenarios where a manual test case is reused, the test case result will be updated. The test case version will increase by 1 due to changes in test steps. This particular test case version will be automated test case. The earlier version of the test case will remain manual.

Feature: Login To Test Management

@requirementKey:AIPJG-RQ-107
@testEntityKey:AIPJG-TC-128
Scenario: Login to QMetry Test Case 1

   Given get "https://testmanagement.qmetry.com"
   When wait until "text.username." to be enable
   And clear "text.username."
   And wait until "text.username." to be enable
   And sendKeys "lizamathew" into "text.username."
   And wait until "password.password." to be enable
   And clear "password.password."
   And wait until "password.password." to be enable
   And sendEncryptedKeys "xxxxxxx" into "password.password."
   And wait until "text.organization.code" to be enable
   And clear "text.organization.code"
   And wait until "text.organization.code" to be enable
   And sendKeys "IKO031" into "text.organization.code"
   And wait until "button.login" to be enable
   And click on "button.login"
   And wait until "span.caret" to be enable
   And click on "span.caret"
   And wait until "link.log.out" to be enable
   And click on "link.log.out"
   And wait until "button.yes" to be enable
   And click on "button.yes"
   
@requirementKey:AIPJG-RQ-94
@testEntityKey:AIPJG-TC-120
Scenario: Login to QMetry Test case 2
	
   Given get "https://testmanagement.qmetry.com"
   When wait until "text.username." to be enable
   And clear "text.username."
   And wait until "text.username." to be enable
   And sendKeys "johnkenneth" into "text.username."
   And wait until "password.password." to be enable
   And clear "password.password."
   And wait until "password.password." to be enable
   And sendEncryptedKeys "xxxxxxxx" into "password.password."
   And wait until "text.organization.code" to be enable
   And clear "text.organization.code"
   And wait until "text.organization.code" to be enable
   And sendKeys "IKO031" into "text.organization.code"
   And wait until "button.login" to be enable
   And click on "button.login"
   And wait until "span.caret" to be enable
   And click on "span.caret"
   And wait until "link.log.out" to be enable
   And click on "link.log.out"
   And wait until "button.yes" to be enable
   And click on "button.yes"

Import Test Results generated from .bdd file

 Click here to expand...

Here is how you can specify the Test Cases and Test Steps which will be created in QMetry as a part of the result files -

Test Case TagTest Step Tag
methods > metadata > Name PropertycheckPoints


Supported file types : ZIP

Sample Test Result File

Click to download a sample zip file: bdd json.zip


Meta-info.json


Test Case Reusability and Requirement Linkage

While importing test result file, if you want to reuse Test Case, here are the annotations that need to be provided in the bdd file.

KeywordDescription
testEntityKey
  • If the executed test steps match with the steps of latest version of existing test case, then the existing test case (i.e. testEntityKey) will be updated.
  • If the executed test steps do not match with the steps of latest version of existing test case, then a new version of the test case (i.e. testEntityKey) will be created.
  • In the absence of the defined test case key (i.e. testEntityKey), a new test case will be created.
requirementKeyCreated/Linked Test Case will be linked to Requirement Key

Note: In scenarios where a manual test case is reused, the test case result will be updated. The test case version will increase by 1 due to changes in test steps. This particular test case version will be automated test case. The earlier version of the test case will remain manual.



Another option is added to the Java test file to reuse test cases in QMetry.




Import Execution Attachments

The feature/bdd file is imported into QMetry by scheduling automation for test suite using QAF. During the test case creation and import of results, screenshots can be attached as reference or for the failed automation results. After import, the QAF attachments at checkpoint and sub-checkpoint level will be linked to test case step level on the execution screen in QMetry. These step level attachments can be downloaded from that particular step on the execution screen. For the failed steps, the message of sub-checkpoint is shown as Trace for that step on the execution screen.

To add attachments in test run execution through QAF, enable capturing screenshots in QAS. After that you will get folder with all screenshots of automation testing.

Provide zip file containing that output folder of screenshots and json output folder.


The relative path of screenshots will be referred from "checkpoints > screenshots" and "checkpoints > subCheckPoints > screenshots" to find the attachment at the relative path in the zip file that is being uploaded.


For example,

If the screenshot path is ../img/TC_11.png, then the file name with TC_11.png should be available in img folder in the zip file at root level.


Sample Project: https://github.com/qmetry/qas-java-example