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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Update cy.visit to allow for visiting non-2xx response pages when option set #982

Merged

Conversation

@jamsinclair
Copy link
Contributor

@jamsinclair jamsinclair commented Nov 29, 2017

Address #574 #421

Attempt at adding the behaviour as described in #574.

Feature

Allows cy.visit to successfully visit a page which responds with a non-2xx status.

This is opt-in only behaviour and is configured by setting the optionfailOnStatusCode to false.
Similar behaviour to cy.request.

Use Case

Writing tests for a 404 page and validating the UI looks/behaves as expected.


I saw in the readme for the Driver package that the tests were no longer relevant? Anywhere else I should be adding test cases?

Let me know if any more changes or tests you require 馃槃

@CLAassistant
Copy link

@CLAassistant CLAassistant commented Nov 29, 2017

CLA assistant check
All committers have signed the CLA.

@brian-mann
Copy link
Member

@brian-mann brian-mann commented Nov 29, 2017

Oh god I have no idea why the readme says that. It's completely inaccurate. I'll clean it up.

The driver is the single most tested package we have.

To test the driver couldn't be easier - you just write a regular cypress test!

In this case you need something to return you a 404 status code - so you'd add a route here: https://github.com/cypress-io/cypress/blob/develop/packages/driver/test/support/server.coffee

And then you'd add a test here in this block: https://github.com/cypress-io/cypress/blob/develop/packages/driver/test/cypress/integration/commands/navigation_spec.coffee#L414

To start the testing just npm start inside of the driver to boot the server, and then just run npm start in the root repo to boot cypress, and add driver/test into cypress. Then it acts like a normal project. I will document all this in the readme.

@brian-mann
Copy link
Member

@brian-mann brian-mann commented Nov 29, 2017

All this looks good. I'll cleanup a couple stylistic things, and assuming the tests pass we'll merge this in tonight.

@jamsinclair
Copy link
Contributor Author

@jamsinclair jamsinclair commented Nov 29, 2017

Awesome, go for it! Thanks for your help @brian-mann.

@brian-mann brian-mann merged commit 875e378 into cypress-io:develop Dec 3, 2017
21 checks passed
21 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: desktop-gui-integration-tests-1 Your tests passed on CircleCI!
Details
ci/circleci: desktop-gui-integration-tests-2 Your tests passed on CircleCI!
Details
ci/circleci: desktop-gui-integration-tests-3 Your tests passed on CircleCI!
Details
ci/circleci: driver-integration-tests-1 Your tests passed on CircleCI!
Details
ci/circleci: driver-integration-tests-2 Your tests passed on CircleCI!
Details
ci/circleci: driver-integration-tests-3 Your tests passed on CircleCI!
Details
ci/circleci: driver-integration-tests-4 Your tests passed on CircleCI!
Details
ci/circleci: driver-integration-tests-5 Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: run-launcher Your tests passed on CircleCI!
Details
ci/circleci: server-e2e-tests-1 Your tests passed on CircleCI!
Details
ci/circleci: server-e2e-tests-2 Your tests passed on CircleCI!
Details
ci/circleci: server-e2e-tests-3 Your tests passed on CircleCI!
Details
ci/circleci: server-e2e-tests-4 Your tests passed on CircleCI!
Details
ci/circleci: server-e2e-tests-5 Your tests passed on CircleCI!
Details
ci/circleci: server-integration-tests Your tests passed on CircleCI!
Details
ci/circleci: server-unit-tests Your tests passed on CircleCI!
Details
ci/circleci: unit-tests Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details
@jennifer-shehane jennifer-shehane added this to the 1.1.3 milestone Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants