What the Cypress Cloud Jira integration does (Test Automation)
Learn What the Cypress Cloud Jira integration does (Test Automation) step by step with clear examples and exercises.
Why This Matters
In this full guide, we'll learn how to use the power of Cypress Cloud and its native Jira integration for streamlined test automation using JavaScript. By the end of this tutorial, you'll be able to create, link, view, and track Jira issues directly from your test results in Cypress Cloud, making it easier to manage and maintain your test suite.
Why This Matters
Test automation is essential for ensuring software quality and reducing manual testing efforts. With tools like Selenium, Playwright, and Cypress, developers can write tests that automatically execute and report the results. However, managing these tests can be challenging, especially when it comes to identifying issues, assigning tasks, and tracking progress.
Cypress Cloud's Jira integration addresses this by allowing you to create, link, view, and track Jira issues directly from your test results. This integration saves time, improves collaboration, and makes it easier to identify and resolve issues in your test suite.
Prerequisites
To follow along with this tutorial, you'll need the following:
- Node.js (>= 12.0.0) installed on your machine. You can download it from here.
- Cypress installed in your project. Run
npm install cypressto install it if you haven't already. - An Atlassian account with access to Jira. Create one if you don't have one yet at Atlassian.
- The Cypress for Jira app installed from the Atlassian Marketplace. Follow the instructions in the official documentation to install it.
Core Concept
The Cypress Cloud Jira integration allows you to create, link, view, and track Jira issues directly from your test results in Cypress Cloud. This is a native Jira integration built into Cypress Cloud, not a custom reporter or webhook script. No code changes are required in your test suite.
Creating a Jira Issue
From any test result in Cypress Cloud, you can create a Jira issue for a failing, flaky, or passing test without leaving the platform. You choose the project, issue type, assignee, and additional fields as needed. Here's an example of creating a new Jira issue:
- Navigate to your Cypress Cloud dashboard and find the test result you want to create an issue for.
- Click on the three-dot menu (
...) next to the test result and select "Create Jira Issue." - In the dialog that appears, choose the project, issue type, assignee, and any additional fields as needed. Then click "Create Issue."
The new Jira issue will now be linked to the corresponding test result in Cypress Cloud, and you can view its details by expanding the issue in the test results panel.
Linking an Existing Jira Issue
If a Jira issue already exists for a specific test, you can link it to that test in Cypress Cloud. Here's how:
- Navigate to your Cypress Cloud dashboard and find the test result you want to link an existing Jira issue to.
- Click on the three-dot menu (
...) next to the test result and select "Link Jira Issue." - In the dialog that appears, enter the Jira issue key or search for the issue using the provided search bar. Once you find the correct issue, click "Link Issue."
The selected Jira issue will now be linked to the corresponding test result in Cypress Cloud, and you can view its details by expanding the issue in the test results panel.
Viewing Jira Issue History
Every Jira issue ever created or linked for a given test appears in that test result's panel. This allows you to see the history of issues associated with that test across all runs, making it easier to identify patterns and regressions.
Inspecting a Linked Issue
You can expand Jira issues in the results panel to see assignee, status, and when the issue was created, and open the issue in Jira in one click. This makes it easy for anyone following up on the issue to have all the necessary context without hunting for it.
Navigating from Jira Back to Cypress Cloud
Every issue created through this integration includes a direct link to the test run in Cypress Cloud where the issue was filed. Anyone triaging in Jira can jump straight to the test replay, making it easier to reproduce and diagnose issues.
Worked Example
Let's walk through an example of using the Cypress Cloud Jira integration with a simple test suite.
- First, let's create a new Cypress project:
npm init cypress
cd cypress
- Now, let's write a test that checks if our homepage has the correct title:
// cypress/integration/homepage_spec.js
describe('Homepage', () => {
it('has the correct title', () => {
cy.visit('/')
cy.title().should('include', 'Your App Title')
})
})
- Run the test using Cypress:
npm run cypress open
- Now, let's say our test fails because the homepage title is incorrect. To create a Jira issue for this failing test, follow these steps:
- Navigate to your Cypress Cloud dashboard and find the failed test result.
- Click on the three-dot menu (
...) next to the test result and select "Create Jira Issue." - In the dialog that appears, choose the project, issue type, assignee, and any additional fields as needed. Then click "Create Issue."
The new Jira issue will now be linked to the corresponding test result in Cypress Cloud, and you can view its details by expanding the issue in the test results panel.
Common Mistakes
- Not installing the Cypress for Jira app from the Atlassian Marketplace: To use the Jira integration, you must first install the Cypress for Jira app from the Atlassian Marketplace as described in the official documentation.
- Not linking existing Jira issues to tests: If you have an existing Jira issue related to a test, make sure to link it to that test in Cypress Cloud as described in the "Linking an Existing Jira Issue" section above.
- Not configuring your project properly: Make sure your project is configured correctly for Cypress Cloud by following the official setup guide.
Practice Questions
- How can you create a Jira issue for a failing test in Cypress Cloud?
- What information is displayed when you expand a linked Jira issue in the test results panel of Cypress Cloud?
- How can you link an existing Jira issue to a test result in Cypress Cloud?
- How can someone triaging in Jira navigate back to the corresponding test run in Cypress Cloud?
FAQ
- Do I need to modify my test code to use the Cypress Cloud Jira integration? No, the integration is built into Cypress Cloud and does not require any changes to your test suite.
- Can I use the Cypress Cloud Jira integration with tests written in languages other than JavaScript? The official integration is for JavaScript tests using Cypress. However, you can use third-party tools like cypress-jira to integrate Jira with other test frameworks and programming languages.
- Can I customize the behavior of the Cypress Cloud Jira integration? Yes, you can customize the integration by configuring options such as the default project, issue type, assignee, and additional fields in your
cypress.jsonfile. Refer to the official documentation for more information. - What happens if I delete a Jira issue that is linked to a test result in Cypress Cloud? Deleting a linked Jira issue will remove the association between the issue and the test result in Cypress Cloud. However, the test result's history will still show that the issue existed at some point.