Hello,
After hitting this /rest/raven/2.0/import/execution/cucumber/multipart? api with below ~info and ~AI_sample cucumber json - it creates test execution but cucumber testcases are not mapped to the test execution, I also tried to import it manually (import Execution results ) no testcases mapped to the testexecution, I am not sure how to validate cucumber and what I missed here
info:
{
"fields": {
"project": {
"key": "IXXXX"
},
"summary": "Test Execution for cucumber Execution",
"description": "For more info please check [here|https://www.example.com]",
"issuetype": {
"id": "10009"
}
}
}
AI_sample cucumber json:
[
{
"uri": "features/Login.feature",
"elements": [
{
"name": "Successful login with valid credentials",
"id": "successful-login-with-valid-credentials",
"steps": [
{
"name": "I navigate to the login page",
"keyword": "Given ",
"result": {
"status": "passed"
}
},
{
"name": "I enter valid credentials",
"keyword": "When ",
"result": {
"status": "passed"
}
},
{
"name": "I am redirected to the dashboard",
"keyword": "Then ",
"result": {
"status": "passed"
}
}
]
},
{
"name": "Unsuccessful login with invalid credentials",
"id": "unsuccessful-login-with-invalid-credentials",
"steps": [
{
"name": "I navigate to the login page",
"keyword": "Given ",
"result": {
"status": "passed"
}
},
{
"name": "I enter invalid credentials",
"keyword": "When ",
"result": {
"status": "failed",
"error_message": "Invalid username or password"
}
},
{
"name": "I see an error message",
"keyword": "Then ",
"result": {
"status": "passed"
}
}
]
}
]
},
{
"uri": "features/Account.feature",
"elements": [
{
"name": "Creating a new account",
"id": "creating-a-new-account",
"steps": [
{
"name": "I navigate to the account creation page",
"keyword": "Given ",
"result": {
"status": "passed"
}
},
{
"name": "I enter all required details",
"keyword": "When ",
"result": {
"status": "passed"
}
},
{
"name": "I successfully create a new account",
"keyword": "Then ",
"result": {
"status": "passed"
}
}
]
}
]
}
]
The problem may be because you're not following one of the two supported flows for Cucumber as detailed here. You cannot simply import results; you test results need to contain references to *existing* Test issues corresponding to each Scenario you have in your cucumber side.
Usually what this means is that you need first to have the Test issues created in Xray side (one per each Scenario), then you need to export them. This will generate a Cucumber .feature file with your scenarios tagged with the original Test issue keys.
Whenever you run the tests on your CI pipeline, that report will contain references to the Test issues in Xray, allowing Xray to understand that results should be mapped to them.
Xray never creates Test issues whenever importing test automation results from Cucumber (or similar frameworks).
Please check this tutorial for Java which details the 2 flows.
Note: I've provided Xray Cloud documentation but the principles are the same if you are using Xray on-prem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.