TM4J Cloud Reporter for Cypress.io
npm install cypress-tm4j-reporter``shell script`
$ npm install cypress-tm4j-reporter --save-dev
Not recommended for use. See Known Issues.
Example: cypress.json`json5`
{
"projectId": "cypress-example",
"reporter": "cypress-tm4j-reporter",
"reporterOptions": {
"baseUrl": "https://api.tm4j.smartbear.com/rest-api/v2",
"authToken": "[READACTED]",
"projectKey": "AQA"
}
}
Programmatic execution example:
cypress-cli.js`js
const cypress = require('cypress')
const {Tm4jUtils} = require('cypress-tm4j-reporter')
cypress.run({
spec: './cypress/integration/example.spec.js'
}).then(results => {
let tm4jutils = new Tm4jUtils(results.config.reporterOptions)
tm4jutils.publishCypressCliResults(results).then(testRuns => {
console.log("TM4J results published")
testRuns.forEach(run => {
console.log(run)
})
})
})
``shell script`
$ node cypress-cli.js
Following reporter options are available:
- baseUrl - base URL for API calls https://api.tm4j.smartbear.com/rest-api/v2
Example: authToken
- - Auth Token for TM4J for Cloud projectyKey
- - Jira project key for test cases and test cyclesdefaultTestCaseFolderId
- - Folder ID for automatically created test casescreateTestCases
- - create new test case if existing test case key not foundcreateTestCycles
- - create new test cycle if existing test cycle key not foundspecMapping
- - define how *.spec.js files mapped to TM4J entitiesv execution
Example: , cyclecycleName
- - test cycle name for specMapping=executionenvironmentProperty
- - populate Environment for execution with value from property with set name environment
Example: (cypress run --env "environment=envcode")debugOutput` - debug output for reporter
-
- Issue with asynchronous reporters in Cypress:
Mocha reporter exits before async tasks complete #7139