cy2

    1.3.0 • Public • Published

    cy2

    npm downloads AppVeyour CircleCI

    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

    CYPRESS_API_URL="http://localhost:1234/" cy2 open

    Example usage with sorry-cypress

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

    When CYPRESS_API_URL is not available, it just uses the default API server.

    API

    Patch cypress package

    patch(apiURL: string) => Promise<void>

    Patch and run cypress

    run(apiURL?: string = 'https://yourserver.io/'), label?: string = 'cy2')=> Promise<void>

    Examples

    const { patch } = require('cy2');
    
    async function main() {
      await patch('https://sorry-cypress-demo-director.herokuapp.com');
    }
    
    main().catch(console.error);
    #!/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
    
    */

    Install

    npm i cy2

    DownloadsWeekly Downloads

    48,973

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    9.66 kB

    Total Files

    8

    Last publish

    Collaborators

    • agoldis