Commit Graph

12201 Commits

Author SHA1 Message Date
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
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
Gleb Bahmutov c936f72c1b update encrypted env variables on AppVeyor 2019-09-27 09:16:21 -04:00
Gleb Bahmutov f2a61bcc8c inject one more context for testing against staging dashboard 2019-09-27 08:15:05 -04:00
Gleb Bahmutov 71b018f680 inject upload vars into linux build binary 2019-09-26 18:14:07 -04:00