Skip to content

Amrrx/testcafe_unified_reporter

Repository files navigation

testcafe-reporter-unified

This is the Unified reporter plugin for TestCafe.

Version - 1.4

  • Fix a minor bug in reporting missing metadata
  • Added the ability to mention the missng metadata in fixture and testcase

Version - 1.3

  • Generate testrail report from testrail pre-created report templates

Version - 1.2

  • Create test run on test rail for each tested fixture
  • Create defect on jira with the assigned meta data based on the testcase result
  • Create allure report
  • Simple command line reporter

Install

npm install testcafe-reporter-unified

Instructions

  • Create a (reporterconfig.json) file in your test project root folder with the following structure
{
      "auth": {
         "testRailBaseURL": "",
         "railUsername": "",
         "railPassword": "",
         "jiraBaseURL": "",
         "jiraUsername": "",
         "jiraPassword": ""
      },
      "metaConfig": {
         "projectMeta": "Project_Name",
         "suiteMeta": "Suite_Name",
         "milestoneMeta": "MileStone_Name",
         "testcaseID": "testcase_ID",
         "componentMeta": "targetComponent",
         "projectKeyMeta": "jiraProjectKey",
         "priorityMeta": "testPriority",
         "severityMeta": "testSeverity",
         "labelsMeta": "testLabels",
         "fixtureIDMeta": "fixtureID",
         "parentMeta": "USER_STORY"
      }
   }
  • Specify the empty strings with the required values
  • Change the meta data key names if you want

Usage

Add the required meta data to your fixture function and testcase function as the following example.

If you have changed the meta keys in the config files, you should also apply this change in your test project.

fixture`login Module`.meta({fixtureID:"F1", jiraProjectKey: "testProject", Project_Name: "Test Project", Suite_Name: "Test Web Suite", MileStone_Name: "Testcafe Integration" })
test.meta({ testcase_ID: "C15100", targetComponent: "Automation", testPriority: "High", testSeverity: "Critical", testLabels: "SystemTest"})

When you run tests from the command line, specify the reporter name by using the --reporter option:

testcafe chrome 'path/to/test/file.js' --reporter unified

When you use API, pass the reporter name to the reporter() method:

testCafe
    .createRunner()
    .src('path/to/test/file.js')
    .browsers('chrome')
    .reporter('unified') // <-
    .run();

Author

Amr Aly @ 2021

Unified_Reporter

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published