New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@devmy/cypress-runner

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devmy/cypress-runner

CLI tool to launch frontend and backend servers and run Cypress tests

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
2
Weekly downloads
 
Created
Source

Cypress Runner

Cypress Runner is a command-line interface (CLI) tool designed to launch specified frontend and backend servers before running Cypress tests. The CLI expects to find a .cypressrunnerrc configuration file in the current working directory (cwd).

Installation

To install Cypress Runner, you can use npm:

npm install -g @devmy/cypress-runner

Configuration

Cypress Runner requires a .cypressrunnerrc file in the directory where it is executed. This file should export a configuration object that matches the interface CypressRunnerConfig

Example .cypressrunnerrc File

{
  "debug": true,
  "startWebServerCommands": [
    { "command": "npm run start:frontend", "name": "frontend" },
    { "command": "npm run start:backend", "name": "backend" }
  ],
  "waitOn": {
    "resources": ["http://localhost:3000", "http://localhost:4000"],
    "delay": 1000,
    "timeout": 30000
  }
}

Example .cypressrunnerrc.json File

{
  "debug": true,
  "startWebServerCommands": [
    { "command": "npm run start:frontend", "name": "frontend" },
    { "command": "npm run start:backend", "name": "backend" }
  ],
  "waitOn": {
    "resources": ["http://localhost:3000", "http://localhost:4000"],
    "delay": 1000,
    "timeout": 30000
  }
}

Example .cypressrunnerrc.js File

/** @type import('@devmy/cypress-runner').CypressRunnerConfig*/
const config = {
  debug: true,
  startWebServerCommands: [
    { command: "npm run start:frontend", name: "frontend" },
    { command: "npm run start:backend", name: "backend" }
  ],
  waitOn: {
    resources: ["http://localhost:3000", "http://localhost:4000"],
    delay: 1000,
    timeout: 30000
  }
};

exports.default = config;

Example .cypressrunnerrc.ts File

import { CypressRunnerConfigfrom '@devmy/cypress-runner';

const config: CypressRunnerConfig = {
  debug: true,
  startWebServerCommands: [
    { command: "npm run start:frontend", name: "frontend" },
    { command: "npm run start:backend", name: "backend" }
  ],
  waitOn: {
    resources: ["http://localhost:3000", "http://localhost:4000"],
    delay: 1000,
    timeout: 30000
  }
};

export default config;

Usage

After configuring your .cypressrunnerrc file, you can run Cypress Runner from your project’s root directory:

cypress-runner [cypress options]

All additional parameters passed to the CLI will be forwarded directly to Cypress.

Example

cypress-runner open

In this example, cypress-runner will:

  1. Start the frontend and backend servers as specified in the .cypressrunnerrc file.
  2. Wait until the servers are up and running based on the waitOn configuration.
  3. Launch the Cypress test runner with the open option.

Options

debug

  • Type: boolean
  • Description: Enables debug logging for the Cypress Runner.
  • Default: false

startWebServerCommands

  • Type: Array<ConcurrentlyCommandInput> | ConcurrentlyCommandInput
  • Description: Commands to start the frontend and backend servers. This uses the concurrently package to run multiple commands concurrently.

waitOn

  • Type: WaitOnOptions
  • Description: Configuration options for the wait-on package to wait for resources (such as HTTP endpoints) to become available before starting Cypress.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Keywords

FAQs

Package last updated on 06 Jun 2024

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