Commit Graph

2517 Commits

Author SHA1 Message Date
Chris Breiding e93e6ae0b4 Validate plugin event registration (#5356)
* Turn exception message into something human readable

* Pass ipc as parameter to invoke function

* Creating file to validate event name and handler

* Creating tests to validate_event

* Remove ipc from invoke parameter

* Removing ipc parameter being passed to validateEvent

* convert spec to js

* increase line-height for plugins error message

* refactor error messages and implementation

* fix race condition where async error in plugins file could hang run

a quick async error at the root of the plugins file had the potential to hang the run because the ‘exitEarlyWithErr’ listener was registered later than that error was emitted

this enables that error to be tracked so we can properly exit at the appropriate time

it also refactors run.js to not rely on an event emitted on the project and instead passes through an onError handler, which makes more sense since the event was only used in run.js (except for one case). it also makes for easier unit testing

* fix missing reference

* fix duplicate reference

* fix args being passed in incorrectly

* fix way args were handled in server.open

* fix exit early implementation

* fix duplicate logging

* fix unit test

* update snapshot

* fix missing reference

* add e2e test to cover plugin registration validation

* clean up after merge

* add back snapshot

* fix e2e tests

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-03-05 16:00:42 -05:00
Chris Breiding edb9a98268 Allow %, &, and ? in spec file name. (#6539)
* Allow %, & in file name.

* Extract escapeFilenameInUrl

* Fix tests.

* Add test for ? (non-Windows).

* Remove platform condition. And handle when special chars are in the dir.

* Fix failure.

* Fix failure.

* add e2e test for specs with special characters

* minor refactor

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2020-03-05 12:21:29 -05:00
Chris Breiding 474b80a50f Fix race condition when there's an early asynchronous error in… (#6610)
* fix race condition when there's an async error in root of plugins file

* return the promise

* fix routes creation

* fix tests

* fix error throwing and add tests

* update snapshots

* revert changes to server.open signatures in tests

* fix test

* properly wrap error so it doesn't log twice

* slow down test to ensure plugins error occurs before run is over

* wait to log early exit error until after run start
2020-03-04 11:59:01 -05:00
Jennifer Shehane 7eed6ad581 Test Cypress in Chrome 80, FF 72, Debian 10 (#6428)
* update docker image to chrome 80 and firefox 72 image

* Use image with compatible 12.8.1 Node version

* update docker script

* improve debug logging of launched browser

* run tests with correct color depth

* force run with new cache version

* revert docker image

* Revert "revert docker image"

This reverts commit 93d03446cc.

* update gitignore

* generate 2048-bit keys

* add script to regenerate certs, if we need to do this again

* update certs (ran regenerate-certs.sh)

* copy, don't symlink - won't work on win anyways

* reregen

* cleanup

* don't use https-pem, it's too smol

see https://github.com/watson/https-pem/issues/3

* decaffeinate: Rename ca.coffee and 11 other files from .coffee to .js

* decaffeinate: Convert ca.coffee and 11 other files to JS

* decaffeinate: Run post-processing cleanups on ca.coffee and 11 other files

* https-proxy decaf cleanup

* wip: ca_version

* add versioning for CA store

* add regenerate:certs script

* add timings to ca_spec

* unneeded patch-package

* fix yarn.lock

Co-authored-by: Zach Bloomquist <github@chary.us>
2020-03-03 16:25:02 -05:00
Zach Bloomquist a4b11e1928 Use CDP to record video for Electron, record video in Electron… (#6632)
* Use CDP to record video for Electron

* Enable video recording in Electron headed

* Test video in headed + headless for all browsers

* Update e2e tests
2020-03-03 15:42:43 -05:00
Ben Kucera f94d9f59ef fix: rerunning spec in open mode w/ after hook (#6620)
- fix a bug causing specs to hang after rerunning in open mode
- allow e2e test script to accept --no-exit through the cli
2020-03-03 19:18:57 +00:00
decaffeinate 333414acbc decaffeinate: Run post-processing cleanups on electron.coffee and 4 other files
also manual cleanups
2020-03-03 12:07:23 -05:00
decaffeinate 0ee1b84af0 decaffeinate: Convert electron.coffee and 4 other files to JS 2020-03-03 12:07:23 -05:00
decaffeinate e23a604b1e decaffeinate: Rename electron.coffee and 4 other files from .coffee to .js 2020-03-03 12:07:23 -05:00
Kyle Roberts 855657d334 Add Cypress.dom.* to TS type declarations (#5298)
* add isDetached to type declaration

* add rest of dom function declarations

* remove any type union

* remove duplicate declaration

* add docstrings for documented types

* .js => .ts

* update types + tests

fix ts lint

* add Cypress.dom type tests

Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-03-02 14:22:13 -05:00
chadoc 44c98288c3 fix(proxy): added support for jira getParent function even when not minified (#6608) 2020-03-02 10:52:46 -05:00
Zach Bloomquist 483d494557 Reconnect to CDP on WebSocket failure (#6532)
* wip: reconnect to CDP automatically

i think we should not do this, see:
https://github.com/cypress-io/cypress/issues/5685\#issuecomment-589732584

* reconnect to CDP automatically

* cleanup

* fix unit tests

* update snapshot

* replace automation client disconnected line
2020-02-28 15:28:48 -05:00
Chris Breiding 778321786f Pass projectRoot and configFile to plugins file through config (#6317)
* decaffeinate: Rename index.coffee from .coffee to .js

* decaffeinate: Convert index.coffee to JS

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

* refactor decaffeinated plugins/index.js

* decaffeinate: Rename 3_plugins_spec.coffee from .coffee to .js

* decaffeinate: Convert 3_plugins_spec.coffee to JS

* decaffeinate: Run post-processing cleanups on 3_plugins_spec.coffee

* fix wrongly removed return

* refactor e2e plugins spec, update snapshot

* pass env argument to plugins file

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

* decaffeinate: Convert index_spec.coffee to JS

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

* update plugins tests

* update scaffold snapshot

* add back server test script and document running individual tests

* add projectRoot and configFile directly to config

* normalize browsers in snapshot

* add types for configFile and projectRoot

* fix linting issues

* return return

* Merge

* remove file

* remove unnecessary returns
2020-02-28 14:13:36 -05:00
Zach Bloomquist e2ea5bf663 Fix patch-package (#6583)
* fix patch-package

- don't hoist dependencies that are patched, this way we can be assured the path is always correct
- put all patches in root postinstall so postinstall-postinstall is guaranteed to work

* wip

* Revert "fix patch-package"

This reverts commit 5583f21478.

* use per package patches

* don't ignor engines or silence

* try: make sinon patch devonly

* fix socketspec

* run full ci on this branch

* bump xcode tools to bump mac node version

* also run appveyor

* Revert "run full ci on this branch"

This reverts commit c3e52d09ec.

* Revert "also run appveyor"

This reverts commit bfe7b0499a.
2020-02-28 12:17:54 -05:00
Chris Breiding 1e7f0c1fdf remove unnecessary returns 2020-02-28 11:46:27 -05:00
decaffeinate ce1aa3f799 decaffeinate: Run post-processing cleanups on spec.coffee 2020-02-28 11:39:13 -05:00
decaffeinate 1d9da41671 decaffeinate: Convert spec.coffee to JS 2020-02-28 11:38:38 -05:00
decaffeinate 1aafa23425 decaffeinate: Rename spec.coffee from .coffee to .js 2020-02-28 11:38:11 -05:00
renovate[bot] f4c22f951e fix(deps): update dependency node-machine-id to version 1.1.12… (#6595)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-28 14:31:26 +06:30
renovate[bot] 2f70a9c047 chore(deps): update dependency https-proxy-agent to version 3.0… (#6590)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-28 13:45:03 +06:30
Martin Sikora d7d5e22928 desktop-gui: Add toggle buttons to root specs to expand/collaps… (#6541)
* desktop-gui: add toggle buttons to expand/collapse all sub folders. #6282

* lint code changes

* hide collapse/expand buttons when root spec has no folders

* fix indentation

* fix lint issue and refactor a bit

* Move collapse/expand links to right side of folder header

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-02-28 13:31:11 +06:30
renovate[bot] 02508c211f chore(deps): update dependency autoprefixer to version 9.7.4 🌟 (#6588)
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
2020-02-28 13:30:22 +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
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
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
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 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