{"id":18995346,"url":"https://github.com/testpointcorp/cypress-vansah","last_synced_at":"2026-06-19T08:31:35.962Z","repository":{"id":230851558,"uuid":"777629897","full_name":"testpointcorp/cypress-vansah","owner":"testpointcorp","description":"This tutorial guides you through the process of integrating Cypress tests with Vansah Test Management for Jira to automatically send test case results. ","archived":false,"fork":false,"pushed_at":"2025-11-11T11:36:56.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"prod","last_synced_at":"2025-11-11T13:18:57.911Z","etag":null,"topics":["automation","automation-framework","cypress","cypress-custom-commands","cypress-tests"],"latest_commit_sha":null,"homepage":"https://vansah.com/connect-integrations/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/testpointcorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-26T08:09:08.000Z","updated_at":"2025-11-11T11:37:00.000Z","dependencies_parsed_at":"2024-04-01T07:24:27.248Z","dependency_job_id":"0f245587-bb2f-48a8-ad13-f6cc9f9df42b","html_url":"https://github.com/testpointcorp/cypress-vansah","commit_stats":null,"previous_names":["testpointcorp/cypress-vansah"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/testpointcorp/cypress-vansah","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpointcorp%2Fcypress-vansah","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpointcorp%2Fcypress-vansah/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpointcorp%2Fcypress-vansah/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpointcorp%2Fcypress-vansah/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testpointcorp","download_url":"https://codeload.github.com/testpointcorp/cypress-vansah/tar.gz/refs/heads/prod","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpointcorp%2Fcypress-vansah/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34523982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","automation-framework","cypress","cypress-custom-commands","cypress-tests"],"created_at":"2024-11-08T17:30:03.361Z","updated_at":"2026-06-19T08:31:35.957Z","avatar_url":"https://github.com/testpointcorp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cypress Integration with Vansah Test Management for Jira\n\nThis tutorial guides you through the process of integrating Cypress tests with Vansah Test Management for Jira to automatically send test case results. By following this setup, you can streamline your testing workflow, ensuring that test outcomes are recorded directly in Vansah.\n\n## Prerequisites\n\n- Make sure that [`Vansah`](https://marketplace.atlassian.com/apps/1224250/vansah-test-management-for-jira?tab=overview\u0026hosting=cloud) is installed in your Jira workspace\n- You need to Generate Vansah [`connect`](https://help.vansah.com/en/articles/9824979-generate-a-vansah-api-token-from-jira) token to authenticate with Vansah APIs.\n- Node.js and npm installed\n- Cypress installed in your project\n\n## Configuration\n\n1. `Setting Environment Variables`: Store your Vansah API token as an environment variable for security. \n\nFor Windows (use cmd)\n```cmd\nsetx VANSAH_TOKEN \"your_vansah_api_token_here\"\n\n```\nFor macOS\n```bash\necho 'export VANSAH_TOKEN=\"your_vansah_api_token_here\"' \u003e\u003e ~/.bash_profile\n\nsource ~/.bash_profile\n\n```\nFor Linux (Ubuntu, Debian, etc.)\n```bash\necho 'export VANSAH_TOKEN=\"your_vansah_api_token_here\"' \u003e\u003e ~/.bashrc\n\nsource ~/.bashrc\n\n```\n2. `Cypress Configuration`: Modify your cypress.config.js to include Vansah specific configurations. Here's an example setup:\n\n```js\n// This configuration file is used to set up Cypress end-to-end (e2e) testing parameters,\n// specifically for projects that integrate with Vansah Test Management for Jira.\n// It leverages Cypress's `defineConfig` function to set various custom configuration options.\n\nconst { defineConfig } = require(\"cypress\");\n\nmodule.exports = defineConfig({\n  e2e: {\n    // [Required] The `setupNodeEvents` function allows for custom modifications to the Cypress configuration\n    // based on the project's specific needs before the tests are executed.\n    setupNodeEvents(on, config) {\n      // Specifies the base URL of the application under test, making it easier to reference during tests.\n      // In this case, tests are aimed at a Selenium practice site hosted on Vansah's domain.\n      config.baseUrl = 'https://selenium.vansah.io';\n\n      // [Required] Sets the URL for the Vansah Connect API, allowing Cypress tests to send results directly to Vansah.\n      config.vansahConnectURL = \"https://prod.vansah.com\"\n      // [Required] The Vansah connect token is securely accessed from environment variables,\n      // ensuring sensitive information is not hard-coded into the configuration.\n      config.vansahConnectToken = process.env.VANSAH_TOKEN;\n\n      // [Optional] Additional Vansah-specific configurations:\n      // Defines the sprint name within Vansah where the test results will be recorded.\n      config.vansahSprintName = 'SM Sprint 1'\n      // Sets the testing environment name to help categorize the test runs.\n      config.vansahEnvName = 'SYS'\n      // Specifies the release name associated with the test runs for tracking purposes.\n      config.vansahReleaseName = 'Release 24'\n\n      //[Required] Returns the modified configuration object to be used by Cypress.\n      return config\n    }\n  },\n});\n\n```\n3. `Custom Commands`: Define a custom command in Cypress for sending the test results to Vansah. Place the command definition in commands.js and include it in your Cypress commands file. The custom command, [cy.sendResulttoVansah](/cypress/support/commands.js), is used to send test results.\n4. `Test Implementation`: Write your tests in a [.cy.js](cypress/e2e/vansah-io.cy.js) file. Use cy.sendResulttoVansah in the afterEach hook to send test results after each test case.\n```js\ndescribe('Describe your Test Suite Headline', () =\u003e {\n\n  //[Required] Define Vansah variables here\n  let vansahJiraAsset = 'Test-2' //Currently set as Jira Issue Key, but can also be used for TestFolder or any other Issue key\n  let result = \"passed\"\n  let vansahTestCaseKey=''\n\n  //[Required] Listen for test failures and update result variable accordingly\n  Cypress.on('uncaught:exception', (err, runnable) =\u003e {\n    result = \"failed\";\n\n  })\n  Cypress.on('fail', (err, runnable) =\u003e {\n    result = \"failed\";\n\n  })\n  it('Your Test Case Headline', () =\u003e {    \n    result = \"passed\"; // [Required] Set result to \"passed\" initially\n    vansahTestCaseKey = 'Test-C6' // [Required] Set Test Case Key\n    \n    //Your Test logic\n\n  });\n  afterEach(() =\u003e {\n   /**  \n    * * This command constructs and sends an API request to Vansah to report test results.\n    * {string} vansahJiraAsset - The key of the Jira issue or the ID of the test folder in Vansah Test Management.\n    * {string} vansahTestCaseKey - The key of the test case in Vansah Test Management.\n    * {string} result - The result of the test ('passed' or 'failed').\n    * */\n    cy.sendResulttoVansah(vansahJiraAsset,vansahTestCaseKey,result)\n  })\n\n});\n\n\n```\n5. Running Tests\nTo execute your Cypress tests and send results to Vansah:\n```bash\nnpx cypress run\n\n```\nOr, if you prefer to use the Cypress Test Runner:\n```bash\nnpx cypress open\n\n```\n## Conclusion\n\nBy following these steps, you can efficiently manage your test cases and results in Vansah Test Management for Jira, improving the visibility and traceability of your testing efforts.\n\nFor more details on Cypress and custom commands, visit the [Cypress documentation](https://docs.cypress.io/api/cypress-api/custom-commands). \nFor Vansah specific configurations and API details, please refer to the [Vansah API documentation](https://apidoc.vansah.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestpointcorp%2Fcypress-vansah","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestpointcorp%2Fcypress-vansah","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestpointcorp%2Fcypress-vansah/lists"}