# cypress-ci

> Integrate Cypress into your CI provider

Latest version **0.2.6** (published 2022-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install cypress-ci
pnpm add cypress-ci
yarn add cypress-ci
bun add cypress-ci
```

Provides the command `cypress-ci`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.6 |
| Published | 2022-09-22 |
| First published | 2022-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 22.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jeongmin Woo |
| Maintainers | greenblues1190 |
| Keywords | ci, e2e, test, parallel, automate, cypress, jenkins |

## Links

- npm: https://www.npmjs.com/package/cypress-ci
- Repository: https://github.com/greenblues1190/cypress-ci
- Issues: https://github.com/greenblues1190/cypress-ci/issues
- npm.io page: https://npm.io/package/cypress-ci

## Dependencies (5)

- [cypress](https://npm.io/package/cypress.md) ^10.8.0
- [wait-on](https://npm.io/package/wait-on.md) ^6.0.1
- [commander](https://npm.io/package/commander.md) ^9.4.0
- [deepmerge](https://npm.io/package/deepmerge.md) ^4.2.2
- [ts-import](https://npm.io/package/ts-import.md) ^4.0.0-beta.6

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.2.6 (latest) — 2022-09-22
- 0.2.5 — 2022-09-22
- 0.2.4 — 2022-09-22
- 0.2.3 — 2022-09-22
- 0.2.2 — 2022-09-22
- 0.2.1 — 2022-09-22
- 0.2.0 — 2022-09-21
- 0.1.1 — 2022-09-20
- 0.1.0 — 2022-09-20

## README

# cypress-ci

Integrate [Cypress](https://www.cypress.io/) into your CI provider

## Features

- [x] **out of the box** (integration without extra jobs)
- [x] **automated** (start server and test, abort CI build when a test fails)
- [x] **safe** (no more `Ctrl-C`, server will be shutdown gracefully)
- [x] **extendable** (import local Cypress configuration file)
- [x] **reports** (export test result as a file while logging console outputs)

## Usages

Add the script below in build script in your CI provider before a build.

```sh
cypress-ci -s <serve> -u <url>
```

### Examples

Jenkins freestyle with npm scripts

```bash
#!/bin/bash
cd /var/lib/jenkins/workspace/your-project-directory
npm ci
npm run cypress:ci
npm run build
```

## Installation

### npm

```sh
npm install --save-dev cypress-ci
```

### yarn

```sh
yarn add --dev cypress-ci
```

## Integration with CI providers

### Prerequisites

You need [dependencies](https://docs.cypress.io/guides/continuous-integration/introduction.html#Dependencies) below before running Cypress in CI providers.

#### Use official Cypress docker images

Read official Cypress documents

- https://docs.cypress.io/examples/examples/docker#Images
- https://www.cypress.io/blog/2019/05/02/run-cypress-with-a-single-docker-command/

#### Install manually on Linux

Ubuntu/Debian

```sh
apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
```

CentOS

```sh
yum install -y xorg-x11-server-Xvfb gtk2-devel gtk3-devel libnotify-deve
```

### npm scripts

```json
"scripts": {
  "start": "webpack serve --config webpack.config.js",
  "cypress:ci": "cypress-ci -s start -u http://localhost:3000 -c cypress.ci.json"
}
```

#### Available Options

| option            | description                                      | default                 |
| ----------------- | ------------------------------------------------ | ----------------------- |
| `-s`, `--serve`   | script to run server                             | `start`                 |
| `-u`, `--url`     | url to test                                      | `http://localhost:3000` |
| `-t`, `--timeout` | maximum time in ms to wait for a server response | 60000                   |
| `-V`, `--version` | output the version number                        |
| `-h`, `--help`    | display help for command                         |

## Roadmap

- [x] Import and override Cypress config file
- [x] Support typescript
- [ ] Run on a docker image
- [ ] Provide webpack plugin

## License

MIT

---
_Source: https://npm.io/package/cypress-ci · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
