Commit Graph

11855 Commits

Author SHA1 Message Date
Ben Kucera
b6ece46c39 fix appveyor build binary only on develop branch (#4234)
* testing code for appveyor env vars

* fix appveyor env vars for branchname
06-00000026

* add comments for clarification
06-00000056
2019-05-20 12:27:43 -04:00
Brian Mann
f679ced981 release 3.3.0 [skip ci] v3.3.0 2019-05-17 12:14:50 -04:00
Jennifer Shehane
cb51d5ed38 update Test Runner to handle API errs for non-private test limits (#4025)
* update Test Runner to handle API errs for non-private test limits

* update record errors to factor in private vs regular tests

- manually reconcile and update all snapshots —______________—


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-05-17 10:36:03 -04:00
Brian Mann
77c62e010b improve CLI verify + run display warnings (#4230)
* tighten up potential xvfb display problems

- improve the warning message on possible display problems
- reuse existing helper functions for platform detection
- instead of relying on timing mechanisms, if a possible display
problem is detected on linux - capture all of the stderr silently and
if the broken gtk message is detected, retry running

* consolidated and simplified smoke testing, xvfb error logging and messaging

- added —dev support to cypress verify cli command

* fix lots of tests, restore one error message

* fixed remaining CLI tests

* console.log pong only in electron mode

* remove dead code
2019-05-17 09:12:03 -04:00
renovate[bot]
9bdc9eb7c5 chore(deps): update dependency husky to version .x 🌟 (#4228)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-17 15:39:17 +06:30
renovate[bot]
9e592aab11 chore(deps): update dependency lint-staged to version .x 🌟 (#4223)
* chore(deps): update lint-staged to 7.3.0 🌟

* update lint-staged call to new syntax (they removed implicit npm script call)


Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-05-17 13:49:52 +06:30
Zach Bloomquist
6b1d686ed2 Don't send Cypress error HTML on network errors (#4105)
* retry requests, basic e2e test

* basic e2e test for chrome behavior

* don't use timeouts to test

* some minor cleanup

* validate google chrome's retry behavior w/ a proxy

* get retries on network errors workin

* cleanup

* final changes before switching approach

* Reverting previous approach in request.coffee, server.coffee

* add retryOnNetworkFailure

* now works with retryOnStatusCodeFailure

* retry 4 times in addition to the 1 initial attempt

* add tests for subresources

* much improved error handling

* have the e2e test really work

* e2e baseurl check

* retry baseurl check

* remove special handling for node 8.2.1 bug

* WIP: continue making progress building out request retry

- swap out passthrough’s for pumpify / duplexify / pump
- clean up error handling / messaging / retry logic

* pipe clientrequest events

* buffer req body to disk, restore error handling/retrying

* don't bubble up errors from failed attempts

* actually pipe reqstream, oops

* add some e2e tests for request body

* revert lib/request.coffee to 7be1051

* add almost-working lazy-stream

* manually fire the 'pipe' event on the reqStream to copy headers to the outgoing message

- restore the ‘error’ propagation so that all tests pass for now

* cleanup leaking 'undefined' into stdout, causing failing e2e tests

- do not set onWarning as a property of project, just pass as an
argument

* add new options to request_spec, deduplicate default opts

* use stream buffer in request.coffee

* revert request.coffee

* last stream_buffer changes before removing fs stuff

* remove fs stuff from stream_buffer, add stream piping tests

* it works! :tada::tada:🎉 using duplexify to separate delayStream and reqBodyBuffer

* retry for .5s max on ECONNREFUSED

* add error codes

* don't timeout proxied requests

* restore baseurl check

* update new e2e tests

* make delay work with rp

* propagate clientresponse events

* removing tests that don't do anything now that we don't ESOCKETTIMEOUT on proxied requests

* add new visit, req options to index.d.ts

* don't fail on server-performance-test

* make retries with status code work again

* account for different stack trace in ci

* fix test

* retry https requests

* add tests for https passthru retries working

* clean up error handling for https-proxy

* fix failing https-proxy tests, tweak agent error handling to prevent multiple callbacks

* make expectedExitCode actual vs. expected in the correct order

* bump up e2e test timeout so it can retry and still work

* don't show cypress error page on network errors, gzip errors

* update tests

* clean up onWarning code

* add tests for incompatible options errors

* retry up to 500ms on proxied requests

* remove .only

* add tests for incompatible options errors

* remove .only

* maybe this will help it act more consistently

* help e2e test work in ci

* don't re-pipe the gzip response to client, the response is already gone

In the event that a gzip response has an error and we're not doing full injecting (ie, not buffering the response in memory), we can't just re-stream it.

By the time we do the second .pipe, the stream is already empty.

So, let's just error out anyways, which is what the browser would do (error).

* remove test for injecting into net error 500 pages in iframes

* update visit spec to expect an actual error, not Cypress HTML on visit timeouts

* update el snapshot

* don't reconnect on already made connections

* clarify naming

* wip: testing https proxy

* better debug calls

* WIP: getting proxy passthrough retry tests going

* handle retrying upstream proxy errors

- add tests for successfully retrying proxy errors and for unsuccessful
retries
- fix onClose errors when proxy connection is closed before enough data
is received
- fix not returning setTimeout correctly

* group related code accordingly

* do not build typescript by default, drop extension from main

* more TODO notes

* don't set a default NO_PROXY if NO_PROXY = ''

* debugging-proxy@2.0.0

* null out reqBodyBuffer when req finishes

* wip: retry in agent, not https-proxy [skip-ci]

* update https-proxy to use @packages/network retries

* retry after connection but before proxy tunnel established

* appease my linty overlords

* update https-proxy tests

* update agent specs, decided to still use tls.connect

it's easier to test and has less complexity

* test retrying HTTPS passthru

* debugging-proxy@2.0.1

* increase defaultCommandTimeout 100 -> 200 to prevent flake in CI

* auto formatting

* fix test to be dynamic and not rely on magic constants

* copy types field when linking proxy images, update packages/network types field

* linting

* add network index.js file

* linting

* improve error messaging experience when verifying base url

* only insert 1 new line

* fix failing test not binding to localhost

* removed test that's covered by e2e specs

* remove dash in 're-try'

* some cleanup for readability

* use allocUnsafe per perf

* unset NO_PROXY with an empty string

* move retry ensuring the baseUrl into url, cleanup some imperative code

* if the head is already present during connect, make connection, else wait for first head bytes

* minor formatting, clarity around conditions, naming

* rename retryInterval -> retryIntervals

* set defaults for requests during creation for clarity

* rename send -> sendPromise to pair better with sendStream

* use retryIntervals instead of juggling MAX_REQUEST_RETRIES

- ensure debug messages are consistent between request streams +
promises
- set static constants

* DRY up status check + network failure + retry logic

- keeps the debug logic identical between promises + streams
- ensures all logic paths are also consistent
- consolidates the pop’ing of intervals in a single place

* find / replace fail

* derp

* make the logic actually correct, set intervals as cloned defaults for recursive lookup

* pass arg correctly

* reduce debugging noise, formatting

* rename intervals -> delaysRemaining for clarity

* added unit tests around getDelayForRetry

* set retryIntervals as default options correctly, add unit tests

* using single line when debugging objects

* restore snapshot to match develop

* restore snapshot and move failing tests in e2e visit around momentarily...

* WIP: add the failing tests back in

* add tests for promise/stream that we don't retry on timeouts but do retry on resets

* use create entrypoint for tests

* pass requestTimeout from cy.visit(), remove hard coded request timeout

* s/requestTimeout/responseTimeout

* clean up how we initiate the request stream

* buffer resolve:url response before resolving promise

* only persist the buffer to memory once response finishes

* update visit spec to fail with ESOCKETTIMEDOUT

* use stream.PassThrough to buffer the response stream

* always buffer response stream

* de-commit those screenshots

* buffer forever - node's default is only to buffer 16kB

* some cleanup and renaming vars

* re-remove screenshots

* do all resolution login in on(end)

* update test to call the sendRequest callback

* update comment

* enable resolving:url to cancel currently in flight promises and abort pending requests

* add test for only having one request in flight at a time

* test currentPromisePhase too

* make tests fast again™️

* cleanup the coffeescript conversion, use common-tags, and use res.end to write final chunk

* add test ensuring that responseTimeout is passed correctly when resolving the url via cy.visit()

* micro-opt to check if err.code is property of zlib.constants

* always destroy the request socket when gzip fails as opposed to forwarding the broken bytes

* cleanup, formatting


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-05-17 02:55:51 -04:00
renovate[bot]
83bc2cc83e chore(deps): update snap-shot-it to 7.4.4 🌟 (#4224) 2019-05-17 13:19:27 +06:30
renovate[bot]
c48dd1542f fix(deps): update dependency method-override to version .x 🌟 (#4209)
* fix(deps): update method-override to 3.0.0 🌟

* remove unused method-override devDep from driver

* oh, where is my mind, I got these backwards. Remove from server - leave in driver 😑


Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-05-17 12:13:39 +06:30
renovate[bot]
76cb0efe52 fix(deps): update dependency getos to version .x 🌟 (#4222)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-17 12:05:47 +06:30
renovate[bot]
dc2718d2f7 fix(deps): update dependency semver to version .x 🌟 (#4207)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-16 14:17:40 +06:30
renovate[bot]
3aec800050 fix(deps): update pluralize to 7.0.0 🌟 (#4206) 2019-05-16 13:15:38 +06:30
renovate[bot]
d55d3e5382 fix(deps): Update dependency pluralize to version .x 🌟 (#4205)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-16 12:08:00 +06:30
Jennifer Shehane
e3105fa17f Update Cypress.log to throw when not provided an obj + handle being called outside of command (#4159)
* Update Cypress.log to throw when not provided an object as its argument

* Add failing e2e test for Cypress.log being used without a cy command

* Write code to handle situation when log is run outside of a command

- add snapshot for passing situation

* have options be obj by default

* Replace end to end test with unit integration test

* Fix issue where if Cypress.Log is not passed a name, then the Command component wouldn't render

* remove excess whitespace
2019-05-16 11:18:40 +06:30
calvinballing
181c3624c5 Fix typos in selector-playground.spec.jsx ("Oop" > "Oops") (#4201)
* Clarifies error when focused element not found

Fixes #851 -> Updates Error Message for Clarity when unable to find a focused element

* Revert change to error message

* Fix typos ("Oop" > "Oops")
2019-05-16 11:17:43 +06:30
Zach Bloomquist
432b5366d9 Expose cy.isCy as Cypress.isCy, add typedefs (#4170)
* expose cy.isCy on Cypress object

* add typedefs for Cypress.isCy

* :face_palm:
2019-05-16 11:10:58 +06:30
renovate[bot]
b8c3b3d42f chore(deps): update dependency ts-node to version .x 🌟 (major) (#4197)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-16 10:29:13 +06:30
Zach Bloomquist
c3759d5213 Escape paths passed by --browser (#4011)
* add failing test

* launcher: escape path to browser in getVersionString

* fix test

* Use execa.stdout so we can just pass the path as-is, no escaping
2019-05-15 12:52:18 -04:00
Zach Bloomquist
b8a6baaca3 Retry certain requests on failure (#4015)
* retry requests, basic e2e test

* basic e2e test for chrome behavior

* don't use timeouts to test

* some minor cleanup

* validate google chrome's retry behavior w/ a proxy

* get retries on network errors workin

* cleanup

* final changes before switching approach

* Reverting previous approach in request.coffee, server.coffee

* add retryOnNetworkFailure

* now works with retryOnStatusCodeFailure

* retry 4 times in addition to the 1 initial attempt

* add tests for subresources

* much improved error handling

* have the e2e test really work

* e2e baseurl check

* retry baseurl check

* remove special handling for node 8.2.1 bug

* WIP: continue making progress building out request retry

- swap out passthrough’s for pumpify / duplexify / pump
- clean up error handling / messaging / retry logic

* pipe clientrequest events

* buffer req body to disk, restore error handling/retrying

* don't bubble up errors from failed attempts

* actually pipe reqstream, oops

* add some e2e tests for request body

* revert lib/request.coffee to 7be1051

* add almost-working lazy-stream

* manually fire the 'pipe' event on the reqStream to copy headers to the outgoing message

- restore the ‘error’ propagation so that all tests pass for now

* cleanup leaking 'undefined' into stdout, causing failing e2e tests

- do not set onWarning as a property of project, just pass as an
argument

* add new options to request_spec, deduplicate default opts

* use stream buffer in request.coffee

* revert request.coffee

* last stream_buffer changes before removing fs stuff

* remove fs stuff from stream_buffer, add stream piping tests

* it works! :tada::tada:🎉 using duplexify to separate delayStream and reqBodyBuffer

* retry for .5s max on ECONNREFUSED

* add error codes

* don't timeout proxied requests

* restore baseurl check

* update new e2e tests

* make delay work with rp

* propagate clientresponse events

* removing tests that don't do anything now that we don't ESOCKETTIMEOUT on proxied requests

* add new visit, req options to index.d.ts

* don't fail on server-performance-test

* make retries with status code work again

* account for different stack trace in ci

* fix test

* retry https requests

* add tests for https passthru retries working

* clean up error handling for https-proxy

* fix failing https-proxy tests, tweak agent error handling to prevent multiple callbacks

* make expectedExitCode actual vs. expected in the correct order

* bump up e2e test timeout so it can retry and still work

* update tests

* retry up to 500ms on proxied requests

* add tests for incompatible options errors

* remove .only

* maybe this will help it act more consistently

* help e2e test work in ci

* don't reconnect on already made connections

* clarify naming

* wip: testing https proxy

* better debug calls

* WIP: getting proxy passthrough retry tests going

* handle retrying upstream proxy errors

- add tests for successfully retrying proxy errors and for unsuccessful
retries
- fix onClose errors when proxy connection is closed before enough data
is received
- fix not returning setTimeout correctly

* group related code accordingly

* do not build typescript by default, drop extension from main

* more TODO notes

* don't set a default NO_PROXY if NO_PROXY = ''

* debugging-proxy@2.0.0

* null out reqBodyBuffer when req finishes

* wip: retry in agent, not https-proxy [skip-ci]

* update https-proxy to use @packages/network retries

* retry after connection but before proxy tunnel established

* appease my linty overlords

* update https-proxy tests

* update agent specs, decided to still use tls.connect

it's easier to test and has less complexity

* test retrying HTTPS passthru

* debugging-proxy@2.0.1

* increase defaultCommandTimeout 100 -> 200 to prevent flake in CI

* auto formatting

* fix test to be dynamic and not rely on magic constants

* copy types field when linking proxy images, update packages/network types field

* linting

* add network index.js file

* linting

* improve error messaging experience when verifying base url

* only insert 1 new line

* fix failing test not binding to localhost

* removed test that's covered by e2e specs

* remove dash in 're-try'

* some cleanup for readability

* use allocUnsafe per perf

* unset NO_PROXY with an empty string

* move retry ensuring the baseUrl into url, cleanup some imperative code

* if the head is already present during connect, make connection, else wait for first head bytes

* minor formatting, clarity around conditions, naming

* rename retryInterval -> retryIntervals

* set defaults for requests during creation for clarity

* rename send -> sendPromise to pair better with sendStream

* use retryIntervals instead of juggling MAX_REQUEST_RETRIES

- ensure debug messages are consistent between request streams +
promises
- set static constants

* DRY up status check + network failure + retry logic

- keeps the debug logic identical between promises + streams
- ensures all logic paths are also consistent
- consolidates the pop’ing of intervals in a single place

* find / replace fail

* derp

* make the logic actually correct, set intervals as cloned defaults for recursive lookup

* pass arg correctly

* reduce debugging noise, formatting

* rename intervals -> delaysRemaining for clarity

* added unit tests around getDelayForRetry

* set retryIntervals as default options correctly, add unit tests


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
2019-05-15 12:46:55 -04:00
renovate[bot]
d4d7326ebb chore(deps): Update dependency decaffeinate to version .x 🌟 (#4190)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-14 17:30:44 +06:30
Gleb Bahmutov
ebb8afdff4 logger warn from CLI should strip all indent from nested message (#4188) 2019-05-13 18:27:26 -04:00
Gleb Bahmutov
b21918921b move close too quick check into CLI (#4186) 2019-05-13 17:08:33 -04:00
Gleb Bahmutov
d25cfacc6f Automatically retry verify and run commands on Linux if suspect DISPLAY problem (#4165)
* cli: debug explanation for XVFB

* linting

* add chai-as-promised to CLI dev

* show Linux specific error solution if cannot verify

* add todo

* chore: consolidate github issue url logic

* linting

* add npm script lint-changed to quickly eslint fix changes JS files

* retry verify with our XVFB

* update errors and tests

* update CLI tests

* add test for display error message

* fix unit test

* add successful test with retry

* finish verify retry test

* warn users if hit display problem on first verify

* try to detect display problem when running electron and retry with our xvfb

* add warning message to spawn when attempting xvfb re-run

* add test for display retry behavior on spawn

* more comments for clarity

* fix typo
2019-05-13 15:19:53 -04:00
Zach Bloomquist
1b1c2f24bd Add typedefs for Cypress.LocalStorage.clear (#4168)
* add typedefs for LocalStorage.clear

* clean up unused arguments

* appease the linter
2019-05-13 16:58:20 +06:30
renovate[bot]
bf1a942944 chore(deps): update dependency supertest to version .x 🌟 (#4154)
* chore(deps): update supertest to 4.0.2 🌟

* remove deprecated 'supertest-as-promised' + update supertest-session

* fix linting error


Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-05-08 15:16:33 +06:30
renovate[bot]
9ce129c641 fix(deps): update dependency electron-packager to version .x 🌟 (#4155)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-08 15:05:54 +06:30
Paul Edwin
f34471ca0a address #3069 by using chokidar fs events (#4038)
* address #3069 by using chokidar fs events

* use chokidar directly for watching specs and add tests

the watchers lib watches for file contents changing and doesn’t watch for files being added or removed
2019-05-07 16:00:12 -04:00
Jennifer Shehane
6d5963b9ca remove unused devDep and dep "clear-module" (#4153) 2019-05-07 16:57:26 +06:30
renovate[bot]
1761ba05da fix(deps): update dependency data-uri-to-buffer to version .x 🌟 (#4152)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-07 16:26:54 +06:30
renovate[bot]
0ca9d2a5f6 fix(deps): update dependency supports-color to version .x 🌟 (#4150)
* fix(deps): update supports-color to 6.1.0 🌟

* bump cli down to 5.5.0 to continue support for Node 4


Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-05-07 16:23:51 +06:30
renovate[bot]
a90bc3a3e5 chore(deps): update dependency snap-shot-it to version .x 🌟 (#4151)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-07 16:21:22 +06:30
Jennifer Shehane
a31a15ff38 Remove unused dep "tar-fs" (#4149) 2019-05-07 15:15:34 +06:30
renovate[bot]
2565e6e96c fix(deps): update dependency term-size to version .x 🌟 (#4148)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-07 14:14:08 +06:30
renovate[bot]
a97cfc381a fix(deps): update trash to 5.2.0 🌟 (#4140) 2019-05-06 16:28:05 +06:30
renovate[bot]
83674c8acc fix(deps): update dependency widest-line to version .x 🌟 (#4139)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-06 16:19:18 +06:30
renovate[bot]
c18a5eef63 chore(deps): update dependency dependency-check to version .x 🌟 (#4137)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-06 15:36:43 +06:30
Jennifer Shehane
3c0b01c90b remove unused package - codecov (#4136) 2019-05-06 14:43:10 +06:30
renovate[bot]
cb44f0facc chore(deps): update dependency wait-on to version .x 🌟 (#4135)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-06 14:15:04 +06:30
renovate[bot]
71e0124638 fix(deps): update dependency send to version 0.17.0 🌟 (#4134)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-06 12:43:39 +06:30
renovate[bot]
7a77fa3063 chore(deps): update dependency pretty-ms to version .x 🌟 (#4116)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-06 11:32:04 +06:30
renovate[bot]
7bd1698643 chore(deps): update dependency filesize to version .x 🌟 (#4113)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-06 11:01:55 +06:30
renovate[bot]
33a9ab35a1 chore(deps): update dependency proxyquire to version .x 🌟 (#4115)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-03 18:58:09 +06:30
renovate[bot]
6e13bbecaf fix(deps): update dependency semver to version 5.7.0 🌟 (#4112)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-03 18:01:58 +06:30
renovate[bot]
98994d4e3e fix(deps): update dependency jimp to version 0.6.4 🌟 (#4097)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-03 12:02:58 +06:30
renovate[bot]
4733694bc2 fix(deps): update dependency tmp to version 0.1.0 🌟 (#4111)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-03 11:59:45 +06:30
renovate[bot]
f662e48652 fix(deps): update dependency url-parse to version 1.4.7 🌟 (#4110)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-03 11:53:01 +06:30
Zach Bloomquist
146d4cd5cf Add missing Date to cy.clock typescript def (#4106)
* add missing option from clock tsdef

* add type test for cy.clock with Date
2019-05-03 11:34:16 +06:30
renovate[bot]
3394ea990a fix(deps): update dependency image-size to version 0.7.4 🌟 (#4096)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-03 10:21:05 +06:30
Gleb Bahmutov
edc7b4c453 print more info when checking built version 2019-05-02 17:35:42 -04:00
Gleb Bahmutov
28c75d0bcc upgrade kitchensink to get rid of http-server dependency (#4107) 2019-05-02 17:04:33 -04:00