Commit Graph

11897 Commits

Author SHA1 Message Date
Ben Kucera 7efd9d8ab0 fix programmatic focus/blur events, typing into currently focused (#2982)
* fix programmatic blur events, allow typing into currently focused, fix getHostContenteditable

* intercept .blur

* reference issues in tests

* make tests account for conditional number of new lines inserted

- newer browsers insert a double new line, whereas older browsers dont
- write a helper that exposes the multiplier of new lines

* cleanup, remove dead code

* make tests dynamic when browser is or isn't out of focus

* cleanup, remove old notes, add more notes

* add failing tests for when native focus / blur are called multiple times

- need to handle not firing the events conditionally based on whether
or not the element would / should receive them

* remove old code for priming focus/blur events when window is out of focus

* remove dead code

* update focus_blur spec + add chai-subset

* decaffeinate: Rename focus_blur_spec.coffee from .coffee to .js

* decaffeinate: Convert focus_blur_spec.coffee to JS

* decaffeinate: Run post-processing cleanups on focus_blur_spec.coffee

* add failing test

* fix double blur/focus events

* make document.hasFocus always return true, add test

* fix focus events when non-focusable element

* remove unneeded retrun

* fix focusing body/ bluring active element on click

* forgot to call .get() with index

* fix focus issue with body/window

* still allow firefocus on window, skip firing focus if firstfocusable is window during click

* left out return in intercept blur/focus

* cleanup test code for focus_blur spec

* add tests to type_spec, focus_blur_spec
00-00005bfe

* update focus logic for click, fix dtslint error
06-00003d9c

* add tests for selectionchange event in focus_blur spec
01-00000dae

* set dep to exact version
06-00002320

* minor formatting

* intercept focus/blur for SVGElement

* add comment to type-into-already-focused logic


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2019-06-11 11:06:26 -04:00
renovate[bot] 6772a02faf fix(deps): update dependency is-fork-pr to version 2.3.0 🌟 (#4330)
* fix(deps): update is-fork-pr to 2.3.0 🌟

* add 'is-fork-pr' to renovate internal group


Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-06-11 14:02:23 +06:30
renovate[bot] 3f3e78408c fix(deps): update dependency fs-extra to version .x 🌟 (#4422)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-06-11 11:03:58 +06:30
renovate[bot] 706999d174 fix(deps): update dependency fs-extra to version .x 🌟 (#4419)
* fix(deps): update fs-extra to 2.1.2 🌟

* rename `clobber` option to `overwrite`

per https://github.com/jprichardson/node-fs-extra/pull/333/files


Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-06-10 14:51:18 +06:30
renovate[bot] bc8f96b0b1 fix(deps): Update dependency fs-extra to version .x 🌟 (#4418)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-06-10 12:40:16 +06:30
renovate[bot] 2bee5f8815 fix(deps): Update mocha-junit-reporter to 1.23.0 🌟 (#4417) 2019-06-10 12:37:13 +06:30
Ben Kucera 81309fcb1e rename s3 bucket for internal test runner assets (#4398)
* rename s3 bucket for internal test runner assets

* more renames

* more renames

* flatten internal assets


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-06-05 19:22:01 -04:00
Jennifer Shehane c46b237061 actually require newly renamed coffeescript module (#4390)
* actually require coffeescript. 😅

* allow commit message to build binary

* test binary [build binary]
2019-06-05 12:46:39 -04:00
Jennifer Shehane 457ba50110 Add Google Cloud env vars to ci_providers check (#4191)
* Add Google Cloud env vars to ci_providers check

* Update snapshot on ci build warning to include googleCloud

* updated unit tests to ensure commit defaults when undefined, null, or falsy
2019-06-05 08:51:15 -04:00
Zach Bloomquist 2090639401 Fix incorrect performance.getEntries.* return types (#4108)
* add test that performance getEntries return arrays

* add test for clock.restore, add custom lolex version

* use lolex 4.1.0, with fix
2019-06-04 17:18:20 -04:00
Gleb Bahmutov 06796484ec use relative types path from sinon-chai (#4382)
* use relative types path from sinon-chai

* change sinon-chai path post-install
2019-06-04 12:52:52 -04:00
Jennifer Shehane ce29366ad7 update coffee-script to non-deprecated npm package coffeescript (#4147)
Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
2019-06-04 13:11:15 +06:30
renovate[bot] 2dc1ed6a93 chore(deps): Update dependency cypress-example-kitchensink to version 1.5.4 🌟 (#4378)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-06-04 12:49:27 +06:30
Jennifer Shehane e354d160fb Only submit forms with buttons of type='submit' or that are not type='reset' or type='button' (#4365)
* Fix issue where button of type='reset' would be activated during implicit form submission instead of button type='submit'

* Update to account for the fact that default type of button is 'submit'


Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
2019-06-04 10:05:12 +06:30
Ben Kucera 1e640045d9 Revert "Add a "name" property on the test runner iframe (#4128) (#4372)
This reverts commit c96ccf9c4d.
2019-06-03 14:57:24 -04:00
renovate[bot] 4beffe5ed5 fix(deps): update dependency dependency-tree to version .x 🌟 (#4364)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-06-03 14:41:48 +06:30
renovate[bot] bb4a47fe9e chore(deps): update dependency rc-collapse to version 1.11.3 🌟 (#4360)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-06-03 11:29:45 +06:30
renovate[bot] 943c578a0b chore(deps): update dependency css-element-queries to version 1.2.0 🌟 (#4328)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-29 15:51:16 +06:30
renovate[bot] 837ec731c8 fix(deps): update cookie to 0.4.0 🌟 (#4329) 2019-05-29 15:48:52 +06:30
Gleb Bahmutov 71e3bcafb5 appveyor: add Cypress bot encrypted variables 2019-05-29 10:04:36 +02:00
Ben Kucera c3397dceb2 fix flaky spec: server e2e snapshot spec (#4324)
* fix flaky spec: server e2e snapshot spec - cleanse uploading multi results
05-00001bc5

* try to fix dtslint: bump package version
01-000059dc

* try to fix dtslint: bump package version 2
02-00000876

* clean up whitespace bonanza
2019-05-28 14:54:19 -04:00
Andrei Rogobete c96ccf9c4d [#Issue 3121 - partial fix] Add a "name" property on the test runner iframe (#4128)
* Add a 'name' property on the aut-iframe element

* Fix linting issue

* Modified the name of the runner iframe to 'aut-iframe' to be consistent with referencing it

* Add an end to end test

* Replace single quotes with double quotes in the added end-to-end test code

* Renamed added test files to start with '8' instead of '9'

* Replaced the added end-to-end test with an integration test
2019-05-24 13:05:16 -04:00
Stefano Magni d55acdee2e Fix the cy.stub type signature (#4302)
* Fix the cy.stub type signature

* Fix the TS linter failures
2019-05-24 12:39:30 -04:00
renovate[bot] 717ad26350 chore(deps): Update dependency rc-collapse to version 1.11.2 🌟 (#4299)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-24 22:24:53 +06:30
Brian McGue d943944754 Add ignoreTestFiles to configKeys (#3880)
* Add ignoreTestFiles to configKeys

`ignoreTestFiles` is listed as a config option in the 
[guide](https://docs.cypress.io/guides/references/configuration.html#Global), 
but is not one of the `configKeys`.

This then causes Cypress to filter out `ignoreTestFiles` from the 
default config when filtering it to just the whitelisted values:
https://github.com/brianmcgue/cypress/blob/36760b8abbbf72692810f2dab266a13dd6fdbce7/packages/server/lib/project.coffee#L132

As such, when Cypress attempts to update the config with the plugin 
values `resolvedObj[key]` will return undefined here:
https://github.com/brianmcgue/cypress/blob/36760b8abbbf72692810f2dab266a13dd6fdbce7/packages/server/lib/config.coffee#L291
which will result in attempting to set values on `undefined`.

Alternatively, and possibly a good addition to this pull request as it 
stands currently, `setResolvedOn` should only recurse on non-array 
objects.
https://github.com/brianmcgue/cypress/blob/36760b8abbbf72692810f2dab266a13dd6fdbce7/packages/server/lib/config.coffee#L288
should become
```javascript
if _isObject(val) && !_.isArray(val)
```

* Add support for array objects
2019-05-24 11:39:17 -04:00
Brian Mann da3f60a28c release 3.3.1 [skip ci] v3.3.1 2019-05-23 01:45:46 -04:00
Brian Mann 6850e68b48 do not mutate process.env when verifying (#4281) 2019-05-22 17:12:13 -04:00
Brian Mann 4521cdcc87 reduce the retry intervals to prevent slow test + timeout 2019-05-22 13:27:57 -04:00
Gleb Bahmutov 167badc587 retry AppVeyor build after setting GH variables 4 2019-05-22 11:40:11 -04:00
Gleb Bahmutov 660475a374 retry AppVeyor build after setting GH variables 3 2019-05-22 11:39:27 -04:00
Gleb Bahmutov 0c8faaeca3 retry AppVeyor build after setting GH variables 2 2019-05-22 11:38:52 -04:00
Gleb Bahmutov b50852bde7 retry AppVeyor build after setting GH variables 2019-05-22 11:36:38 -04:00
Gleb Bahmutov fdb3895a79 print if we have GH env variables set on AppVeyor 2019-05-22 11:28:11 -04:00
Gleb Bahmutov 94de3155e2 Merge branch 'develop' of github.com:cypress-io/cypress into develop 2019-05-22 10:42:21 -04:00
Gleb Bahmutov 4ebd4b6b2b use latest github commit module version, print if we have variables set 2019-05-22 10:42:09 -04:00
Jennifer Shehane 2d9cacbc12 Fix issue where snapshot highlight would throw err when no html doc (#4280) 2019-05-22 21:09:31 +06:30
Zach Bloomquist 9147e4f988 Fix sending forms with large request bodies (#4241)
* add e2e test for submitting forms over https on localhost

* add multipart/form-data test

* add multiparty to parse multipart/form-data streams

* test form submission with attachments

* add repro for #4253

* stream_buffer failing on large body size

* wip: stream buffer fixes

* add eslint + require spec helper

* always cleanup on error and on response

* WIP: continue refactoring stream buffer

- utilize ‘finish’ and ‘chunk’ events to know when to push into
internal readable buffer instead of using `readable.push(‘’)`
- recursively call readable.push(…) until it returns false
- add tests for recursive push calls
- add tests for ensuring readables don’t end until writeable buffer does

* fix remaining tests after stream buffer refactor

* use path.resolve not path.join for handling cy.readFile + cy.writeFile

* consolidate e2e form multipart tests with existing ones

- use env var for passing around path to large earth image
- dynamically fetch large earth.jpg img and gitignore it prior to
running tests
- finish tests + passing implementation

* reader() -> createReadStream()

* guard against reqBodyBuffer being null


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-05-22 04:19:14 -04:00
Zach Bloomquist b568e82545 Do not send requests for SNI server through upstream proxy (#4275)
* add test to ensure that SNI server will never go through proxy

* prevent test from false positive

* ensure that SNI server requests never go through proxy

* e2e test that https-proxy does not pass sni reqs thru upstream

* improve debug logging in https-proxy

* fix using cwd, not workspaceFolder for terminals manager

* remove dead code

* stop the debug proxy after each test


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-05-22 02:13:33 -04:00
Ben Kucera ef5c38d178 add "be.focused" and "have.focus" to assertions (#3219) (#4274)
* add "be.focused" to chai_jquery

* add comment explaining the mess

* add type definitions

* refactor assertion to use jquery assertion

* remove trailing whitespace

* add test for multiple elements, update typedefs

* fix failing tests: not.be.visible -> not.exist

* allow should(not.be.visible) for failed selectors

* remove unrelated visibility changes

* extract only focus assertion

* Revert "Merge remote-tracking branch 'origin/develop' into issue-97-focus-assertion"

This reverts commit b401c32a61, reversing
changes made to ab14758d31.

* force jquery to use custom focus pseudo selector

* only force custom matchers for focus selectors

* rewrote matchesSelector wrap code

* add lodash

* Merge in origin/develop

* changes on 3.3.0

Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-05-21 18:56:15 -04:00
Jennifer Shehane cacd122c67 Fix mixed use of both XVFB and Xvfb to all be Xvfb (#4262) 2019-05-21 10:33:59 -04:00
Clare So 031ae7087b Enable aliases names to contain the dot character (#4248)
* Cherry picked the changes from PR 3929

* Support for dot in alias for wait and route

* Remove unused regex

* Remove console log messages

* Ensure alias without dot is handled

* Refactor code to use the same conditions

Updated code to use the same conditions to determine whether to extract the potential index present or not.

* Cherry picked the changes from PR 3929

* Support for dot in alias for wait and route

* Remove unused regex

* Remove console log messages

* Ensure alias without dot is handled

* Refactor code to use the same conditions

Updated code to use the same conditions to determine whether to extract the potential index present or not.
2019-05-21 11:41:43 +06:30
kang 3eacfeb132 fix: #3847 only options.log !== false use options._log.error (#4127)
* fix: #3847 only options.log !== false use options._log.error

* ADDED issue #3847 behavior test

* fix 3847_spec.js prettier
2019-05-21 09:52:55 +06:30
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