Commit Graph

12207 Commits

Author SHA1 Message Date
Jennifer Shehane c1416035e9 Add better instructions on how to run locally in docker [skip-ci] (#5387)
* Add better instructions on how to run locally in docker [skip-ci]

* Apply suggestions from code review
2019-10-17 16:27:31 -04:00
Talal916 758ec23ea4 Issue license readme update (#5374)
* Fixing link to License file

* Update README.md
2019-10-17 13:54:31 -04:00
Gleb Bahmutov 128d4392ae parse ~ in CYPRESS_CACHE_FOLDER env variable (#5393)
* parse ~ in CYPRESS_CACHE_FOLDER env variable

* linting
2019-10-17 11:47:29 -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
renovate[bot] e1f0f99892 chore(deps): update dependency @cypress/bumpercar to version 2.… (#5354)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-10-17 09:22:58 -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
Devon 1ce9575315 Updated Cloudflare cache purge to use API Tokens (#5250)
* Updated cypress/scripts/binary/util/upload.coffee to use curl and API Tokens as the cfcli command currently *ONLY* supports API Keys.

* Update purge cache to use request-promise

* Cleanup & remove sync method

* Remove unused cloudflare-cli dep

* update appveyor encrypted secrets for cloudflare

* add missing deps


Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-10-11 21:30:32 -04:00
Jennifer Shehane 89ceb7ac45 Remove incorrect typing for Cypress.Commands.overwrite - does not accept options (#5347)
* Remove incorrect typing for Cypress.Commands.overwrite - does not accept options

* remove test that accepted options
2019-10-11 19:21:01 -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
Gleb Bahmutov 5f96829337 do not inject context, closes #5312 (#5358) 2019-10-11 15:15:39 -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
Jennifer Shehane 2944be19a0 Contributing guide pr updates (#5353)
* [skip-ci] Add some of new Pull Request and Pull Request Review process to Contributing guide

* More updates to the Guidelines / dep updates and minor changes that were outdated.
2019-10-11 12:14:46 -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 24ba72f423 Update cli readme to include link to npm module / add new responsibil… (#5339)
* Update cli readme to include link to npm module / add new responsibilities

* lowercase npm [skip ci]
2019-10-10 11:01:01 -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
Ben Kucera 7fe503037d don't run flaky driver electron tests in ci (for now) (#5326) 2019-10-09 17:21:40 -04:00
Jennifer Shehane 6d0d4f4f6d store .npm/_logs in circleci artifacts in case there is a npm problem (#5323)
* store .npm/_logs in circleci artifacts in case there is a npm problem

* use custom command
2019-10-09 16:42:46 -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
Zach Bloomquist ddf9707e6b Catch & ignore ENOTCONN errors when piping Cypress subprocess (#5293)
* Catch & ignore ENOTCONN errors when piping Cypress subprocess

* Update https-proxy-agent to point back to original repo
2019-10-07 20:19:03 +03: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
Brian Mann 3f3cab4281 Update PULL_REQUEST_TEMPLATE.md 2019-10-03 17:10:05 -04:00
Jennifer Shehane 87b65bc9c3 Update PR Request Template based off of team review 2019-10-03 16:57:24 -04:00
Zach Bloomquist de5b393ab5 Switch node version to 12.0.0, not 12.4.0 (#5226) 2019-10-02 16:13:35 -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] 29b4f55d99 chore(deps): update dependency lint-staged to version .x 🌟 (#4725) 2019-10-01 13:14:29 -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
Gleb Bahmutov 21cdf6fc47 cli: add sizzle types needed by jQuery types (#5247) 2019-09-30 12:47:22 -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
Gleb Bahmutov b6996bd93c upgrade jQuery types to 3.3.31 to pass TS 3.6.2 check (#5230) 2019-09-28 22:01:12 -04:00