Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cy2

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cy2

![npm downloads](https://img.shields.io/npm/dw/cy2?style=flat) [![AppVeyour](https://ci.appveyor.com/api/projects/status/8i4xhejvla6rhc3m/branch/master?svg=true)](https://ci.appveyor.com/project/agoldis/cy2/branch/master) [![CircleCI](https://circleci.com

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
98K
decreased by-35.38%
Maintainers
1
Weekly downloads
 
Created
Source

cy2

npm downloads AppVeyour CircleCI


Run millions of cypress tests in parallel without breaking the bank

Currents.dev - is a hosted cloud service that hundreds of companies around the globe use to run millions of Cypress tests without breaking the bank. This is an enhanced version of Sorry Cypress with a better security, performance, analytics, integrations and support.

Sorry Cypress is an open-source, free alternative to Cypress Dashboard that unlocks unlimited parallelization, test recordings, integration with GitHub, Slack and more.


Change cypress API URL configuration on-the-fly using environment variable CYPRESS_API_URL. It passes down all the CLI flags as-is, so you can just use it instead of cypress.

Install

npm install cy2

Usage

Use http://localhost:1234 as Cypress API URL:

CYPRESS_API_URL="http://localhost:1234/" cy2 run --parallel --record --key somekey --ci-build-id hello-cypress

Example usage with sorry-cypress

CYPRESS_API_URL="https://sorry-cypress-demo-director.herokuapp.com" cy2 run  --parallel --record --key somekey --ci-build-id hello-cypress

When CYPRESS_API_URL is not set, it just uses the default API server https://api.cypress.io

API

Patch Cypress

/**
 * Patch Cypress with a custom API URL.
 *
 * Tries to discover the location of `app.yml`
 * and patch it with a custom URL.
 *
 * @param {string} apiURL - new API URL to use
 * @param {string} [cypressConfigFilePath] - explicitly provide the path to Cypress app.yml and disable auto-discovery
 */
patch(apiURL: string, cypressConfigPath?: string) => Promise<void>

Example

const { patch } = require("cy2");

async function main() {
  await patch("https://sorry-cypress-demo-director.herokuapp.com");
}

main().catch(console.error);

Patch and run cypress

/**
 * Run Cypress programmatically as a child process
 */
run(apiURL?: string = 'https://api.cypress.io/'), label?: string = 'cy2')=> Promise<void>

Example

#!/usr/bin/env node

/* cmd.js */

const { run } = require("cy2");

async function main() {
  await run("https://sorry-cypress-demo-director.herokuapp.com/", "myCMD");
}

main().catch(console.error);
/*

$ ./cmd.js --help
[myCMD] Running cypress with API URL: https://sorry-cypress-demo-director.herokuapp.com/
Usage: cypress <command> [options]

Options:
  -v, --version      prints Cypress version
  -h, --help         display help for command

*/

Explicit config file location (since 1.4.0)

Sometimes cy2 is not able to automatically detect the location of cypress package on your system. In that case you should explicitly provide environment variable CYPRESS_PACKAGE_CONFIG_PATH with the location of cypress's app.yml configuration file.

Example:

CYPRESS_API_URL="http://localhost:1234/" \
CYPRESS_PACKAGE_CONFIG_PATH="/Users/John/Cypress/8.3.0/Cypress.app/Contents/Resources/app/packages/server/config/app.yml" \
npx cy2 run --parallel --record --key somekey --ci-build-id hello-cypress

See cypress agent configuration for locating app.yml file on your system.

Keywords

FAQs

Package last updated on 28 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc