Code Coverage for Backend code when running UI Automated tests - cypress

I ve a test automation suite in Cypress for testing a webapp. The webapp is developed using JS frameworks in the frontend and Java/C# in the backend. My requirement is to calculate code coverage for both fronend and backend code when running my cypress automated tests. We have libraries like Istanbul that does this job for fronend/UI code.
Now I want to know how to calculate the code coverage for the backend/API code when running our Cypress UI automation tests?

Related

Is there any way to connect cypress tests with azure devops test cases?

I'm looking for a way to connect cypress tests with azure devops test cases? Like on the image below
Anyone found some workaround? Like calling cypress tests from mstest framework for example.

Testing API with actual database in CI/CD

Problem Statement: I'm building an .NET Core based REST API. It has unit tests and Postman Tests. When I check-in the code to my GIT HUB, I want my GIT HUB Action to RUN my unit tests and also run my postman tests which calls the actual Rest API. The REST API in turn calls the database to do it works.
As part of my github action script definition, I think I will need to launch a container for my REST API and another container to host my database. The Postman test then just hits the API container to test the various endpoints. Once testing completes, the containers go away.
Question: Is this approach viable/practical? How can I go about building this in github actions?
Tech stack: Postgress, .net core 6, Postman.

How cypress can be integrated with Xray in Jira

We are using XRAY in our Jira instance for running so far manual test and record metrics for our QA department.
We would like now to move a step further in order to implement Test Automation integrated with X-ray.
X-ray can use cucumber syntax for test case
What is the way to integrate Cypress with X-ray ?
How can we create automation test in Jira and send them to Cypress ?
How to get cypress test result back to X-ray for reporting and tracking ?
We are new to cypress and automation test using those environment, thanks for sharing your findings
regards
If using Cypress, you can use the report produced by the test runner to integrate with Xray. If you're using Cucumber together with Cypress, you'll use "cypress-cucumber-preprocessor" package; you'll need to decide which workflow to adopt - in other words, you need to decide which will be the master for editing/managing your Gherkin specification.
The flows are slightly different depending on that.
This tutorial details the two flows; it is for Xray on Jira Cloud but it can easily be adapted if you are using Jira on-premise (server/Datacenter).

Finding code coverage of a gRPC API based on API tests

Assumption
API tests are written in the same API code repository using GoLang
API tests are run as part of the Pull Request CI build.
An API test is basically starting gRPC server, making request from a golang based gRPC client and verifying the response
Flow
Dev starts building a new endpoint for an API
Dev does not write any API tests (please note that I mention specifically API tests and not unit tests)
Dev creates a Pull Request for the changes
The Pull Request should identify that there are no tests written for the new changes and block the PR
My question
How could we build a CI flow like this to achieve point 4?
I'm aware that code coverage is one way to go but I'm not fully convinced if that would be the correct approach for API tests?
Is it possible to find code coverage of gRPC service based on such API tests? If yes, then how?

How to integrate testcafe automation tool with laravel

I have recorded the tests using testcafe tool. I want to integrate these tests into local code project laravel.
https://testcafe.devexpress.com/
But I am not using laravel browse testing because I have already recorded test in testcafe tool.
Please help me.
Thanks in advance!
From what I gather, you want to run your recorded TestCafe tests using lavarel.
If so, note that only TestCafe can run its own test cases.
If you are looking for TestCafe runner integration with laravel, it looks like such integration is not available:
https://laravel.com/docs/5.8/testing

Resources