{"id":20246562,"url":"https://github.com/sorry-cypress/cy2","last_synced_at":"2025-05-05T22:33:20.218Z","repository":{"id":42666151,"uuid":"351725080","full_name":"sorry-cypress/cy2","owner":"sorry-cypress","description":"Integrate Cypress with alternative cloud services like Sorry Cypress or Currents","archived":false,"fork":false,"pushed_at":"2024-09-06T09:50:11.000Z","size":640,"stargazers_count":32,"open_issues_count":4,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-29T20:22:33.255Z","etag":null,"topics":["automation","cypress","sorry-cypress","wrapper"],"latest_commit_sha":null,"homepage":"https://docs.sorry-cypress.dev/cypress-agent/cy2","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sorry-cypress.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2021-03-26T09:17:16.000Z","updated_at":"2024-07-24T16:57:11.000Z","dependencies_parsed_at":"2023-12-23T09:07:49.309Z","dependency_job_id":"30967735-6c2c-490c-b5cf-718cab381785","html_url":"https://github.com/sorry-cypress/cy2","commit_stats":{"total_commits":116,"total_committers":4,"mean_commits":29.0,"dds":"0.19827586206896552","last_synced_commit":"26c6835ca50e545814b6ced412bfc04d0b3f8402"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorry-cypress%2Fcy2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorry-cypress%2Fcy2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorry-cypress%2Fcy2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorry-cypress%2Fcy2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sorry-cypress","download_url":"https://codeload.github.com/sorry-cypress/cy2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252293079,"owners_count":21724960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","cypress","sorry-cypress","wrapper"],"created_at":"2024-11-14T09:30:20.265Z","updated_at":"2025-05-05T22:33:20.198Z","avatar_url":"https://github.com/sorry-cypress.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cy2\n\nIntegrate Cypress with alternative cloud services like Sorry Cypress or Currents\n\n---\n\n**[Currents.dev](https://currents.dev/?utm_source=cy2)** - is a hosted cloud service used to run millions of Cypress tests without breaking the bank. This is an enhanced version of Sorry Cypress with better security, performance, analytics, integrations and support.\n\n**[Sorry Cypress](https://sorry-cypress.dev/?utm_source=cy2)** - is an open-source, free alternative to Cypress Cloud that unlocks unlimited parallelization, test recordings, and integration with GitHub, Slack and more.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"830\" alt=\"banner dark\" src=\"https://user-images.githubusercontent.com/1637928/147379205-2fe4fb9d-49e6-4a2b-917b-2a28973d2a3a.png\"\u003e\n\u003c/p\u003e\n\n![npm downloads](https://img.shields.io/npm/dw/cy2?style=flat)\n\n`cy2` integrates [cypress](https://www.npmjs.com/package/cypress) with alternative orchestration services like Sorry Cypress or Currents.\n\n---\n\n**Dec 2023 Update**\n\nIf you are seeing `Error: certificate has expired`, please upgrade to version 4.0.8+.\n\n**March 2023 Update**\n\n⭐️ Cypress 12.6.0+ users, please use https://github.com/currents-dev/cypress-cloud if you are seeing `Cypress does not support recording test results to this third party service` error ⭐️\n\n---\n\n[Changelog](./CHANGELOG.md) | [License GPL-3.0+](./LICENSE)\n\n## Install\n\n```sh\nnpm install cy2\n```\n\n## CLI Usage\n\nSet the environment variable `CYPRESS_API_URL` and run `cy2`. The command passes down all the CLI flags to cypress runner as-is.\n\n```sh\n# use `http://localhost:1234` as orchestration cloud service\nCYPRESS_API_URL=\"http://localhost:1234/\" cy2 run --parallel --record --key somekey --ci-build-id hello-cypress\n```\n\nExample usage with [sorry-cypress](https://sorry-cypress.dev). The URL should point to `director` service.\n\n```sh\nCYPRESS_API_URL=\"https://sorry-cypress-demo-director.herokuapp.com\" cy2 run  --parallel --record --key somekey --ci-build-id hello-cypress\n```\n\n## API\n\n### `run`\n\nRun Cypress via its [Module API](https://docs.cypress.io/guides/guides/module-api)\n\n```ts\nrun(apiUrl: string, config: CypressCommandLine.CypressRunOptions): Promise\u003cCypressCommandLine.CypressRunResult | CypressCommandLine.CypressFailedRunResult\u003e\n```\n\nExample:\n\n```ts\nimport { run } from 'cy2';\n\nconst results = await run('https://sorry-cypress.company.net', {\n  reporter: 'junit',\n  browser: 'chrome',\n  config: {\n    baseUrl: 'http://localhost:8080',\n    video: true,\n  },\n});\n```\n\n### `spawn`\n\nSpawn Cypress as a child process and inherit all the flags and environment variables. It invokes `process.exit` with the child process' exit code.\n\n```ts\nspawn(apiUrl: string): Promise\u003cvoid\u003e\n```\n\nExample:\n\n```ts\nimport { spawn } from 'cy2';\n\nawait spawn(process.env.CYPRESS_API_URL);\n```\n\n## Breaking Changes\n\n### Version 4\n\n- `patch` method was deprecated. Use `run` instead.\n\n### Version 3\n\n- Starting version 3+, the API methods `run` and `patch` rely on `process.env.CYPRESS_API_URL` instead of accepting an argument. That's because of a new patching method that doesn't permanently change cypress configuration after invoking `cy2`.\n\n### `patch` [deprecated in 4+]\n\n\u003e Deprecated due to the changes in cypress introduced in version 12+.\n\nChange cypress configuration without running it.\n\n```ts\npatch(cypressPackageEntryPath: string) =\u003e Promise\u003cvoid\u003e\n```\n\n⚠️ Make sure to set `process.env.CYPRESS_API_URL` before invoking `patch`\n\nExample:\n\n```ts\nimport { patch } from 'cy2';\nimport cypress from 'cypress';\n\nprocess.env.CYPRESS_API_URL = 'https://dashboard.service.url';\n\nasync function main() {\n  // optional - provide cypress package main entry point location\n  await patch(require.resolve('cypress'));\n\n  cypress\n    .run({\n      // the path is relative to the current working directory\n      spec: './cypress/e2e/examples/actions.cy.js',\n    })\n    .then((results) =\u003e {\n      console.log(results);\n    })\n    .catch((err) =\u003e {\n      console.error(err);\n    });\n}\nmain().catch((error) =\u003e {\n  console.error(error);\n  process.exit(1);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorry-cypress%2Fcy2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsorry-cypress%2Fcy2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorry-cypress%2Fcy2/lists"}