Commit Graph

2176 Commits

Author SHA1 Message Date
Ben Kucera 4a6870a098 fix develop build: remove network/index.ts (#5408) 2019-10-21 22:46:36 -04:00
Zach Bloomquist a3265ccdef Control Chrome cookies through CDP (#5297)
* try connecting to chrome remote interface

* linting

* print CRI targets for better debugging

* linting

* load empty tab first when connecting to CRI

* first load blank page, then navigate

* Page.navigate is working

* linting

* remove title

* add mocha banner

* more banners

* update some server unit tests

* update integration test

* document how to run single driver spec file

* set the focus back on the page before navigating from blank chrome tab

* update server unit test

* do not store Chrome remote interface reference for now

* record video of the Chrome tab using screencast API

* use dynamic port to connect to Chrome remote interface

* update unit tests

* refactoring

* wrap chrome remote interface in our interface, limit access to send

* resolved merge

* fix reference

* passing run unit spec

* stub canary search for CI to pass

* add build step to packages/server

* update chrome spec

* do not build js on install for server

* updated spec snapshots

* update 6_visit_spec snapshot

* update snapshot for 6_web_security_spec

* update snapshot for 3_plugins_spec

* update snapshot for 3_user_agent_spec

* update snapshot for 5_stdout_spec

* update snapshot for 2_browser_path_spec

* do not git ignore js files, add note why

* update several snapshots with video on Chrome

* update visit performance snapshot

* add chrome-remote-interface dependency

* cleanup coffeescript conversion to JS, fix some type errors, make parallel override clearer

* fix failing tests

* Fix snapshot - now we do record in Chrome, so warning message is no longer there.

* remove chrome warnings about not recording from snapshot

* Remove performance tests from 6_visit_spec snapshot

* Remove error from snapshot

* Add newline back to cy_visit_performance_spec snapshot

* Use CDP to control Chrome cookies + screenshot

* Add devtools types

* Cleanup

* Cleanup

* Add guards for minimum CDP version

* Fix failing tests

* Split cdp_automation_spec out of electron_spec

* Move takeScreenshot to cri-client

* Navigate to about:blank

* look for blank page url

* add note about avoiding Prettier

* disable prettier a little more

* call chrome remote interface close after each spec

* return promise when starting screencast

* update failing unit tests, add cri client close test

* update integration test

* Add verbose debug statements to cri-client

* Use connect.createRetryingSocket for CDP connection

* record video from chrome browsers

* add method for validating browser family

* update e2e spec snapshot

* update 4_request_spec snapshot

* update snapshot for spec 1_commands_outside_of_test_spec

* update snapshot for 3_plugins_spec

* update snapshot for spec 3_user_agent_spec

* try: Always log video capturing errors

* update snapshot for 2_browser_path_spec

* update snapshot for 2_cookies_spec

* better browser family test

* update snapshot for 5_stdout_spec

* update snapshot for 5_subdomain_spec

* Add protocol_spec tests

* do not capture video during performance test

* Add test for VIDEO_POST_PROCESSING_FAILED warning

* Add basic cookie validation in cy.setCookie

* Update cdp_automation to throw on Network.setCookie failure code

* Update tests 🎉

* Update snapshot

* Fix test

* Remove redundant logs, cleanup

* Add cri-client_spec, fix some small bugs, improve errors

* Update dep

* use client.on to register screencast callback

* use isCookieName

* strict-cookie-parser@3.1.0

* cleanup prettier, extract some functions, switch to browser.family

* moar cleanup and fixes

* add logging to the cri-client so we can see every message sent + received to the cdp protocol

* bump bluebird to 3.7.0 for .tapCatch addition

* Fix unit tests

* WIP: update e2e test to ensure that duration of the video matches what we expect

* Test duration of recorded video

* Run 6_video_compression in chrome + electron

* Cleanup

* finish ffmpeg duration verification

* Update 8_reporters_spec snapshot

* Fix cri-client test

* Update CRI close logic to monkey-patch browser.kill

* add isBrowserFamily back

* make it possible for remote-debugging-port to get overridden

* Make CDP timeout 5s; add unit, e2e tests for CDP failure; add user-friendly CDP failure error

* Update tests

* Use CYPRESS_REMOTE_DEBUGGING_PORT to set CDP port; update CDP error message

* Change new Buffer to Buffer.from

* Apply name validation on all cookie commands

* Just throw on Chrome start if the CDP version is < 1.3

* Fix cypress_spec

* Use CDP to set resolution + scale factor in Chrome e2e

* Revert "Use CDP to set resolution + scale factor in Chrome e2e"

This reverts commit a1b86d9413.

* use CYPRESS_FORCE_BROWSER_SCALE to force standard resolution

* don't do --window-size --kiosk

* Use CDP to set resolution + scale factor in Chrome e2e

* Revert "use CYPRESS_FORCE_BROWSER_SCALE to force standard resolution"

This reverts commit 22c5e78670.

* Use Page.captureScreenshot for Electron + Chrome, reduce logic

* Use before() task to force device metrics in Chrome

* Fix protocol_spec

* Update 7_record_spec to allow for before() hook

* Update 6_task_spec snapshot

* Appease eslint

* Update hooks in 5_spec_isolation snapshot

* some general promisification and cleanup

* feedback on pluginsfile

* cdp_automation feedback

* chrome.coff feedback

* feedback

* run e2e tests on port 4466, ensure no e2e test ever runs on 5566 to prevent conflicting with debugger port

* accept new 'remote:debugger:protocol' automation command to control device metrics overrides

* update web security e2e to run on electron + chrome

* run web security tests in electorn, disable context isolation

* pass disable-site-isolation-trials to Electron so webSecurity works

* Fix errors in e2e tests caused by extra log item

* fix cri-client unit tests

* fancy arrows in log message


Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-10-21 17:07:53 -04:00
Jennifer Shehane fe937d3450 Display full specfile(s) in stdout during cypress run (#5120)
* Begin inserting newlines for long specfiles in results table of stdout

* clean up some decaff weirdness

* move newlines function into util

- call ‘formatPath’ on any area where the path could be too long and
needs to word wrap

* Clean up some styles, padding that does nothing - get specname closer to symbol by 1 pixel

* Commit new snapshot changes. Word wrapping, some spacing changes

* remove more padding that does functionally nothing

* Fix more of the extra unnecessary padding in 'Running' table

* Update other CLI snapshots to match new spacing

* Remove the error thrown when colWidths exceeds 100, I don't see this as necessary since we have snapshots covering the design of the columns.

* Update some snapshots I missed

* Add gaurd in newLine function in case there is no specfile name

* fix more snapshots

* Fix snapshot extra space

* forcibly enable colors in all e2e tests, and strip them back out of the snapshots

* Fix colors that got lost in stdout

* Update newlines function to use simpler ramda split + fix implementation to remove last newline

- write unit test for newlines function for easier refactoring in future

* iterating on fixing the weird column issues

* handle if str is undefined in newlines function

* Draw the tables at exact 100 width, taking into account padding and borders

- Calculate the actual width of the table column in order to add
newlines at that length
- Add newlines for the ‘Finished processing’ output of video file
- Add newlines for the ‘Screenshots’ output of screenshot paths

* remove .only

* Remove extra 1 char padding

* Remove color changes (separate PR for this)

* Replace project path with same num chars of X's

We were just replacing it with foo/bar/baz which would mess up the
alignment of the snapshots since it was removing chars

* If we are running with a CYPRESS_ENV of 'test', replace the cwd

- Replace the current working directory if we’re running withing
Cypress so that our snapshots are consistent when run on diff machines.
- Ideally, I would have liked to have had a special ‘—fake-cwd-path’
flag so that we can override this later, but I couldn’t figure how to
pass that.

* Continue stripping the projectPath from snapshot output

- This is required because some messaging comes from outside of the
run.js file, so we still need to replace these paths in snapshot.

* Update snapshots to have correctly replaced cwd

* Update formatting of new Node Version path to properly return within our stdout tables

* remove tests for method that does not exist

- update the drawing of table columns to match the new logic - don’t
need weird spaces and padding right anymore.
- update snapshot to match

* Update snapshot for performance test that didn't previously run

* return empty string if no name passed (really just for weird edgecases in our own tests)

* Add instructions on how to run performance tests in server

* Update video processing and screenshot tables so they no longer use weird negative padding hack with ' ' border

* Update snapshots to reflect new table spacing

* Another snapshot update missed

* Accept 'FAKE_CWD_PATH' env var to replace it in the run

* Pad paren time to factor in extra whitespace

* Update snapshots to no longer have static 'acb123.mp4' for video names

- This was throwing off the table calculations.

* remove stripping screenshot dimensions + replace padStart with padEnd

* Update snapshots to instead user shorter form 'second' in order to account for shorter duration printing when it is 1 second

* Add correct padding for screenshot dimensions

* update perf spec

* Update performance snapshot

* remove unused 'stripAnsi' dep

* Fix merge conflict failure - didn't regenerate snapshot correctly last time.

* commit size of electron screenshot (fix incoming in another PR to avoid this)

* Correctly handle padding of node version so we don't have to rewrite this later.

* split out let & const assignments


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-10-21 11:21:34 -04:00
Ben Kucera 033689f8ba use typescript in driver (#5383)
* upgrade eslint-plugin-dev to 5.0.0

* more [lint fixes]

* use typescript in driver

* cleanup minor

* remove unneeded file

* mild refactor webpack configs

* fix elements.ts

* fix isTextLike signature change

* fix isType check, fix type_spec

* actually use webpack-preprocessor

* fix isType domUtil

* fix connectors_spec

* cleanup connectors_spec

* address feedback- cleanup, add comments, refac

* answer: no, need index.js
2019-10-18 12:46:46 -04:00
Ben Kucera 653f52dc3c upgrade eslint-plugin-dev to 5.0.0 (#5382)
* upgrade eslint-plugin-dev to 5.0.0

* more [lint fixes]
2019-10-17 11:40:53 -04:00
Zach Bloomquist 561bd21cda Run e2e tests in both Chrome and Electron (#5359)
* Update circle.yml to run e2e tests in chrome + electron

* WIP: create multiple tests per browser, but utilizing the same base snapshot

- create a dynamic test title with browser appended
- use a base named snapshot without the browser name appended
- patch snap-shot-it not to rethrow twice unnecessarily which ends up
throwing the wrong error

* Add e2e.coffee to stop-only ignore

* Convert existing x-browser e2e tests to use e2e.it

* update snapshots

* really add e2e to stop-only skip

* Replace screenshot dimensions in all tests, run only in process.env.BROWSER

* add e2e.it to more tests that should be x-browser

* update snapshots

* PEMDAS

* default e2e browser -> electron

Run afterEaches when skipping testo

Recurse upwards with runAfterEach

stop promise chains

* Revert "default e2e browser -> electron"

This reverts commit 3104f998da.

* Undo

* snap-shot-it@7.9.0

* Remove snap-shot-it patch

* Change e2e snapshot to use allowSharedSnapshot

* Add keepScreenshotDimensions to screenshot specs

* update snapshots

* fix snapshotit

* keepScreenshotDimensions: true -> sanitizeScreenshotDimensions: false

* Fix screenshot snapshots

* reduce snapshot noise

* rm 0_simple_spec

* deabstract circle.yml command

* fix circle.yml

* reduce snapshot noise

* clean up 6_visit_spec snapshot

* use allowSharedSnapshot: true in 5_spec_isolation

* Fix 5_screenshots, 2_form_submissions

* Normalize screenshot sizes in 5_spec_isolation snapshot

* Add sanitizeScreenshotDimensions only to non-e2e-project tests
Add --window-size=1280,720 --kiosk to chrome args

* update snapshots

* Use e2e.it for chrome/electron-specific tests

* handle logic for skipping tests when default browsers do not match specified browser

- implement e2e.it.skip to match mocha’s it.skip
- allow turning off dynamic test generation


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-10-16 21:10:50 -04:00
renovate[bot] 868dc83cf4 chore(deps): Update dependency cypress-example-kitchensink to v… (#5372)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-10-15 11:55:51 -04:00
Dave Beshero 57dad4885e fix scaffold command grammatical error (#5361)
* fix scaffold_spec grammatical error

* fix command grammatical error
2019-10-12 12:18:03 -04:00
Ben Kucera abdf436638 simulated mouse fixes, rightclick, dblclick (#3030)
* cleanup type_spec, allow unused-vars for args

* fix missing return

* rename mouse/keyboard

* apply changes on this branch with rename

* temp 07/18/19 [skip ci] type_spec minor changes

* temp 07/19/19 [skip ci]

* temp 07/22/19 [skip ci]

* temp 07/22/19 [skip ci]

* remove accidental spec, use beforeEach visit in click_spec

* add tests for cy.trigger changes

* re-run build

* add typedefs

* temp 08/08/19 [skip ci]

* fix type_spec, click_spec

* fix console table event table logging

* fix spec utils

* fix invalid clicking-into-iframe spec

* address review, cleanup

* temp 09/25/19 [skip ci]

* add test for clicking checkbox, cleanup click_spec

* document mouse click and mouse move algo, adjust mouse move, add test for recursive movement

* cleanup / formatting

* scope the getCommandLogWithText to the active runnable to prevent leakage

* cleanup tests, make values static so tests pass consistently

- use attach listener alias APIs
- remove magic number constants
- fix some incoherent html / script tag stuff

* begin implementation for returning fromAutWindow

- restore original fromWindow algorithm
- begin writing fromAutWindow for calculating red hitbox coordinates
which are layered on the AUT

* move describe block with the others

* refactor actions to DRY up duplicated logic between click/dblclick/rightclick

- tighten up the mouse.js method names, name them consistently

* remove comment

* fix iframe coords and test

* rename fromDocCoords->fromWindowCoords, fix type_spec ux test

* tighten up method, remove unnecessary arg

* add debug logic for retries to console.error() non cypress errors

* renamed fromWindow -> fromElWindow, and fromViewport -> fromElViewport

* handle calculating the fromElWindow coordinates inline

* extract out function for clarity, receive consistent arg names

* cleanup, add lots of comments


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-10-11 18:43:57 -04:00
Gleb Bahmutov a877474df1 Connect to Chrome Remote Interface when launching Chrome and re… (#4628)
* try connecting to chrome remote interface

* linting

* print CRI targets for better debugging

* linting

* load empty tab first when connecting to CRI

* first load blank page, then navigate

* Page.navigate is working

* linting

* remove title

* add mocha banner

* more banners

* update some server unit tests

* update integration test

* document how to run single driver spec file

* set the focus back on the page before navigating from blank chrome tab

* update server unit test

* do not store Chrome remote interface reference for now

* record video of the Chrome tab using screencast API

* use dynamic port to connect to Chrome remote interface

* update unit tests

* refactoring

* wrap chrome remote interface in our interface, limit access to send

* resolved merge

* fix reference

* passing run unit spec

* stub canary search for CI to pass

* add build step to packages/server

* update chrome spec

* do not build js on install for server

* updated spec snapshots

* update 6_visit_spec snapshot

* update snapshot for 6_web_security_spec

* update snapshot for 3_plugins_spec

* update snapshot for 3_user_agent_spec

* update snapshot for 5_stdout_spec

* update snapshot for 2_browser_path_spec

* do not git ignore js files, add note why

* update several snapshots with video on Chrome

* update visit performance snapshot

* add chrome-remote-interface dependency

* cleanup coffeescript conversion to JS, fix some type errors, make parallel override clearer

* fix failing tests

* Fix snapshot - now we do record in Chrome, so warning message is no longer there.

* remove chrome warnings about not recording from snapshot

* Remove performance tests from 6_visit_spec snapshot

* Remove error from snapshot

* Add newline back to cy_visit_performance_spec snapshot

* Navigate to about:blank

* look for blank page url

* add note about avoiding Prettier

* disable prettier a little more

* call chrome remote interface close after each spec

* return promise when starting screencast

* update failing unit tests, add cri client close test

* update integration test

* Add verbose debug statements to cri-client

* Use connect.createRetryingSocket for CDP connection

* record video from chrome browsers

* add method for validating browser family

* update e2e spec snapshot

* update 4_request_spec snapshot

* update snapshot for spec 1_commands_outside_of_test_spec

* update snapshot for 3_plugins_spec

* update snapshot for spec 3_user_agent_spec

* try: Always log video capturing errors

* update snapshot for 2_browser_path_spec

* update snapshot for 2_cookies_spec

* better browser family test

* update snapshot for 5_stdout_spec

* update snapshot for 5_subdomain_spec

* Add protocol_spec tests

* do not capture video during performance test

* Add test for VIDEO_POST_PROCESSING_FAILED warning

* use client.on to register screencast callback

* cleanup prettier, extract some functions, switch to browser.family

* moar cleanup and fixes

* add logging to the cri-client so we can see every message sent + received to the cdp protocol

* bump bluebird to 3.7.0 for .tapCatch addition

* Fix unit tests

* WIP: update e2e test to ensure that duration of the video matches what we expect

* Test duration of recorded video

* Run 6_video_compression in chrome + electron

* Cleanup

* finish ffmpeg duration verification

* Update 8_reporters_spec snapshot

* Update CRI close logic to monkey-patch browser.kill

* add isBrowserFamily back

* make it possible for remote-debugging-port to get overridden

* Make CDP timeout 5s; add unit, e2e tests for CDP failure; add user-friendly CDP failure error

* Update tests

* Use CYPRESS_REMOTE_DEBUGGING_PORT to set CDP port; update CDP error message


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Zach Bloomquist <github@chary.us>
2019-10-11 18:36:05 -04:00
Ben Kucera f7a3b203af Fix dom highlight dimensions after jquery upgrade (#5299)
* dont use jquery for width/height calculations for dom highlights, put opacity on wrapper element

* add test for inline els

* some final cleanup


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-10-11 16:24:09 -04:00
Seb Insua 116a634a90 Add padding support to element screenshot (#4440) (#5078)
* Handle 0px tall elements with a better error message

Closes #5149

Co-authored-by: Minh Nguyen <minhnguyenxx@gmail.com>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>

* Add padding support to element#screenshot

Closes #4440

Co-authored-by: Minh Nguyen <minhnguyenxx@gmail.com>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>

* add e2e tests
2019-10-11 14:52:00 -04:00
decaffeinate 6583eeea45 decaffeinate: Run post-processing cleanups on coordinates_spec.coffee and 2 other files 2019-10-11 12:08:11 -04:00
decaffeinate e1f926e844 decaffeinate: Convert coordinates_spec.coffee and 2 other files to JS 2019-10-11 12:08:11 -04:00
decaffeinate e7faf2a110 decaffeinate: Rename coordinates_spec.coffee and 2 other files from .coffee to .js 2019-10-11 12:08:11 -04:00
Ben Kucera 5654680fcd rename .eslintrc -> .eslintrc.json (#5344) 2019-10-10 15:04:25 -04:00
Jennifer Shehane 25229037ae minor grammer in Desktop GUI readme [skip-ci] (#5338) 2019-10-10 11:00:24 -04:00
Zach Bloomquist 85485ae218 Add some Chrome flags to make the browser more suitable for tes… (#5310)
* Add some Chrome flags to make the browser more suitable for testing

* Add --disable-dev-shm-usage to Chrome flags

* Remove --disable-dev-shm-usage
2019-10-10 10:02:57 -04:00
renovate[bot] daab2d7075 chore(deps): Update dependency bin-up and is-fork-pr (#5321)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-10-09 17:56:18 -04:00
Zach Bloomquist bbd452a9fc Update https-proxy-agent to 3.0.0 (#5311)
The fixes we need for our tests to run have been merged:

https://github.com/TooTallNate/node-https-proxy-agent/releases/tag/3.0.0

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-10-09 15:38:27 -04:00
Ben Kucera c2c51c6f17 reduce test flake in electron-driver-tests (#5320)
* increase timeout on domSnapshot.spec to reduce test flake

* fix flaky click_spec for headless electron
2019-10-09 15:06:00 -04:00
Ben Kucera 799c5b5289 run driver-integration tests in electron as well (#4987)
* run driver-integration tests in electron as well

* fix invalid clock_spec, performance entries not present in electron

* circleci: bump parallelism to 5 for driver tests

* circleci: fix config

* fix invalid navigation_spec to work on electron
2019-10-07 17:00:22 -04:00
Chris Breiding 7e97d96d93 Fix selector playground triggering keyboard shortcut (#5285)
* don’t trigger shortcuts if typing into a text-like element

* refactor / cleanup
2019-10-07 12:19:49 -04:00
Zach Bloomquist 55494882fa Update https-proxy-agent to point back to original repo (#5294) 2019-10-04 12:06:32 -04:00
Ben Kucera 1991b50bc4 fix: switch back to using jquery width/height on element dimens… (#5246)
* fix: switch back to using jquery width/height on element dimensions

* cleanup spec

* minor minor cleanup spec

* fix padding highlight as well

* test refac

* rename expect -> should

* still use innerwidth for window
2019-10-02 12:31:17 -04:00
Zach Bloomquist 740f5ab6a0 Suppress NODE_TLS_REJECT_UNAUTHORIZED warning (#5256)
* Suppress NODE_TLS_REJECT_UNAUTHORIZED warning

* move warning suppression to own module; add tests with and without

* use spread operator for args

* move originalEmitWarning
2019-10-02 11:38:42 -04:00
Gleb Bahmutov 4ec77e3d58 use Node path from config file to run plugins (#4436)
* use Node path from config file to run plugins

* add finding system node

* memoize node find, use fix-path if Node is not found

* find Node asynchronously

* update note on ENFILE

* print node version before executing registered event

* use nodeVersion option, add validator isOneOf

* linting

* remove resolve-dir

* debugging unit test

* resolve original promise to make the tests run correctly

* update second test

* add unit tests

* upgrade snap-shot-it package to be able to update snapshots

* make finding node path part of startup, merge into config

* update tests

* add node version & path to run output

* add node version display to desktop-gui

* add warnings, add tests, add learn more link in desktop-gui

* Revert "add node version & path to run output"

This reverts commit 40a3218175.

* only show Node Version if it is non-default

* Add e2e test for using system node

* cleanup

* add tests that resolvedNodePath and Version are available in tests

* assert nodeVersion == system

* add nodeVersion to schema

* add new configoptions to types

* add fallback if pluginsfile is disabled

* new package.json sorting

* update some of the wording/styling of Node Version panel

* remove ` from schema file

* clean up decaffeinated tests + update wording when no pluginsfile is present

* playing with messaging.

* push updated node version panel design

* update design + copy of Node panel again

* some more iteration on design (WIP)

* Finish design changes + fix tests

* add debug message

* linting problems

* add missed require

* Add comment to refactor the colWidths in this PR after another PR goes

* replace the exact length of Node version in specfiles

* print object for node version and path instead of %s %s

* update snapshot to match v12 length


Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-10-01 17:08:11 -04:00
Zach Bloomquist 70b769c53a desktop-gui fixes: Fix scrolling after Electron upgrade, add au… (#5242)
* Fix scrolling of desktop-gui panes after Chrome upgrade

* even better

* Restore box-shadow on runs tab

* Add auth fallback code on runs list

* Update project modal to use LoginModal instead of copypasta

* Fix failing tests
2019-10-01 13:29:48 -04:00
renovate[bot] ab6aabb1bc fix(deps): update dependency sanitize-filename to version 1.6.3… (#5216)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-10-01 10:23:18 -04:00
Zach Bloomquist 053b6bd993 Fix auth after Electron upgrade (#5243)
* Fix auth after Electron upgrade

shell.openExternal should've been converted to a Promise w/ Electron 5.

* add comment
2019-09-30 12:50:45 -04:00
Ben Kucera cf9eb67a72 fix(ui): add shortcuts to tooltips (#5238)
* fix(ui): add shortcuts to tooltips

* remove only, update eslint config to prevent onlys

* tweak styling of keyboard shortcuts
2019-09-29 18:15:01 -04:00
Hayden Hudson f64b54c70b fix spy badge counter being cut off (#4910)
* #4822

Proposal to eliminate the 'cut-off' appearance of the counter in favor of more of a 'pillbox' look

* Simplify 10px CSS
2019-09-29 08:44:16 -04:00
Jennifer Shehane 05a254a046 Truncate httpprops in error message to show more chars (#5150)
* bump up truncation of formatting http props to 2000 chars instead of 100

let’s see what snapshots look like 🤞

* Add a test for something with a long prop (url) to have snapshot to not truncate.

* remove unnecessary module


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-09-29 00:30:59 -04:00
Brian Mann e5c33fe568 Cleanup jquery pr (#5233)
* deasync failing on node 12.4.0 until its installed manually

* existential operator + comments

* use $dom utils for determining whether arg is valid jquery element

* cleanup and normalize variables to indicate whether they are jquery or not

- micro opt setting const for element accessors

* nvm, don't think its necessary
2019-09-28 22:32:29 -04:00
Ben Kucera f134e76c08 fix(errors): better error message when element is detached duri… (#4945)
* fix(errors): better error message when element is detached during actionability (address #695)

* fix various failing tests

* fix visibility_spec typo

* cleanup test, ensures.coffee


Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-09-28 22:28:22 -04:00
Zach Bloomquist e7ecfcf518 Fix gzipped utf-8 .js files getting corrupted (#4984)
* add failing test for utf8 word boundary corruption

* use UTF-8 aware stream replacer

* cleanup

* cleanup test server

* add link to issue

* add replace_stream tests

* add license

* perf improvements - tsificiation

* emit the maximum chars possible

* add better types

* move license, update test
2019-09-28 22:26:25 -04:00
Brian Mann 53506c698f correctly indicate how to reuse npm run cypress:run, format markdown table (#5232) 2019-09-28 21:59:16 -04:00
Zach Bloomquist 49f5b3e80c Introduce --config-file argument (#3246)
* cli, server: introduce --config-file argument

* server: remove unused import

* server: wip

* server: consider --config-file in settings

* server: pass options to settings.read from config

* server: store options in Project class, pass to all settings calls

* server: _initPlugins needs to accept options, for being called from server

* server: accept optional external options in open

* cli: update help snapshots

* server: realizing now that these were written like this so they could be stubbed - removing some unnecessary usages of @options

* cli: pass configFile when it's false

* server: --config-file false and --config-file blah.json work

* server: add unit tests for --config-file

* server: pass configFile to desktop-gui

* desktop-gui: display 'cypress.json' according to --config-file arg

* desktop-gui: add integration tests for --config-file

* cli: add tests for --config-file

* PR changes

* PR changes

* cli: update snapshots

* server: updating error messages

* runner: update cypress.json mention

* fixing name overlap

* server: integration tests for --config-file

* runner: update Header component tests

* cli: fix snapshot

* desktop-gui: fix test

* driver: fixing error messages - not really any visibility to cli args from here so just static strings

* server: update snapshots

* server: update snapshots

* cli: updating snapshot

* driver: how did i miss this?

* add skipped blank line to the snapshot

* fix missing proxy require statement (was lost in merge of develop)...weird

* add module API defs to types

* module API tests

* send better error when config file can't be found

* fix dtslint test

* update cli help to use 'configuration file'

* update snapshot using 7.7.1 in place

* fix failing config_spec

* be.visible

* show custom config file name in driver errors

* add tests for non-default config file in driver error messages

* single-quote config file name

* 🙅 IIFEs 🙅

* 🤦

* fix failing test

* fix failing test, cleanup

* lint

* delete duplicate coffee spec

* Update run.js

* Delete app_spec.js.mp4

* in open mode, only store projects to recents list if 'cypress.json' is the configFile

discussion: https://git.io/JeGyF

* feedback
2019-09-27 10:25:07 -04:00
Ben Kucera d8bdd4a85d Fix async timeouts (#5097)
* fix async timeouts

* add tests

* add asyncTestTimeout config value

* fix angular_spec, add timeout test

* fix connectors_spec

* fix querying_spec

* fix e2e test e2e_config_fails

* fix e2e specs, change calls to cy.timeout()

* remove added config value, use `defaultCommandTimeout`

* fix timing out internal tests

* cleanup

* add e2e test for async timeout after cy command

* [review] remove most of runner_spec

* add back runner_spec, whoops
2019-09-27 10:23:58 -04:00
Ben Kucera 7d750c430a dont send focus events to hidden focusable elements (#4913)
* dont send focus events to hidden focusable elements

* refactor into isFocusableAndNotHidden

* add w3c notes, rename method


Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-09-26 14:51:06 -04:00
Jennifer Shehane 12ab2a6141 Add a test case to ensure manually set env vars override values… (#5203) 2019-09-25 18:43:37 -04:00
Jennifer Shehane 2c35402fbe bump jquery to 3.0 (#1229)
* bump jquery to 3.0

* add selector property to the element returned by jQuery query

jQuery v3 has removed the selector property from the returned element,
this commit adds it back, making sure the error messages thrown
include the selector string.

See [jQuery v3 upgrade](https://jquery.com/upgrade-guide/3.0/#breaking-change-deprecated-context-and-selector-properties-removed)

* do not try setting highlight attribute on non-elements

* use jquery v3 on load callback

* another instance of jquery load

* better element check before setting an attribute

* use dom APIs instead of jQuery when unscaling AUT for screenshot

* bump jquery to 3.4.1

* replace instances of $.fn.width/height with respective dom APIs

jQuery 3 changed how it does width and height calculations (it now uses getBoundingClientRect), which takes into account the scaling and returns non-integers. We want the absolute integer value without scaling, so we're better off directly using the DOM properties.

* try should instead of then

* Revert "try should instead of then"

This reverts commit 91fdbde05d.

* try getting rid of borders

* try jquery 3.3.1

* try jquery 3.2.1

* try jquery 3.1.1
2019-09-25 12:16:37 -04:00
decaffeinate eaff40b499 decaffeinate: Run post-processing cleanups on screenshots_spec.coffee 2019-09-25 08:01:45 -04:00
decaffeinate 5118ea8424 decaffeinate: Convert screenshots_spec.coffee to JS 2019-09-25 08:01:45 -04:00
Jennifer Shehane 8980ed37fb decaffeinate: Rename screenshots_spec.coffee from .coffee to .js 2019-09-25 08:01:45 -04:00
Andreas (AK) 86adf425c1 Add keyboard shortcuts (#3943)
* add keyboard shortcuts lib to the reporter

#248

* add shortcuts to main.jsx

#248

* add appState param and other cases to shortcuts.js

* remove events that are not coded to work yet

* Write tests for shortcuts in reporter


Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-09-24 18:53:47 -04:00
Ben Kucera f32a921c9a accept options.ensure to disable actionability checks (#4881)
* accept ensure option on actionability

* remove left-in code

* update type_spec for changed error message

* remove unneeded code, allow focused to be validated for readonly

* address TODO in type.coffee about scrolling before typing into already focused

* rename ensureReceiveablility -> ensureNotDisabled, revert error message
2019-09-24 14:50:07 -04:00
Chris Breiding 6ba8d7cc93 Electron v5.0.10 (#4720)
* fix specs

* use debugger protocol for cookie handling in electron

* use latest gulp

* use rimraf instead of gulp-clean

* use electron 3.1.8 and node 10.2.1

* use gulp 4 in packages/static

* fix sendCommandAsync, log Schema.getDomains on CDP connect

* autofill e2e test name [skip ci]

* electron@5.0.7, see what new failures exist

* --no-sandbox for launching Electron

* update cookies logic for electron

* node 12

* update snapshot for new node

* update error message for new node

* stub sendCommandAsync

* only connect to socket if path has been replaced, fixes #4776

* update node-sass to support node 12

* skip wacky socket tests for now

* snapshot

* fix run_plugins_spec snapshot, don't include stack trace

* use --no-sandbox on linux to run as root

* allow sendCommandAsync to resolve

* use euid for root check

* log domains even if undefined

* don't worry about ending 1xx responses immediately anymore

* use --max-http-header-size, change max size from 8kb to 1mb, fix #76

* do not send 502 on failed websocket, just send back ECONNRESET

* update websocket spec port to not collide with other test

* update outdated expect

* Revert "only connect to socket if path has been replaced, fixes #4776"

This reverts commit f179eda5ca.

* update gulp in root

* update https-proxy unit tests

* update network spec to properly close server

* update reporter spec

* update https-proxy-agent to fix node 10.10.0 change

discussion: https://github.com/nodejs/node/issues/24474\#issuecomment-511963799

* only pass --max-http-header-size on node >=12

* use own server-destroy implementation that supports secureConnect events

* oops

* update socket_spec

* electron 6.0.0

* console.table introduced in node 10

* change browserify entry to init.js

* handle edge case when no response body

* console.table added in node 10

* do not exit app when all BrowserWindows are closed

* update e2e snapshots

* value may not be null

* update plugins spec

* correct cookie expiry, use browser.getversion for CDP version check

* fix snapshotting for require stacks

* reorder cookies in spec

* warn when depreated electron callback apis are used

* only report 1 plugin error per process

* cleanup

* node 12.4.0, cypress/browsers:node12.4.0-chrome76 docker image

* update shell.openExternal to promisified

* update dialog.showOpenDialog to promisified

* update webContents.session.setProxy to promisified

* updating native dependencies since we don't need ancient node ABI support anymore

* WIP: switch cookies to simpler, jar-less approach

* WIP: switch cookies to simpler, jar-less approach

* making tests pass

* improve cookie filtering logic

* Remove unneeded Promise.try

* filter what makes it to the extension

* properly re-set superdomain cookies on cross-origin cy.visit

* allow comma-separated list of e2e tests

* sort cookies in order of expiration date, ascending

* updating tests, cleanup

* update tests

* version electron as a devDependency, electron@6.0.1

* cleanup, remove old automation

* cleanup, remove old automation

* bump chokidar to fix win10 + node12 issue

was seeing this on windows:
https://github.com/nuxt/nuxt.js/issues/6035

fixed with version bump

* enable now-supported quit role, re-enable old tests

* don't need that arg there

* remove last deprecated callback electron invocations

* Delete cypress.json

* responding to PR feedback

* cleanup

* invoke

* use 'quit' role

* Use new appMenu role for Cypress menu on mac

* electron@6.0.2

* electron@6.0.3

* remove domain: cookie.domain and see what happens

* remove setErrorHandler

* Revert "remove domain: cookie.domain and see what happens"

This reverts commit 49e916896d.

* add unit tests for cookies

* ci

* fix project-content css

* electron@6.0.4

* fix specs_list test

* electron@6.0.7

* some cleanup

* electron@6.0.9

* Update 8_reporters_spec.coffee.js

* electron@5.0.10 - Chromium 73, Node 12

* cli: fix the STDIN pipe on Windows (#5045)

* cli: pipe stdin

* uggh, here is the actual change

* update cli unit tests

* add unit test

* more permissive check for json to include application/vnd.api+j… (#5166)

* more permissive check for json to include

* add json test for content-type application/vnd.api+json

* cruder solution passes e2e tests locally, so let's go with that

* Remove 'charset' from content-type before checking if JSON

* fix eslint for fixture specs (#5176)

* update eslint to lint files within 'fixtures' in support files

- ignore some edge cases like jquery, jsx and obvious js files we wrote
with broken code

* Fixes from eslint to 'fixtures' files

* Catch env variable with reserved name CYPRESS_ENV 1621 (#1626)

* server: check CYPRESS_ENV variable when merging configs

* catch invalid CYPRESS_ENV value in CLI, close #1621

* linting

* sanitize platform in test snapshot

* linting

* update error message text

* add missing comma

* fix finally merge in JS code

* pass CLI linter

* fix log reference, should be debug

* use correct sinon reference

* update message, show first part in red

* update error message text

* Addresses #2953 (#5174)

* Addresses #2953

* Added proper test for new error message

* Didn't realize it ran this test as well, whoops

* Implementing changes as suggested by @jennifer-shehane

* Fixing tests and error output. Moved the checks to the start of the get command to ensure we always catch improper options

* Removing issue test since the querying spec covers it

* Using coffescript isArray check

* depromisify things that were promisified b/t electron 5 <=> 6

Revert "update shell.openExternal to promisified"

This reverts commit 8b6460d015.

Revert "update dialog.showOpenDialog to promisified"

This reverts commit 5f178b075b.

Revert "update webContents.session.setProxy to promisified"

This reverts commit 727df3a4e5.

* node12.4.0-chrome76 => node12.0.0-chrome75

* fix tests for electron downgrade

* node12.0.0-chrome75 => node12.0.0-chrome73


Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-09-24 14:35:24 -04:00
nico-bellante 01c3514b78 Increase max viewport width to 4000px (#5189)
* increasing max viewport width to 4000px

* Update window_spec.coffee
2019-09-24 10:28:25 -04:00
ryan-snyder e0fb38fcab Addresses #2953 (#5174)
* Addresses #2953

* Added proper test for new error message

* Didn't realize it ran this test as well, whoops

* Implementing changes as suggested by @jennifer-shehane

* Fixing tests and error output. Moved the checks to the start of the get command to ensure we always catch improper options

* Removing issue test since the querying spec covers it

* Using coffescript isArray check
2019-09-23 13:47:51 -04:00