Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Not able to import cucumber json results into xray with new test execution

Hi, i m using the below multipart endpoint  to import my cucumber json results into xray that should create a new test execution and link it to the specified testplan and project keys in the info file below. after many tries i ended up by receiving the bellow error and i do not know what it is missing here:

{"error":"Error creating Test Execution - expected Object"}

your help is very appreciated. 

 

1) curl -H "Content-Type: multipart/form-data" \
-X POST -F info=@issueFields.json \
-F results=@build/json_cucumber.json \
-H "Authorization: Bearer $token" https://xray.cloud.xpand-it.com/api/v2/import/execution/cucumber/multipart

 

2) info file is :

{
"fields": {
"project": {
"key": "DEMO"
},
"summary": "Brand new Test execution",
"issuetype": {
"name":"Test Execution"
},
"description": "first test execution",
"versions": ["REL-2021.02.0"],
"fixVersions": ["REL-2021.02.0"]
},
"xrayFields": {
"testPlanKey": "TR-5202",
"environments": ["QA2"]
}
}

3) results in cucumber json format :

[
{
"line": 2,
"elements": [
{
"start_timestamp": "2021-01-31T19:16:00.125Z",
"before": [
{
"result": {
"duration": 64367477818,
"status": "passed"
},
"match": {
"location": "TestSetUpHook.setup(Scenario)"
}
}
],
"line": 46,
"name": "employee submits an approved request to create a punch",
"description": "",
"id": "employee-timecard-edits-(create-/-update)-requests-are-auto-approved;employee-submits-an-approved-request-to-create-a-punch",
"after": [
{
"output": [
"\n\n ************************************************************************ \n"
],
"result": {
"duration": 3546992735,
"status": "passed"
},
"match": {
"location": "TestSetUpHook.cleanUp(Scenario)"
}
}
],
"type": "scenario",
"keyword": "Scenario",
"steps": [
{
"result": {
"error_message": "java.lang.NullPointerException\n\tat com.company.service.common.EmployeeCommonRequestService.getEmployeeEmail(EmployeeCommonRequestService.java:36)\n\tat com.company.service.common.EmployeeCommonRequestService$$FastClassBySpringCGLIB$$edef1353.invoke(\u003cgenerated\u003e)\n\tat org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n\tat org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:91)\n\tat org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:287)\n\tat org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:164)\n\tat org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:118)\n\tat org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:153)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)\n\tat org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)\n\tat com.company.service.common.EmployeeCommonRequestService$$EnhancerBySpringCGLIB$$d6a8a6ae.getEmployeeEmail(\u003cgenerated\u003e)\n\tat com.company.stepdefinition.TimeAndAttendanceStepDefinition.loginAsDefaultUser(TimeAndAttendanceStepDefinition.java:85)\n\tat com.company.stepdefinition.TimeAndAttendanceStepDefinition.createOnlinePunchFromMontrealStore(TimeAndAttendanceStepDefinition.java:36)\n\tat ✽.employee_bart submits an approval request to create a online punch for SHIFT_START from montreal store at 12:00(file:src/test/java/com/company/feature/timeCards/1_TR-4768.feature:47)\n",
"duration": 7679334,
"status": "failed"
},
"line": 47,
"name": "employee_bart submits an approval request to create a online punch for SHIFT_START from montreal store at 12:00",
"match": {
"arguments": [
{
"val": "employee_bart submits an approval request to",
"offset": 0
},
{
"val": "SHIFT_START",
"offset": 71
},
{
"val": "12:00",
"offset": 106
}
],
"location": "TimeAndAttendanceStepDefinition.createOnlinePunchFromMontrealStore(String,String,String)"
},
"keyword": "When "
},
{
"result": {
"status": "undefined"
},
"line": 48,
"name": "the request should be approved",
"match": {},
"keyword": "Then "
},
{
"result": {
"status": "undefined"
},
"line": 49,
"name": "the punch for SHIFT_START from montreal store at 12:00 is created",
"match": {},
"keyword": "And "
}
],
"tags": [
{
"name": "@REQ_TR-4768"
},
{
"name": "@TEST_TR-5104"
},
{
"name": "@TESTSET_TR-5106"
},
{
"name": "@RestReady"
},
{
"name": "@TeamPunch"
},
{
"name": "@TimeCards"
}
]
}
],
"name": "Employee timecard edits (create / update) requests are auto-approved",
"description": "",
"id": "employee-timecard-edits-(create-/-update)-requests-are-auto-approved",
"keyword": "Feature",
"uri": "file:src/test/java/com/company/feature/timeCards/1_TR-4768.feature",
"tags": [
{
"name": "@REQ_TR-4768",
"type": "Tag",
"location": {
"line": 1,
"column": 1
}
}
]
}
]

 

1 comment

Hi! 

It looks like escaping issue based on your error_message.

I do recommend you raise the ticket to vendor for double check the error

https://jira.xpand-it.com/servicedesk/customer/portal/2/user/login?destination=portal%2F2

Comment

Log in or Sign up to comment
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you