...
Code Block |
---|
// cypress.json { "env": { "aioTests": { "enableReporting": true, "cloud": { "apiKey": "<your API KEY>" }, "jiraProjectId": "SCRUM", "cycleDetails": { "createNewCycle": true, //possible values "true","false","CREATE_IF_ABSENT", true, false "cycleName": "Cypress first run from plugin", "cycleKey": "NVTES-CY-2", "folder": ["Cloud","Smoke Test Nightly"], "tasks": ["SCRUM-1","SCRUM-2] , }, "addNewRuncustomFields": true,[ "addAttachmentToFailedCases": true, { "createNewRunForRetries": true, "addTestBodyToCommentsname": true"Reviewed? [Boolean CF]", } } } |
Server
For Jira Hosted or DataCenter versions, the "hosted"
property needs to be set in the env.aioTests
for authentication.
The "jiraUrl"
needs to be specified with the base URL of the hosted Jira instance.
Authentication is supported either by providing a Jira username and password or by using the Jira PAT. More information can be found on Server Authentication here.
Local Runs: For local runs, either
"jiraUsername" + "jiraPassword"
can be set or one can simply set the"jiraPAT"
value.CI/CD: For CI runs, you can set the
JIRA_USERNAME and JIRA_PASSWORD
orJIRA_PAT
environment variable to pass it externally as a SECRET.
Code Block |
---|
// cypress.json { "env": { "value": "Yes", }, { "name": "Set (Single Select CF)", "aioTestsvalue": {"value":"P1"} "enableReporting": true, }, "hosted" : { { "jiraUrl": "https://jira.yourco.com", "jiraPATname": "PATTeams from(Multi Jira Tokens | JIRA_PAT as environment variable",Select CF)", "jiraUsernamevalue": "Jira Username. If PAT is specified, then username is not required",[{"value":"TeamAlpha"},{"value":"Zeta"}] }, "jiraPassword": "Jira password, required if authentication is through username/password" { }, "jiraProjectIdname": "SERVNumberCF", "value": 0 "cycleDetails": { }, "createNewCycle": true, { "cycleName": "Cypress Nightly Run ", "name": "TextValue CF", "cycleKeyvalue": "SERV-CY-2This can be a long note", "folder": ["Cloud","Smoke Test Nightly"], }, { "tasks": ["SCRUM-1","SCRUM-2] }, "name": "Reviewed Date", "addNewRunvalue": true"2024-08-29T04:38:36.437Z", "addAttachmentToFailedCases": false }, "createNewRunForRetries": false, { "addTestBodyToComments": true } } } |
Cypress 10 and above
For Cypress 10, the settings have moved to the cypress.config.js. Set the above aioTests configuration in the cypress.config.js as below:
Code Block |
---|
module.exports = defineConfig({ env: {"name": "SME [User CF]", "value": "<accountid of user>" "aioTests": { } "enableReporting": true ], }, "cloudrunDetails": { //Replace with server authentication if using Jira Server "customFieldsToUpdate": [ "apiKey": "apikey for cloud" { }, "jiraProjectIdoperationType": "NVTESADD_TO_EXISTING", "cycleDetails": { "createNewCyclename": true"StepOwner", "cycleName "value": [{"value": "Val2"},{"value": "CypressVal1"}] first run from plugin", }, "cycleKey": "NVTES-CY-2", { "folder": ["Cloud","Smoke Test Nightly"], "tasksname": ["NVTES-1Env","NVTES-2 "value": {"value":"UAT"} } ] }, "addNewRun": true, "addAttachmentToFailedCases": "addAttachmentToFailedCases": true, "createNewRunForRetries": true, "addTestBodyToComments": true }, }, e2e: {... }} |
Configurable Values
...
Value
...
Description
...
enableReporting
...
Set to true to make the current run update results to AIO Tests. Default false.
...
jiraProjectId
...
Jira Project key to update results to
...
cycleDetails.createNewCycle
...
Set to true to create a new cycle for run being reported
...
cycleDetails.cycleName
...
Works if createNewCycle is true, sets the cycle name of cycle getting created
...
cycleDetails.cycleKey
...
AIO Tests cycle key that should be updated. Used if createNewCycle is false
...
cycleDetails.folder
...
Folder hierarchy, where first item in array is parent folder and so on eg.["Parent","Child"]
...
cycleDetails.tasks
...
List of Jira Issue Keys to attach as Tasks to created cycle, impacts only when creating new cycle
...
addNewRun
...
Create a new run or update an existing run in the cycle
...
addAttachmentToFailedCases
...
Set to true to attach screenshots, if available, for failed cases
...
createNewRunForRetries
...
Set to true if each retry should create a new run
...
addTestBodyToComments
...
true,
"createNewRunForRetries": true,
"addTestBodyToComments": true,
"parallelBuild":{ //optional
"masterBuild": true,
"waitForSeconds": 10 //defaults to 2 seconds
}
}
}
}
|
Server
For Jira Hosted or DataCenter versions, the "hosted"
property needs to be set in the env.aioTests
for authentication.
The "jiraUrl"
needs to be specified with the base URL of the hosted Jira instance.
Authentication is supported either by providing a Jira username and password or by using the Jira PAT. More information can be found on Server Authentication here.
Local Runs: For local runs, either
"jiraUsername" + "jiraPassword"
can be set or one can simply set the"jiraPAT"
value.CI/CD: For CI runs, you can set the
JIRA_USERNAME and JIRA_PASSWORD
orJIRA_PAT
environment variable to pass it externally as a SECRET.
Code Block |
---|
// cypress.json
{
"env": {
"aioTests": {
"enableReporting": true,
"hosted" : {
"jiraUrl": "https://jira.yourco.com",
"jiraPAT": "PAT from Jira Tokens | JIRA_PAT as environment variable",
"jiraUsername": "Jira Username. If PAT is specified, then username is not required",
"jiraPassword": "Jira password, required if authentication is through username/password"
},
"jiraProjectId": "SERV",
"cycleDetails": {
"createNewCycle": true, //possible values "true","false","CREATE_IF_ABSENT", true, false
"cycleName": "Cypress first run from plugin",
"cycleKey": "NVTES-CY-2",
"folder": ["Cloud","Smoke Test Nightly"],
"tasks": ["SCRUM-1","SCRUM-2],
"customFields": [
{
"name": "Reviewed? [Boolean CF]",
"value": "Yes",
},
{
"name": "Set (Single Select CF)",
"value": {"value":"P1"}
},
{
"name": "Teams (Multi Select CF)",
"value": [{"value":"TeamAlpha"},{"value":"Zeta"}]
},
{
"name": "NumberCF", "value": 0
},
{
"name": "TextValue CF", "value": "This can be a long note",
},
{
"name": "Reviewed Date", "value": "2024-08-29T04:38:36.437Z",
},
{
"name": "SME [User CF]", "value": "<accountid of user>"
}
],
},
"runDetails": {
"customFieldsToUpdate": [
{
"operationType": "ADD_TO_EXISTING",
"name": "StepOwner",
"value": [{"value": "Val2"},{"value": "Val1"}]
},
{
"name": "Env", "value": {"value":"UAT"}
}
]
},
"addNewRun": true,
"addAttachmentToFailedCases": false,
"createNewRunForRetries": false,
"addTestBodyToComments": true,
"parallelBuild":{ //optional
"masterBuild": true,
"waitForSeconds": 10 //defaults to 2 seconds
}
}
}
}
|
Cypress 10 and above
For Cypress 10, the settings have moved to the cypress.config.js. Set the above aioTests configuration in the cypress.config.js as below:
Code Block |
---|
module.exports = defineConfig({
env: {
"aioTests": {
"enableReporting": true,
"cloud": { //Replace with server authentication if using Jira Server
"apiKey": "apikey for cloud"
},
"jiraProjectId": "NVTES",
"cycleDetails": {
"createNewCycle": true, //possible values "true","false","CREATE_IF_ABSENT", true, false
"cycleName": "Cypress first run from plugin",
"cycleKey": "NVTES-CY-2",
"folder": ["Cloud","Smoke Test Nightly"],
"tasks": ["SCRUM-1","SCRUM-2],
"customFields": [
{
"name": "Reviewed? [Boolean CF]",
"value": "Yes",
},
{
"name": "Set (Single Select CF)",
"value": {"value":"P1"}
},
{
"name": "Teams (Multi Select CF)",
"value": [{"value":"TeamAlpha"},{"value":"Zeta"}]
},
{
"name": "NumberCF", "value": 0
},
{
"name": "TextValue CF", "value": "This can be a long note",
},
{
"name": "Reviewed Date", "value": "2024-08-29T04:38:36.437Z",
},
{
"name": "SME [User CF]", "value": "<accountid of user>"
}
],
},
"runDetails": {
"customFieldsToUpdate": [
{
"operationType": "ADD_TO_EXISTING",
"name": "StepOwner",
"value": [{"value": "Val2"},{"value": "Val1"}]
},
{
"name": "Env", "value": {"value":"UAT"}
}
]
},
"addNewRun": true,
"addAttachmentToFailedCases": true,
"createNewRunForRetries": true,
"addTestBodyToComments": true,
"parallelBuild":{ //optional
"masterBuild": true,
"waitForSeconds": 10 //defaults to 2 seconds
}
},
},
e2e: {...
}} |
Configurable Values
Value | Description |
---|---|
enableReporting | Set to true to make the current run update results to AIO Tests. Default false. |
jiraProjectId | Jira Project key to update results to |
cycleDetails.createNewCycle | Options: [true, false, "CREATE_IF_ABSENT"]. Set to true to create a new cycle for run being reported. |
cycleDetails.cycleName | Works if createNewCycle is true, sets the cycle name of cycle getting created |
cycleDetails.cycleKey | AIO Tests cycle key that should be updated. Used if createNewCycle is false |
cycleDetails.folder | Folder hierarchy, where first item in array is parent folder and so on eg.["Parent","Child"] |
cycleDetails.tasks | List of Jira Issue Keys to attach as Tasks to created cycle, impacts only when creating new cycle |
addNewRun | Create a new run or update an existing run in the cycle |
addAttachmentToFailedCases | Set to true to attach screenshots, if available, for failed cases |
createNewRunForRetries | Set to true if each retry should create a new run |
addTestBodyToComments | Set to true test script body should be added as a comment in a failed case |
runDetails.customFieldsToUpdate | List of run level custom fields. Options in example above. |
customFieldsToUpdate.operationType | Options: ADD_TO_EXISTING, REPLACE_EXISTING, DELETE_EXISTING |
debugMode | Default false. Set to true to increase verbosity of logs while debugging an issue |
parallelBuild.masterBuild | Optional. Default true. See below for details on parallelBuild |
parallelBuild.waitForSeconds | Optional. Default 2 seconds. See below for details on parallelBuild |
Create New Cycle options
createNewCycle = true or "true", uses the cycleName and cycleDetails value to generate new cycle
createNewCycle = false or "false", uses the cycleKey value to find an existing cycle and updates the cycle. If cycle is not found, an error is thrown
createNewCycle = "CREATE_IF_ABSENT" uses the cycleName to search for an existing cycle with an exact match. If cycle is found, then the cycle is updated. If it is not found, then a new cycle is created using cycleName and cycleDetails
Parallel builds
If multiple builds are being triggered in parallel, the parallelBuild setting can be used to specify the masterBuild.
One of the parallel builds can be configured to set masterBuild as true. This build should have createNewCycle either set as true or CREATE_IF_ABSENT.
The other builds running in parallel can have masterBuild set to false, which would imply, they would wait for the masterBuild to run the cycle creation code, waiting for waitForSeconds (defaults to 2 seconds), before trying to find the cycle.
If multiple builds are not being run in parallel, the parallelBuild value can be ignored.
Logging
AIO Tests Reporter logs can be seen in the run logs below for successful updates.
...