Commit Graph

12283 Commits

Author SHA1 Message Date
Gleb Bahmutov 7be840efca use default next-dev-version if not set during Linux binary bui… (#5512) 2019-10-29 11:10:59 -04:00
renovate[bot] eb078974fe chore(deps): update dependency cross-env to version 5.2.1 🌟 (#5491)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-10-28 14:47:07 -04:00
renovate[bot] 905b7900dc chore(deps): Update dependency cypress-example-kitchensink to v… (#5472)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-10-28 09:39:37 -04:00
Zach Bloomquist 978d97ee6d Always pass NODE_OPTIONS with max-http-header-size (#5452)
* cli: set NODE_OPTIONS=--max-http-header-size=1024*1024 on spawn

* electron: remove redundant max-http-header-size

* server: add useCli option to make e2e tests go thru cli

* server: add test for XHR with body > 100kb via CLI

* clean up conditional

* cli: don't pass --max-http-header-size in dev w node < 11.10

* add original_node_options to restore o.g. user node_options

* force no color
2019-10-25 16:59:35 -04:00
Gleb Bahmutov 3a747abf5d use tilda for cross user path 2019-10-25 13:41:48 -04:00
Zach Bloomquist 4b278f89de Fix not keeping track of correct URL when setting cookies durin… (#5455)
* Keep track of correct URL during request redirects

* Add snapshots for URLs during redirects
2019-10-25 13:16:40 -04:00
Gleb Bahmutov fcc252e94d Always use --no-sandbox with Electron on non-Windows system (#5458)
* WIP: add failing test job with non-root user

* change paths to node user

* print more info

* always use --no-sandbox when starting Electron on non-Windows OS

* add another test job that runs as a root

* use tilda

* use 12.0.0 image

* rename job
2019-10-25 10:54:03 -04:00
Gleb Bahmutov 94128a97e3 Fix decoding unicode values in the config object passed to the browser (#5451)
* correctly decode runner config

* add comments with original issue

* remove stray branch name to build
2019-10-24 16:52:08 -04:00
Gleb Bahmutov 1231417f49 Update a few more Circle jobs that changed their artifacts (#5454)
* grab binary and npm package from workspace

* update test-binary-against-kitchensink

* try installing several times

* update test-npm-module-and-verify-binary

* update test-binary-and-npm-against-other-projects job

* run test job after upload jobs

* update urls

* use current folder path
2019-10-24 14:17:01 -04:00
Jennifer Shehane 6cbb913f76 Update triaging. Explain handling issues about Dashboard features 2019-10-24 13:27:48 -04:00
Ben Kucera 994d16d5de don't log multiple:true by default in dblclick (#5427)
* dont log multiple:true by default in dblclick

* fix add in defaults

* fix consoleprops test

* Add link to issue this is addressing


Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-10-24 12:55:25 -04:00
Gleb Bahmutov c306113759 test kitchensink on all commits (#5422)
* test kitchensink on all commits

* separate build binary from upload binary jobs on Circle

* split Mac binary build from upload

* split npm build from upload

* test upload on this branch

* inspect tmp folder

* hmm, where is it

* print more

* ughh

* let us try again

* use root of project

* how is the file not found

* root cypress?

* update upload npm path

* more paths

* update Mac jobs

* remove temp branch
2019-10-24 10:55:52 -04:00
Brian Mann de5242d869 Release 3.5.0 [skip ci] 2019-10-23 17:58:46 -04:00
Gleb Bahmutov da9a747dd9 Merge branch 'master' into develop 2019-10-23 17:09:58 -04:00
Andrew Smith 0ac77adfa3 Merge pull request #5428 from cypress-io/update-pkg-json-350
Update package.json version to 3.5.0
v3.5.0
2019-10-23 16:34:10 -04:00
Zach Bloomquist 5aaeef74a1 Update package.json version to 3.5.0 2019-10-23 16:18:06 -04:00
Ben Kucera 1e78c3afa7 correct comments tagging fixed issues for cy.type (#5425) 2019-10-23 14:33:57 -04:00
Ben Kucera 5ddcf76e99 fix failing kitchensink tests in develop (#5423)
* fix force typing in disabled input, selection on non-selectionrange inputs

* rename clearer error

* add comments

* fix test names
2019-10-23 13:05:37 -04:00
Gleb Bahmutov 6878e606f6 trigger CI 2019-10-23 09:13:13 -04:00
Ben Kucera 9b1f5896e1 simulated type fixes (#4870)
* 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

* extract simulated type from native events

* most type_spec passing until tab

* add typedefs

* temp 08/08/19 [skip ci]

* fix type_spec, click_spec

* fix console table event table logging

* fix spec utils

* temp 08/12/19 [skip ci]

* large changes to selection.ts, working type_spec, eslint changes

* fix elements util, cleanup debugging code

* fix linting rules

* fix type_spec in electron by using plain Event contructor

* fix invalid clicking-into-iframe spec

* address review, cleanup

* use webpack-preprocessor (required for typescript files)

* fix invalid connectors_spec

* chore(lint): fix linting, since changed rules

* fix not borrowing property getter for maxlength

* 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

* temp 10/06/19 [skip ci]

* rename fromDocCoords->fromWindowCoords, fix type_spec ux test

* fix after merge from mouse-fixes branch / develop

* temp 10/08/19 [skip ci]

* Revert "temp 10/08/19 [skip ci]"

This reverts commit 92b73f6107.

* remove only, fix contenteditable test

* add test for datetime-local inputs

* add webpack devdep

* fix debugging code

* fix force:true on hidden input

* up timeout for test in ci

* 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

* fix display specific test

* fix type follow focus when redirect on focus

* cleanup new follow focus test

* 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

* cleanup after driver typescript PR

* fix keyboard getActiveModifiers

* fix(driver:keyboard): fix typing negative numbers with existing text selection

* remove debugging code, cleanup

* link fixed issues in tests, actually fix one issue

* cleanup remove dead code

* remove unused helper

* add test for #2166

* pay no attention to the code and implementation changing... add tests and note for changing focus into date input

* mark fix for issue #3316

* mark fix for issue #3722

* rename elements.isType -> elements.isInputType for clarity

* restructure keyboard a bit, don't export default, rework static class properties to regular exports

- attach $Mouse + $Keyboard to Cypress

* tighten up

* coffeescript fixes, consistent regexp const naming

* capitalize interface, tighten up several modifier functions

* misc cleanup and tightening up

* rework impl to use stubs instead of numbers

* some more cleanup

* fix logic with when function is called


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-10-23 06:10:44 -04:00
Zach Bloomquist 74a174bc82 Close CLI when exit event fires (#5413)
* Close CLI when exit event fires

* fix debugging for code and signal

* add test for exit before close

* template quotes -> single quotes

* resolveOn
2019-10-22 16:53:55 -04:00
Gleb Bahmutov bd54e3dff7 types: add failures and message to npm module result (#5337)
* types: add failures and message to npm module result

* remove memberof in comments
2019-10-22 15:29:21 -04:00
Gleb Bahmutov dd70563809 cli: detect installing from postinstall hook (#5407)
* cli: detect installing from postinstall hook

* add unit tests
2019-10-22 11:56:52 -04:00
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
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