Commit Graph

12681 Commits

Author SHA1 Message Date
Gleb Bahmutov 4e11b5bdde cli: downgrade chalk (#6569)
* cli: downgrade chalk

* add job to test NPM on minimum Node version

* forgot to attach workspace

* try updating npm

* try installing npm 5.0.4

* try npm 5.1.0

* skip npm init, just install Cypress

* try using Yarn

* run additional Cypress commands

* print Cypress version

* print Cypress version

* hmm, try different user

* yarn-lock

* back to npm

* print npm version

Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-02-28 10:25:25 +06:30
Jennifer Shehane b4f6f0c566 Set window size to a better default size when running Chrome he… (#6440)
* Set window size to a better default size when running headless in chrome

* add test for spawning in 720p

Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
2020-02-28 09:35:05 +06:30
Ben Kucera 8d7f1a0bed fix: iframe type error with body[contenteditable] (#6571)
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-02-27 23:11:40 +00:00
gunna025 cb0f32b0b4 Adds retry button for project baseUrl warning (#5325)
* Adds retry button for project baseUrl warning

* Refactors project retry button

* Refactors to improve testability and adds tests

* Adds back reopenProject method

* Fixes warning message test errors

* Makes requested changes

* improve selectors

* fix dismissing warnings

* rename clear warning to dismiss warning

* refactor / improve

- only add retry button if it's the base url warning
- keep warning around while waiting for retry
- move tests to warning message spec

* disable retry button and show retrying message while retrying base url

Co-authored-by: ngunnarson <56410720+ngunnarson@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2020-02-27 09:03:33 -05:00
TomaszG 9a78515f70 Issue 6231 use more information from gitlab (#6561)
* #6231 use more CI information from GitLab

* issue-6231 fix spec provider tests

* issue-6231 use GitLab CI Repository URL instead of Project URL as remoteOrigin commit param
2020-02-27 14:20:42 +06:30
Zach Bloomquist 17c9ded463 Improve server test scripts (#6567)
* clean up server test commands

this mostly restores the pre-yarn behavior:
- passing a file path to a test command runs that file, not all tests
- there is only one test-watch
- there is a "test" command which accepts a pathx

* allow run.js to specify multiple specfiles

* simplify e2e test setup by using globbing

* fix e2e test that has been broken for eternity

* still let users use `test-e2e --spec` syntax

* update server README
2020-02-26 15:53:43 -05:00
Ben Kucera f77ec01c18 chore:fix ui-components dependencies, web-config deps for yarn (#6534)
- add needed deps in `ui-components` package
- upgrade `@cypress/webpack-preprocessor`
- refactor some eslint code, remove unused eslint scripts
- rename `build-js` scripts to `build-prod` since they'll only need to run when building for prod / checking for tsc errors
2020-02-26 20:21:23 +00:00
Dhruv Jain 62dd438485 fix: Implement { log: false } for clearLocalStorage Issue #6342 (#6495)
* fix: disable log for clearLocalStorage #6342

* fix: default log value

* fix: remove unwanted isnt false and options._log

* test: add test for log: false

* feat: add options fallback to keys param

* feat: add options fallback to keys param

* test: add test for key to be options

* test: fix not string error test

Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2020-02-26 15:13:57 -05:00
Renovate Bot 655cd2e7f4 chore(deps): update electron to 7.1.13 🌟 2020-02-26 13:13:49 -05:00
Jennifer Shehane e585079c56 Roll back execa to 1.0.0 to actually support Node 8.0.0 (#6560) 2020-02-26 22:22:28 +06:30
Chris Breiding a1b475266f chore: Split driver type spec into multiple files (#6553)
* split driver type spec into multiple files

* remove duplicate trimInnerText, remove unused before hook

* remove unused logic from test

* Revert "remove unused logic from test"

This reverts commit 9dd54caeb9.

* remove unused test support code

* ok fine, we leave the newlines code

Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
2020-02-25 16:12:12 -05:00
Brian Mann 6b3c02920d Merge pull request #6552 from cypress-io/issue-5941-decaf-test
Decaffeinate plugins tests
2020-02-25 13:26:00 -05:00
Chris Breiding bc4c29f07c restore mistakenly deleted snapshot 2020-02-25 09:55:00 -05:00
decaffeinate 7f8f602781 decaffeinate: Run post-processing cleanups on index_spec.coffee 2020-02-25 09:37:14 -05:00
decaffeinate 1e66229925 decaffeinate: Convert index_spec.coffee to JS 2020-02-25 09:33:58 -05:00
decaffeinate 5ef5b1029c decaffeinate: Rename index_spec.coffee from .coffee to .js 2020-02-25 09:33:56 -05:00
Chris Breiding 892f6033fa update snapshot 2020-02-25 09:29:08 -05:00
decaffeinate 657581f16e decaffeinate: Run post-processing cleanups on 3_plugins_spec.coffee 2020-02-25 09:25:14 -05:00
decaffeinate a9c88d4dec decaffeinate: Convert 3_plugins_spec.coffee to JS 2020-02-25 09:24:08 -05:00
decaffeinate f7a862aba5 decaffeinate: Rename 3_plugins_spec.coffee from .coffee to .js 2020-02-25 09:24:06 -05:00
Brian Mann ec70611be2 Merge pull request #6545 from cypress-io/issue-5941-decaf-prep
Decaffeinate plugins/index.coffee and plugins e2e test
2020-02-24 14:54:06 -05:00
decaffeinate 230072ee0a decaffeinate: Run post-processing cleanups on index.coffee 2020-02-24 14:20:02 -05:00
decaffeinate 708f4683eb decaffeinate: Convert index.coffee to JS 2020-02-24 14:14:11 -05:00
decaffeinate ad5d4eb7d3 decaffeinate: Rename index.coffee from .coffee to .js 2020-02-24 14:14:09 -05:00
renovate[bot] eab801ae3f chore(deps): Update dependency eslint to version 6.8.0 🌟 (#6509)
* chore(deps): Update eslint to 6.8.0 🌟

* fix missing dangling commas for linter

* fix missing dangling commas for linter

* more lint fixes

* yarn lock

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-02-25 00:09:47 +06:30
Jennifer Shehane 844a1bd12c Update error message to be more specific about same-origin poli… (#6118)
* update error message to be more specific about same-origin policy

* Update wording in corresponding tests

* Update link so that it uses correct wording

* Fix wording of erorr message

* Update packages/server/__snapshots__/6_web_security_spec.coffee.js

* Update packages/driver/src/cypress/error_messages.coffee

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* update tests to match new copy

* updated error messaging to be more specific about what cross origin means

* missing snapshot updates

* Add specific messaging for each origin scenario

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* Update packages/driver/src/cypress/error_messages.coffee

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* Update different origin error to use 1 shared error message and list all differences when necessary.

* Update packages/driver/src/cypress/error_messages.coffee

Co-Authored-By: Zach Bloomquist <github@chary.us>

* indent the portions of error that are most important for better readability

* yarn lock

* missed incorrect text in test

Co-authored-by: Zach Bloomquist <github@chary.us>
2020-02-24 14:19:59 +06:30
Chris Breiding 14c84496f1 Upgrade front-end dependencies (#6522)
* upgrade front-end deps

* fix react errors/warnings
2020-02-21 16:49:14 -05:00
Josef Biehler 329ec791a8 check if parentNode is document-fragment and if yes, stop recursion. … (#5528)
* check if parentNode is document-fragment and if yes, stop recursion. otherwise .parent() will yield no element because a document-fragment has no parent

* Add a failing spec for Salesforce lightning components

* update code to check that we are defined before continuing in loop

Co-authored-by: Randall Kent <therandallkent@gmail.com>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-02-22 00:47:18 +06:30
Jennifer Shehane 8cdaff00b6 downgrade execa to 2.0.0 (which supports Node.js 8.0.0) (#6513) 2020-02-22 00:39:52 +06:30
Jennifer Shehane e0736b1358 remove 'electron' as known browser family during validation err… (#6517)
* remove 'electron' as known browser family during validation error.

* fix tests that had unexpected results because fixture has invalid family name set

* whoops, missed updated one family in the spec

* missed another snapshot change
2020-02-21 10:41:18 +06:30
Zach Bloomquist 433e6d4ed3 https-proxy decaf cleanup 2020-02-20 13:09:40 -05:00
decaffeinate 900286b1fb decaffeinate: Run post-processing cleanups on ca.coffee and 11 other files 2020-02-20 13:09:40 -05:00
decaffeinate 34b52074c1 decaffeinate: Convert ca.coffee and 11 other files to JS 2020-02-20 13:09:40 -05:00
decaffeinate 84a2caa6e8 decaffeinate: Rename ca.coffee and 11 other files from .coffee to .js 2020-02-20 13:09:40 -05:00
Gleb Bahmutov 070fceff20 add "cypress info" command (#6372)
* WIP: add cli info command to list detected browsers

* print found browsers

* change to list

* start work on info command calling into binary

* move info command into binary

* print OS info during cypress info command

* add binary cache path to info command

* add browser profile path

* add memory

* get browser profile path without partition

* pick real browsers as examples

* output same info as desired

* better names

* changed colors

* add list of cached binary versions

* do not put stable into name

* add underlined link

* conditionally show profile path, only if the folder exists

* do not list cached binaries

* human-friendly memory print

* print env proxy vars

* print CYPRESS_ env variables

* use _.sample

* update order

* store cypress info output on CI as HTML page artifact

* add percy CLI screenshots

* sanitize cypress info command

* store CLI snapshots in cli/visual-snapshots folder

* update cli unit snapshot

* add cli unit test

* start e2e testing for cypress info

* add test with proxy and cypress vars

* make sure we call the binary

* stricter start check

* start unit testing modes info

* test info mode browser print

* add test for profile path

* add cypress info command to test binary Circle job

* add cypress info to test-binary-as-specific-user circle

* print cypress info --dev on circle and on appveyor

* update .gitignore

* move error in environment load to debug
2020-02-20 10:54:25 -05:00
Zach Bloomquist 72c9c7dbe4 Validate mocha test results in a new stage (#6496)
* wip: validate mocha test results in a new stage

* clean up lerna run commands

* better logging of parse failures

* update expectedCount, integration test command

* revert package.json

* expect a variable amount of tests in e2e

* account for skipped tests

* static has no test script

* fix comparison

* really skip 4_window_open_spec

* fix expectedResultCount

* Update scripts/verify_mocha_results.js

Co-Authored-By: Zach Bloomquist <github@chary.us>

* assert at least 1 test ran by default, always set skipped

* summarize results at end

* verify more stages

* Revert "verify more stages"

This reverts commit dda1339b28.

Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
2020-02-19 12:39:38 -05:00
Jennifer Shehane b92bd29571 Fix typos in error messages (#6508) 2020-02-19 23:17:41 +06:30
Kukhyeon Heo 189efd241b Fix the type of $$. (#6327)
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-02-19 15:17:20 +06:30
Jennifer Shehane 3e3e44df69 Add note about bringing up breaking/API changes with team (#6425) 2020-02-19 00:22:42 +06:30
Kirby Cool b5c9572fd3 [driver] Fix xhr ballooning callback stack depth. (#5945)
* [driver] Fix xhr ballooning callback stack depth.

- Closes https://github.com/cypress-io/cypress/issues/5864

Cypress wraps xhr callbacks with an override.  However, in the current code, every time a callback getter is called, we replace the original memoized callback with the wrapper. Every time the getter is called, another wrapper is added, which in extreme cases (e.g. iterating over chunks of a long request body and calling `onreadystatechange` for each chunk) can cause "Maximum call stack size exceeded" errors.

This change resolves the issue by not overwriting the memoized callback in the getter. The setter

* Update xhr_spec.coffee

Co-authored-by: Zach Bloomquist <github@chary.us>
2020-02-18 12:44:14 -05:00
renovate[bot] 1d220d9758 chore(deps): Update dependency eslint-plugin-cypress to version… (#6491)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-18 16:11:44 +06:30
Zach Bloomquist dc794d63f9 release 4.0.2 [skip ci] v4.0.2 2020-02-14 18:31:23 -05:00
Zach Bloomquist 12204f44c1 Revert "test: add tests for special sequences {moveToStart} / {… (#6469)
This reverts commit 6ace4c54e0.
2020-02-14 17:21:32 -05:00
Brian Mann 7ac5e2b6e6 restore proper npm commands for testing other projects 2020-02-14 17:01:33 -05:00
Zach Bloomquist dd3b63aa0b Update project error UI (#6432)
* update default title to "an unexpected error occurred"

* show stack trace in error, if avail

* add "copy to clipboard"

* wrap browser errors

* add tests

* improve md formatting

* update desktopgui tests

* update
2020-02-14 16:29:51 -05:00
Zach Bloomquist 15c3e95429 Improve error experience when visiting outside of Cypress-launched browser (#6435)
* force websockets transport

* wip: ensure ws connections take place thru a known socket

* clean up yesterday's work

* remove dead code (request is undefined)

* update websocket tests

* add websocket tests

* update socket + server specs

* add token auth for file_server

* Fix cy.visit file_server

* restrict non-proxied URLs, serve error on runner URL non-proxied

* add e2e test for server splash page

* fix types

* use clientRoute, fix tests

* only run 6_non_proxied in electron

* use browser.path

* improve empty options type

* add ws assertions in e2e tests

* fix server_spec

* refactor socket whitelisting logic

* update server_spec

* respond to PR feedback

- added tests for non-clientRoute redirecting to clientRoute when not behind proxy
- cleaned up comments
- cleaned up logic in server.coffee
- moved error html to own file
- added unit test for socket whitelist + fixed removal bug
2020-02-14 16:21:36 -05:00
Ben Kucera b8d6a6d6ed fix pollution of :contains pseudo selector (#6434)
* fix overriding :contains pseudo selector

* dont inject livereload inside spec iframe...

* add issue comment
2020-02-14 16:13:41 -05:00
Chris Breiding 42cc6282bb Extract error methods from utils into error_utils (#6465)
* extract error methods from utils into error_utils

* yarn.lock

* fix dangling commas

* fixes

* fix error utils spec

* fix tests
2020-02-14 15:20:31 -05:00
Waldemar Penner 6ace4c54e0 test: add tests for special sequences {moveToStart} / {moveToEn… (#6203)
* test: add tests for special sequences {moveToStart} / {moveToEnd}
2020-02-14 20:14:38 +00:00
Brian Mann 1069310899 extract out ui-components dropdown (#6452)
* extract out ui-components dropdown

Co-authored-by: Chris Breiding <chrisbreiding@gmail.com>

* yarn.lock changes

* fix issues with desktop-gui dropdown

* use ui-components dropdown in runner no-automation

* fix desktop-gui user dropdown

* fix tests

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2020-02-14 09:50:48 -05:00