Skip to content

Develop #432

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 9 commits into from
Mar 2, 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
132 changes: 114 additions & 18 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"colors": "^1.1.2",
"common-tags": "^1.4.0",
"concurrent-transform": "^1.0.0",
"cypress": "^2.0.0",
"cypress": "^2.1.0",
"dependency-check": "^3.0.0",
"deps-ok": "^1.2.0",
"eslint": "4.18.1",
Expand Down
4 changes: 2 additions & 2 deletions source/guides/core-concepts/introduction-to-cypress.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Later in this guide we'll go into much more detail about {% urlHash 'Default Ass

# Chains of Commands

It's very important to understand the mechanism Cypress uses to chain commands together. It manages a Promise chain on your behalf, with each command yielding a subject to the next command, until the chain ends or an error is encountered. The developer should not need to use Promises directly, but understanding how they work is helpful!
It's very important to understand the mechanism Cypress uses to chain commands together. It manages a Promise chain on your behalf, with each command yielding a 'subject' to the next command, until the chain ends or an error is encountered. The developer should not need to use Promises directly, but understanding how they work is helpful!

## Interacting With Elements

Expand All @@ -225,7 +225,7 @@ cy.get('textarea.post-body')
.type('This is an excellent post.')
```

We're chaining the {% url `.type()` type %} onto the {% url `cy.get()` get %}, telling it to type into the "subject" yielded from the {% url `cy.get()` get %} command, which will be a DOM element.
We're chaining the {% url `.type()` type %} onto the {% url `cy.get()` get %}, telling it to type into the subject yielded from the {% url `cy.get()` get %} command, which will be a DOM element.

Here are even more action commands Cypress provides to interact with your app:

Expand Down
4 changes: 2 additions & 2 deletions source/guides/references/trade-offs.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Many of these issues are currently being worked on or are on our {% url "Roadmap
- {% issue 181 "You can take screenshots, but diffing them needs work." %}
- {% issue 685 "Iframe support is somewhat limited, but does work." %}
- {% issue 310 "There is no cross browser support other than Chrome and Electron." %}
- {% issue 95#issuecomment-281273126 "You cannot use `cy.route()` on `window.fetch` but there is a workaround" %}, also a {% url "recipe here." https://github.com/cypress-io/cypress-example-recipes/blob/master/cypress/integration/spy_stub_clock_spec.js %}
- {% issue 95#issuecomment-281273126 "You cannot use `cy.route()` on `window.fetch` but there is a workaround." %}, also a {% url "recipe here." https://github.com/cypress-io/cypress-example-recipes/blob/master/examples/stubbing-spying__window-fetch/cypress/integration/spy-stub-clock-spec.js %}

# Permanent trade-offs

Expand All @@ -57,7 +57,7 @@ But what this also means is that your test code **is being evaluated inside the

This trade-off means it makes it a little bit harder to communicate with the backend - like your server or database. You will not be able to connect or import those server-side libraries or modules directly. Although you can of course require `node_modules` which can be used in the browser. Additionally, you will soon have the ability to use `Node.js` to import or talk directly to your backend scripts once {% issue 684 %} lands.

To talk to your database or server you need to user the {% url `cy.exec()` exec %} or {% url `cy.request()` request %} commands. That means you will need to expose a way to seed and setup your database. This really is not that hard, but it might take a bit more elbow grease than another testing tools written in your backend language.
To talk to your database or server you need to use the {% url `cy.exec()` exec %} or {% url `cy.request()` request %} commands. That means you will need to expose a way to seed and setup your database. This really is not that hard, but it might take a bit more elbow grease than another testing tools written in your backend language.

The trade-off here is that doing everything in the browser (basically all of your tests) is a much better experience in Cypress. But doing things outside of the browser may take a little extra work.

Expand Down