Hi,
We are executing cucumber tests and importing results back to Jira using XRAY. Below is our sample cucumber.json with one test
[
{
"line": 1,
"elements": [
{
"start_timestamp": "2023-03-09T05:03:28.739Z",
"line": 4,
"name": "Login CICD test",
"description": "",
"id": "cicd-test;login-cicd-test",
"type": "scenario",
"keyword": "Scenario",
"steps": [],
"tags": [
{
"name": "@TEST_AS-6238"
}
]
},
{
"start_timestamp": "2023-03-09T05:03:28.884Z",
"line": 21,
"name": "Login with valid user name and password",
"description": "",
"id": "cicd-test;login-with-valid-user-name-and-password;;2",
"type": "scenario",
"keyword": "Scenario Outline",
"steps": [
{
"result": {
"duration": 7925990500,
"status": "passed"
},
"line": 13,
"name": "navigates to URL \"LoginPage\"",
"match": {
"arguments": [
{
"val": "\"LoginPage\"",
"offset": 17
}
],
"location": "steps.commonsteps.navigate_to_BaseURL(java.lang.String)"
},
"keyword": "Given "
},
{
"result": {
"duration": 301980000,
"status": "passed"
},
"line": 14,
"name": "populates TextField \"ID_UsernameTextField\" \"qacomm\"",
"match": {
"arguments": [
{
"val": "\"ID_UsernameTextField\"",
"offset": 20
},
{
"val": "\"qacomm\"",
"offset": 43
}
],
"location": "steps.commonsteps.populate_text_field(java.lang.String,java.lang.String)"
},
"keyword": "When "
},
{
"result": {
"duration": 319885200,
"status": "passed"
},
"line": 15,
"name": "populates TextField \"ID_PasswordTextField\" \"QACom2022\"",
"match": {
"arguments": [
{
"val": "\"ID_PasswordTextField\"",
"offset": 20
},
{
"val": "\"QACom2022\"",
"offset": 43
}
],
"location": "steps.commonsteps.populate_text_field(java.lang.String,java.lang.String)"
},
"keyword": "And "
},
{
"result": {
"duration": 382988300,
"status": "passed"
},
"line": 16,
"name": "clicks Button \"ID_LoginButton\"",
"match": {
"arguments": [
{
"val": "\"ID_LoginButton\"",
"offset": 14
}
],
"location": "steps.commonsteps.clicks_button(java.lang.String)"
},
"keyword": "And "
},
{
"result": {
"duration": 765012900,
"status": "passed"
},
"line": 17,
"name": "validates element \"Xpath_Project\"",
"match": {
"arguments": [
{
"val": "\"Xpath_Project\"",
"offset": 18
}
],
"location": "steps.commonsteps.validate_text(java.lang.String)"
},
"keyword": "Then "
}
]
}
],
"name": "CICD test",
"description": "",
"id": "cicd-test",
"keyword": "Feature",
"uri": "file:src/test/resources/features/featurestotest/1_AS-6238.feature",
"tags": []
}
]
Jenkins step
def info = '''{
"fields": {
"project": {
"key": "$PROJECT_KEY"
},
"summary": "Test Execution(Dev) for Test Plan $TEST_PLAN_KEY : Build : $BUILD_NUMBER",
"issuetype": {
"id": "10008"
}
},
"xrayFields": {
"testPlanKey": "$TEST_PLAN_KEY"
}
}
'''
step([$class: 'XrayImportBuilder', endpointName: '/cucumber/multipart', projectKey: "${env.PROJECT_KEY}", importFilePath: 'target/cucumber-reports/Cucumber.json', importInfo: info, inputInfoSwitcher: 'fileContent', serverInstance: 'xxx'])
But after importing to Jira it always shows status as ToDo. It's not updating to Pass/Fail