Xray Cloud test execution status - cypress

Is there a way to obtain the status of every test (passed or failed) of a test execution using API REST in Xray Cloud?
I have a Jira Cloud with Xray where I import a Junit XML and I want to be able to get a file with the status of the test imported

For that purpose you need to use Xray Cloud's GraphQL API.
Here are some code examples for that:
in JavaScript
in Python
You can actually use different GraphQL functions for that but the getTestExecutions may be the most appropriate one.
You'll need to specify that you want the testRuns object on the results.

Related

How to generate an OpenAPI from a Spring app without running the app?

I can run a Spring Boot application and then use the springdoc-openapi-maven-plugin artifact to generate an OpenAPI spec.
However, is there also a way to generate the spec without running the application first?
I currently want to generate the spec in a GitHub Action and a direct way would simplify this a lot.
you can use swagger editor: https://editor.swagger.io/
It allows you to write a json/yaml with your specifications and at the same time you can view the result.
Also, in the upper part there are 2 features, which allow you to generate the code based on the json/yaml made.
For example you can create a spring application with all the endpoints you go to specify in your json/yaml ( server).
But you can also generate HTML. (Client)

How to send Junit test results to InfluxDB

Currently, I've some tests suite in place with me using Junit 5. Wanted to send the test result metrics to Grafana. I'm thinking of sending the test results to Influx db and re-route it to Grafana at the end. Is there a way to use Sunfire XML file to achieve this use case?
I am planning to do the same, and I found this on the web.
https://medium.com/detesters/how-to-store-junit-tests-in-an-influxdb-7faf63dd562a
I will do more research and am thinking of creating a junit5 extension to do this. If I have a solution, I will post it here.

Spring Boot Profile Switch Real or Mock API

I have application.yml
spring.active.profile=default,dev
api-url: http://dev-api.com
I have another file application-mock.yml which has below api-url related to wiremock.
application-mock.yml
api-url: http://localhost:7845
I have requirement to provide the developer/tester to use mock api-url or real api url from test environment based on their needs.
We have central puppet configuration file test.yml which has below content which will call real api properly and it works as expected currently.
test.yml
spring.active.profile=default,test
api-url: http://test-api.com
Now, i need to provide the option to use mock-api url from test envionment. I cant edit api-url in test.yaml in puppet configuration to point to http://localhost:7845 because it affect functionality on calling real api.
I want to make real api and mock api also should work based on developer/tester needs instead of changing or committing test.yml.
my spring java service contains value annotation for api-url to retrieve url.
Kindly provide me your valuable input.

Mocking Rest Api with Swagger Documentation

Whole idea is to create Mock service for UI guys to test without actual api.
- We have define specification in .ymcl files.
- Now want to generate Swagger-UI and Mock rest URI with mock data.
- Using spring-boot.
Please suggest some way to generate the same.
Given that you've the API documented in Swagger/OpenAPI spec (YAML format), you can use Swagger Codegen to generate Spring boot server stub.
Please pull the latest master of https://github.com/swagger-api/swagger-codegen and follow the instruction in the wiki:
https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO#java-springboot

Unit tests for Parse Cloud Code?

I have an application which uses Cloud Code as backend. Is there any way to write unit tests for Parse Cloud Code?
Try this:How to use unit tests with parse cloud code
You can write various set of cloud functions to perform the tests you want to run. You can then call them via the REST API or execute them in a scheduled background Job.

Resources