Skip to content

Develop #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 60 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"hexo": {
"version": "3.4.4"
"version": "3.5.0"
},
"engines": {
"node": "^8.4.0"
Expand Down Expand Up @@ -103,7 +103,7 @@
"lazy-ass": "^1.6.0",
"lodash": "4.17.4",
"lunr": "2.1.5",
"menuspy": "1.2.1",
"menuspy": "1.3.0",
"scrollingelement": "1.5.2"
}
}
}
24 changes: 15 additions & 9 deletions source/_data/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,33 @@
link: https://github.com/cypress-io/cypress-browserify-preprocessor
keywords: [browserify]

- name: Webpack
description: Watches and bundles your spec files via webpack.
link: https://github.com/cypress-io/cypress-webpack-preprocessor
keywords: [webpack]
- name: Cucumber
description: Run cucumber/gherkin-syntaxed specs with cypress.io
link: https://github.com/TheBrainFamily/cypress-cucumber-preprocessor
keywords: [file-watcher, cucumber]

- name: Watch
description: Watches your spec files and serves them as-is. Useful as an example reference or if you don't need transpiling/bundling.
link: https://github.com/cypress-io/cypress-watch-preprocessor
keywords: [file-watcher]

- name: Webpack
description: Watches and bundles your spec files via webpack.
link: https://github.com/cypress-io/cypress-webpack-preprocessor
keywords: [webpack]


- name: Development Tools
plugins:
- name: ESLint
description: ESLint plugin that sets globals for writing tests in Cypress.
link: https://github.com/cypress-io/eslint-plugin-cypress
keywords: [eslint]

- name: Docker
description: Docker images providing all the dependencies to run Cypress in CI including browsers.
link: https://github.com/cypress-io/cypress-docker-images
keywords: [docker, continuous-integration]

- name: ESLint
description: ESLint plugin that sets globals for writing tests in Cypress.
link: https://github.com/cypress-io/eslint-plugin-cypress
keywords: [eslint]

- name: TypeScript
description: Official TypeScript definitions for the Cypress API.
Expand Down
6 changes: 3 additions & 3 deletions source/api/cypress-api/dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Cypress.dom.isHidden(element)
Cypress internally uses this method *everywhere* to figure out whether an element is hidden, {% url "mostly for actionability" interacting-with-elements %}.

```javascript
const $el = $("#modal")

Cypress.dom.isHidden($el) // => false
cy.get('p').then(($el) => {
Cypress.dom.isHidden($el) // false
})
```
68 changes: 44 additions & 24 deletions source/guides/guides/continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,60 @@ Depending on which CI provider you use, you may need a config file. You'll want
***Example `.travis.yml` config file***

```yaml
language: node_js
node_js:
- 6
cache:
directories:
- ~/.npm
- node_modules
install:
- npm install
script:
- cypress run --record
- $(npm bin)/cypress run --record
```

Caching folders with NPM modules saves a lot of time after the first build.

## CircleCI

***Example `circle.yml` config file***
***Example `circle.yml` v1 config file***

```yaml
machine:
node:
version: 6
dependencies:
cache_directories:
- ~/.npm
- node_modules
pre:
- npm install
test:
override:
- cypress run --record
- $(npm bin)/cypress run --record
```

***Example `circle.yml` v2 config file***

```yaml
version: 2
jobs:
build:
docker:
- image: cypress/base:6
environment:
## this enables colors in the output
TERM: xterm
working_directory: ~/app
steps:
- checkout
- run: npm install
- run: $(npm bin)/cypress run --record
```

Find the complete CircleCI v2 example with caching and artifact upload in [cypress-example-docker-circle](https://github.com/cypress-io/cypress-example-docker-circle) repo.

## Docker

We have {% url 'created' https://github.com/cypress-io/cypress-docker-images %} an official {% url 'cypress/base' 'https://hub.docker.com/r/cypress/base/' %} container with all of the required dependencies installed. Just add Cypress and go! We are also adding images with browsers pre-installed under {% url 'cypress/browsers' 'https://hub.docker.com/r/cypress/browsers/' %} name. A typical Dockerfile would look like this:
Expand Down Expand Up @@ -223,27 +263,7 @@ However, if you're running this script locally you'll have to do a bit more work

### Helpers

There are two little utilities we recommend to start the server, run the tests and then shutdown the server. The first is {% url npm-run-all https://github.com/mysticatea/npm-run-all %}.

```shell
npm install --save-dev npm-run-all
```

Set the test script command in your package file to use {% url run-p https://github.com/mysticatea/npm-run-all/blob/master/docs/run-p.md %} command.

```json
{
"scripts": {
"start": "my-server",
"cy:run": "cypress run",
"test": "run-p --race start cy:run"
}
}
```

From your terminal and on CI now simply run `npm test` and the server will be closed after the tests finish.

If the server takes a very long time to start and Cypress times out at first, we recommend using {% url start-server-and-test https://github.com/bahmutov/start-server-and-test %} utility.
If the server takes a very long time to start, and Cypress times out while loading the page, we recommend using {% url start-server-and-test https://github.com/bahmutov/start-server-and-test %} utility.

```shell
npm install --save-dev start-server-and-test
Expand Down