Skip to content
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

Develop #196

Merged
merged 19 commits into from
Nov 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public/
.DS_Store
.deploy*/
support
.idea/

themes/cypress/source/css/vendor/
themes/cypress/source/js/vendor/
Expand Down
52 changes: 52 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Contributor Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [[email protected]](mailto:[email protected]). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
6 changes: 6 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!--
Thanks for contributing!

Please explain what changes were made and also
reference any issues that were fixed with #[ISSUE]
-->
3 changes: 2 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ jobs:
- save_cache:
key: cypress-documentation-{{ .Branch }}-{{ .Revision }}
paths:
- /home/person/cypress-documentation
- /root/cypress-documentation

"docs-tests":
<<: *defaults
steps:
- restore_cache:
key: cypress-documentation-{{ .Branch }}-{{ .Revision }}
- run: ls -la
- run: npm run deps
- run: npm run lint
- run: npm test
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Cypress Documentation [![CircleCI](https://circleci.com/gh/cypress-io/cypress-documentation.svg?style=svg&circle-token=8a0253363287ab85d52953467603a4099a360c0c)](https://circleci.com/gh/cypress-io/cypress-documentation) [![Cypress Dashboard](https://img.shields.io/badge/cypress-dashboard-brightgreen.svg)](https://dashboard.cypress.io/#/projects/ma3dkn/runs) [![first-timers-only](http://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/cypress-io/cypress-documentation/labels/first-timers-only)
# Cypress Documentation [![CircleCI](https://circleci.com/gh/cypress-io/cypress-documentation.svg?style=svg)](https://circleci.com/gh/cypress-io/cypress-documentation) [![Cypress Dashboard](https://img.shields.io/badge/cypress-dashboard-brightgreen.svg)](https://dashboard.cypress.io/#/projects/ma3dkn/runs) [![first-timers-only](http://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/cypress-io/cypress-documentation/labels/first-timers-only)

The code for Cypress Documentation including Guides, API, Examples, Dashboard & FAQ found at https://docs.cypress.io.

![Cypress Documentation Preview](https://user-images.githubusercontent.com/1271364/30174196-3eedba92-93c8-11e7-854c-7fc8b2829ec6.png)
![Cypress Documentation Preview](https://user-images.githubusercontent.com/1271364/32280553-aa89695e-bef2-11e7-9cea-c2e99406eed0.png)

## Getting Started

Expand Down
4 changes: 2 additions & 2 deletions source/api/commands/_scrollto.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ cy.scrollTo(x, y, options)

## Usage

`cy.scrollTo()` can be chained off of `cy` to scroll to a position in the window or chained off another cy command that *yields* a DOM element - limiting scrolling to it's yielded element.
`cy.scrollTo()` can be chained off of `cy` to scroll to a position in the window or chained off another cy command that *yields* a DOM element - limiting scrolling to its yielded element.

```javascript
cy.scrollTo(0, 500) // Scroll the window 500px down
cy.get('.sidebar').scrollTo('bottom') // Scroll 'sidebar' to it's bottom
cy.get('.sidebar').scrollTo('bottom') // Scroll 'sidebar' to its bottom
```

**{% fa fa-exclamation-triangle red %} Incorrect Usage**
Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/closest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: closest
comments: false
---

Get the first DOM element that matches the selector (whether it be itself or one of it's ancestors).
Get the first DOM element that matches the selector (whether it be itself or one of its ancestors).

{% note info %}
The querying behavior of this command matches exactly how {% url `.closest()` http://api.jquery.com/closest %} works in jQuery.
Expand Down
4 changes: 2 additions & 2 deletions source/api/commands/contains.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Get the DOM element containing the content.

**{% fa fa-angle-right %} selector** ***(String selector)***

Specify a selector to filter DOM elements containing the text. Cypress will *ignore* it's {% urlHash 'default preference order' Notes %} for the specified selector. Using a selector allows you to return more *shallow* elements (higher in the tree) that contain the specific text.
Specify a selector to filter DOM elements containing the text. Cypress will *ignore* its {% urlHash 'default preference order' Notes %} for the specified selector. Using a selector allows you to return more *shallow* elements (higher in the tree) that contain the specific text.

**{% fa fa-angle-right %} options** ***(Object)***

Expand Down Expand Up @@ -167,7 +167,7 @@ cy.contains('ul', 'apples')

## Scopes

`.contains()` acts differently whether its starting a series of commands or being chained off of an existing.
`.contains()` acts differently whether it's starting a series of commands or being chained off of an existing.

***When starting a series of commands:***

Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/fixture.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Option | Default | Description

## Yields {% helper_icon yields %}

`cy.fixture()` yields the contents of the file. Formatting is determined by it's file extension.
`cy.fixture()` yields the contents of the file. Formatting is determined by its file extension.

# Examples

Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/getcookie.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: getCookie
comments: false
---

Get a browser cookie by it's name.
Get a browser cookie by its name.

# Syntax

Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ beforeEach(function(){

***Issue a simple HTTP request***

Sometimes it is quicker to simply test the contents of a page rather than {% url `cy.visit()` visit %} and wait for the entire page and all of it's resource to load.
Sometimes it is quicker to simply test the contents of a page rather than {% url `cy.visit()` visit %} and wait for the entire page and all of its resource to load.

```javascript
cy.request('/admin').its('body').should('include', '<h1>Admin</h1>')
Expand Down
4 changes: 2 additions & 2 deletions source/api/commands/route.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ cy.route('/users/*', 'fixture:users/all.json').as('getUsers')
cy.route('/admin/*', 'fx:users/admin.json').as('getAdmin')
```

You may want to define the `cy.route()` after receiving the fixture and working with it's data.
You may want to define the `cy.route()` after receiving the fixture and working with its data.

```javascript
cy.fixture('user').then((user) => {
Expand Down Expand Up @@ -387,7 +387,7 @@ cy.route(() => {

***Understanding Stubbed vs Regular XHR's***

Cypress indicates whether an XHR sent back a stubbed response or actually went out to a server in it's Command Log
Cypress indicates whether an XHR sent back a stubbed response or actually went out to a server in its Command Log

XHR's that display `(XHR STUB)` in the Command Log have been stubbed and their response, status, headers, and delay have been controlled by your matching `cy.route()`.

Expand Down
4 changes: 2 additions & 2 deletions source/api/commands/scrollto.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cy.scrollTo(x, y, options)

```javascript
cy.scrollTo(0, 500) // Scroll the window 500px down
cy.get('.sidebar').scrollTo('bottom') // Scroll 'sidebar' to it's bottom
cy.get('.sidebar').scrollTo('bottom') // Scroll 'sidebar' to its bottom
```

**{% fa fa-exclamation-triangle red %} Incorrect Usage**
Expand Down Expand Up @@ -125,7 +125,7 @@ cy.get('#slider').scrollTo('right', { duration: 2000} )

## Scopes

`cy.scrollTo()` acts differently whether its starting a series of commands or being chained off of an existing.
`cy.scrollTo()` acts differently whether it's starting a series of commands or being chained off of an existing.

***When starting a series of commands:***

Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ The idea is that we never want to interfere with static assets that are fetched
```javascript
var whitelist = function(xhr){
// this function receives the xhr object in question and
// will whitelist if its a GET that appears to be a static resource
// will whitelist if it's a GET that appears to be a static resource
xhr.method === 'GET' && /\.(jsx?|html|css)(\?.*)?$/.test(xhr.url)
}
```
Expand Down
4 changes: 2 additions & 2 deletions source/api/commands/spread.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ comments: false
Expand an array into multiple arguments.

{% note info %}
Identical to {% url `.then()` then %}, but always expects an array-like structure as it's subject.
Identical to {% url `.then()` then %}, but always expects an array-like structure as its subject.
{% endnote %}

# Syntax
Expand Down Expand Up @@ -35,7 +35,7 @@ cy.location().spread() // Errors, 'location' does not yield an array

**{% fa fa-angle-right %} fn** ***(Function)***

Pass a function that expands the array into it's arguments.
Pass a function that expands the array into its arguments.

**{% fa fa-angle-right %} options** ***(Object)***

Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/submit.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ cy.get('#contact').submit()

`.submit()` is just a helpful command which is a simple shortcut. Normally a user has to perform a different "action" to submit a form. It could be clicking a submit `<button>`, or pressing `enter` on a keyboard.

Oftentimes its much simpler and conveys what you're trying to test by just using `.submit()` directly.
Oftentimes it's much simpler and conveys what you're trying to test by just using `.submit()` directly.

If you want the other guarantees of waiting for an element to become actionable, you should use a different command like {% url `.click()` click %} or {% url `.type()` type %}.

Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/then.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cy.location().then((loc) => {}) // Yields location object as first arg

**{% fa fa-angle-right %} callbackFn** ***(Function)***

Pass a function that takes the previously yielded subject as it's first argument.
Pass a function that takes the previously yielded subject as its first argument.

**{% fa fa-angle-right %} options** ***(Object)***

Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/viewport.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ You can {% url 'change these default dimensions' configuration#Viewport %} by ad
}
```

Additionally, Cypress automatically sets the viewport to it's default size between each test.
Additionally, Cypress automatically sets the viewport to its default size between each test.

## Scaling

Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/wait.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ cy.wait(2000) // wait for 2 seconds
{% note warning 'Anti-Pattern' %}
You almost **never** need to wait for an arbitrary period of time. There are always better ways to express this in Cypress.

Passing a number to `cy.wait()` exists because its sometimes helpful when debugging to isolate a test failure you're trying to temporarily understand.
Passing a number to `cy.wait()` exists because it's sometimes helpful when debugging to isolate a test failure you're trying to temporarily understand.

Read about {% url 'best practices' best-practices#Unnecessary-Waiting %} here.
{% endnote %}
Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/within.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cy.getCookies().within(function() {}) // Errors, 'getCookies' does not yield DOM

**{% fa fa-angle-right %} callbackFn** ***(Function)***

Pass a function that takes the current yielded subject as it's first argument.
Pass a function that takes the current yielded subject as its first argument.

**{% fa fa-angle-right %} options** ***(Object)***

Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/writefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Option | Default | Description

***Write some text to a `txt` file***

If the path to the file does not exist, the file and it's path will be created. If the file already exists, it will be over-written.
If the path to the file does not exist, the file and its path will be created. If the file already exists, it will be over-written.

```javascript
cy
Expand Down
8 changes: 4 additions & 4 deletions source/api/cypress-api/custom-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ Cypress.Commands.add('contains', {
prevSubject: ['optional', 'window', 'document', 'element']
}, (subject, options) => {
// subject could be undefined
// since its optional.
// since it's optional.
//
// if its present
// if it's present
// then its window, document, or element.
// - when window or document we'll query the entire DOM.
// - when element we'll query only inside of its children.
Expand All @@ -369,7 +369,7 @@ Cypress.Commands.add('contains', {
**{% fa fa-check-circle green %} Valid Usage**

```javascript
cy.contains() // no subject, but valid because its optional
cy.contains() // no subject, but valid because it's optional
cy.get('#main').contains() // has subject, and is `element`
cy.window().contains() // has subject, and is `window`
cy.document().contains() // has subject, and is `document`
Expand Down Expand Up @@ -400,7 +400,7 @@ Take advantage of the {% url `Cypress.log()` cypress-log %} API. When you're iss

Custom commands work well when you're needing to describe behavior that's desirable across **all of your tests**. Examples would be a `cy.setup()` or `cy.login()` or extending your application's behavior like `cy.get('.dropdown').dropdown('Apples')`. These are specific to your application and can be used everywhere.

However, this pattern can be used and abused. Let's not forget - writing Cypress tests is just **JavaScript**, and its often much easier just to write a simple function for repeatable behavior that's specific to only **a single spec file**.
However, this pattern can be used and abused. Let's not forget - writing Cypress tests is just **JavaScript**, and it's often much easier just to write a simple function for repeatable behavior that's specific to only **a single spec file**.

If you're working on a `search_spec.js` file and want to compose several repeatable actions together, you should first ask yourself:

Expand Down
10 changes: 5 additions & 5 deletions source/api/events/catalog-of-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Event | Details
--- | ---
**Name:** | `fail`
**Yields:** | the error **(Object)**, mocha runnable **(Object)**
**Description:** | Fires when the test has failed. It is technically possible to prevent the test from actually failing by binding to this event and invoking an async `done` callback. However this is **strongly discouraged**. Tests should never legitimately fail. This event exists because its extremely useful for debugging purposes.
**Description:** | Fires when the test has failed. It is technically possible to prevent the test from actually failing by binding to this event and invoking an async `done` callback. However this is **strongly discouraged**. Tests should never legitimately fail. This event exists because it's extremely useful for debugging purposes.

Event | Details
--- | ---
Expand Down Expand Up @@ -171,7 +171,7 @@ The `cy` object is bound to each individual test. Events bound to `cy` will **au

```javascript
// likely want to do this in a support file
// so its applied to all spec files
// so it's applied to all spec files
// cypress/support/index.js

Cypress.on('uncaught:exception', (err, runnable) => {
Expand All @@ -187,7 +187,7 @@ Cypress.on('uncaught:exception', (err, runnable) => {
```javascript
it('is doing something very important', function(done) {
// this event will automatically be unbound when this
// test ends because its attached to 'cy'
// test ends because it's attached to 'cy'
cy.on('uncaught:exception', (err, runnable) => {
expect(err.message).to.include('something about the error')

Expand Down Expand Up @@ -244,7 +244,7 @@ $('button').on('click', (e) => {
// test code
it('redirects to another page on click', function (done) {
// this event will automatically be unbound when this
// test ends because its attached to 'cy'
// test ends because it's attached to 'cy'
cy.on('window:before:unload', (e) => {
// no return value on the event
expect(e.returnValue).to.be.undefined
Expand Down Expand Up @@ -332,7 +332,7 @@ it('can control application confirms', function (done) {
// confirm method is called in your application
//
// this event will automatically be unbound when this
// test ends because its attached to 'cy'
// test ends because it's attached to 'cy'
cy.on('window:confirm', (str) => {
count += 1

Expand Down
2 changes: 1 addition & 1 deletion source/dashboard/overview/runs-dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You will also see a summary at the bottom indicating the files we've created dur

## {% fa fa-exclamation-triangle fa-fw %} Test Failures

Any tests that fail during a test run can be found under the **Failures** tab. Each failure is listed under it's test title.
Any tests that fail during a test run can be found under the **Failures** tab. Each failure is listed under its test title.

***Each failure displays:***

Expand Down
Loading