Commit Graph

2138 Commits

Author SHA1 Message Date
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
Gleb Bahmutov
9f082d97ca 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
2019-09-23 11:59:49 -04:00
Jennifer Shehane
b5b79fc9af 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
2019-09-20 16:52:22 -04:00
Jim Jazwiecki
7100a419f8 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
2019-09-20 10:27:55 -04:00
Zach Bloomquist
9f717fe7e8 Allow passing qs parameter to cy.visit to set querystring (#5040)
* allow passing qs param to cy.visit

* add types

* qs -> params, merge with url, throw errors on invalid type, add tests

* params -> qs

* cleanup

* fix test
2019-09-17 16:06:55 -04:00
Zach Bloomquist
8cde36eacc base64 encode the embedded runner config object so it can't b… (#5155)
* base64 encode the config so it can't be escaped

* update tests
2019-09-17 15:51:15 -04:00
decaffeinate
72b082df2d decaffeinate: Run post-processing cleanups on blacklist_spec.coffee and 3 other files 2019-09-17 12:44:50 -04:00
decaffeinate
40b389ca9f decaffeinate: Convert blacklist_spec.coffee and 3 other files to JS 2019-09-17 12:44:50 -04:00
decaffeinate
30d81ae05a decaffeinate: Rename blacklist_spec.coffee and 3 other files from .coffee to .js 2019-09-17 12:44:50 -04:00
Zach Bloomquist
7b85344b84 Fix proxying HTTPS requests to IP addresses (#4947)
* use own server-destroy implementation that supports secureConnect events

* stand up HTTPS server for requests over ssl to IPs

* don't need to resolve with

* fix tests

* stand up a server on 127.0.0.1 for test

* tighten up / cleanup code, consolidate + refactor

- lazily fs.outputfile’s
- move sslIpServers to be global
- add remove all CA utility

* Improve proxy_spec test

* Don't crash on server error events

* feedback

* derp


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-09-12 15:30:10 -04:00
Jennifer Shehane
1a4ac7d84c replace abandoned cli-table2 dep for currently maintained cli-t… (#5118)
* replace abandoned cli-table2 dep for currently maintained cli-table3 dep

* update dep require :P
2019-09-10 15:23:02 -04:00
renovate[bot]
9fa3f0989c fix(deps): update dependency term-size to version 2.1.0 🌟 (#5119)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-09-10 14:19:34 -04:00
renovate[bot]
796f2686d6 fix(deps): update dependency @cypress/get-windows-proxy to vers… (#5108)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-09-10 13:33:23 -04:00
decaffeinate
c8f8584ae0 decaffeinate: Run post-processing cleanups on run.coffee 2019-09-09 17:30:34 -04:00
decaffeinate
9955f4d632 decaffeinate: Convert run.coffee to JS 2019-09-09 17:30:34 -04:00
decaffeinate
5f9a28ad96 decaffeinate: Rename run.coffee from .coffee to .js 2019-09-09 17:30:34 -04:00
decaffeinate
171015736e decaffeinate: Run post-processing cleanups on runner_spec.coffee 2019-09-09 14:06:51 -04:00
decaffeinate
65f414a720 decaffeinate: Convert runner_spec.coffee to JS 2019-09-09 14:06:51 -04:00
decaffeinate
6587a48eeb decaffeinate: Rename runner_spec.coffee from .coffee to .js 2019-09-09 14:06:51 -04:00
Ben Kucera
9f5c63961d prevent .contains from finding <style> tags (#5079)
* filter out style elements from .contains
2019-09-03 19:08:33 -04:00
Gleb Bahmutov
66aa190bd7 ts: ignore agent argument to pass TS error 2019-08-29 16:37:47 -04:00
Gleb Bahmutov
647ae2490a try ignoring above rp line 2019-08-29 16:26:50 -04:00
ccodecamp
1b2faa2748 Adding presets for following viewports: 1) iPhone-XR, 2) iPhone-X, 3)… (#4967)
* Adding presets for following viewports: 1) iPhone-XR, 2) iPhone-X, 3) Samsung-S10, 4) Samsung-Note9

* Adding presets for following viewports: 1) iPhone-XR, 2) iPhone-X, 3) Samsung-S10, 4) Samsung-Note9

* Fix casing

* Cleanup

* Update window_spec
2019-08-26 15:25:22 -04:00
Rishabh Budhiraja
ed3c3ebab9 Fix BROWSER_NOT_FOUND by passing browser name, not object (#4999)
* passing browser name instead of object

* add test that message is correct
2019-08-26 10:03:47 -04:00
Clare So
a425f23660 #4452 Add a helpful error message for cy.visit() (#4982)
* #4452 Add a helpful error message for cy.visit()

* #4452 Add note on limitation of baseUrl

* #4452 Minor fix to the error message

Co-Authored-By: Ben Kucera <14625260+Bkucera@users.noreply.github.com>

* #4452 Remove the 2nd paragraph

Co-Authored-By: Ben Kucera <14625260+Bkucera@users.noreply.github.com>

* #4452 Reword the error message

Co-Authored-By: Ben Kucera <14625260+Bkucera@users.noreply.github.com>

* Clean up whitespace; tweak wording
2019-08-22 12:14:34 -04:00
Zach Bloomquist
ca0b74930c Move fast_visit_spec to performance-test stage, track perf (#4989)
* Move fast_visit_spec to performance-test stage

* upload results from fast_visit_spec and proxy_performance_spec

* test

* Track URL in proxy_perf_spec

* also send commit timestamp

* use more params, use ciProviders where possible

* test

* add platform + arch

* use commit-info for timestamp, commit message

* Revert "use commit-info for timestamp, commit message"

This reverts commit a55d16af3d.

* use commit-info for timestamp, commit message

* just always have nock

* slice(1) the testCases

* send current retry with fast_visit_spec

* currentRetry
2019-08-21 14:19:48 -04:00
Chris Breiding
da497e44d5 Fix desktop-gui layout issues when there's a plugins file error (#4962) 2019-08-09 23:26:24 +06:30
Chris Breiding
48816c6eba Fix more Desktop GUI layout issues (#4914)
* fix warning message layout issue

* ensure footer is at bottom when project error displayed

* fix warning about autoFocus
2019-08-08 15:11:46 -04:00
Ben Kucera
42cbe20a7d chore(deps): update @cypress/eslint-plugin-dev + eslint (#4930)
* chore(deps): update @cypress/eslint-plugin-json + eslint

* fix redefine global var
2019-08-07 16:01:49 -04:00
Ben Kucera
95b4e0d79d fix: fix selector-playground css (#4940)
* fix selector-playground css

* add selector_playground e2e spec

* add notes to webpack import syntax

* add notes to test

* fix runner unit tests: handle webpack imports
2019-08-07 13:37:14 -04:00
Ben Kucera
a038e7f5d4 Renames: issue 2957 (#4879)
* [rename only] {keyboard,mouse}.js

* refactor keyboard/mouse into cy/

* fix cy.type for refactor

* fix e2e test error

* commands now recieve devices as separate prop

* add .history to .estlintignore

* fix linting errors

* remove passing log and devices to commands, pull devices off of cy

* fix commands.coffee


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-08-05 22:02:04 -04:00
Ben Kucera
15bf98ff05 [rename] {keyboard,mouse}.js (#4922) 2019-08-04 00:26:23 -04:00
Zach Bloomquist
92b91fe514 Support NO_PROXY=<-loopback>, always have NO_PROXY=localhost ot… (#4800)
* localhost is always in NO_PROXY unless <-loopback> specified

* tests

* fix failing specs

* update test to use <-loopback>
2019-08-02 18:39:46 -04:00
Zach Bloomquist
52beabeda5 Do not crash on invalid HTTP CONNECT (#4916)
* Do not crash on invalid HTTP CONNECT

* fix test
2019-08-02 18:33:38 -04:00
decaffeinate
8808b54cf0 decaffeinate: Run post-processing cleanups on jquery.coffee and 1 other file 2019-08-01 17:57:58 -04:00
decaffeinate
9c9748c663 decaffeinate: Convert jquery.coffee and 1 other file to JS 2019-08-01 17:52:47 -04:00
decaffeinate
69a8dd4d3f decaffeinate: Rename jquery.coffee and 1 other file from .coffee to .js 2019-08-01 17:52:44 -04:00
Chris Breiding
71036d5862 Desktop GUI layout issues/improvements (#4905)
* dry up project mode spec

* fix desktop-gui footer being at top when loading project

* fix update banner covering last spec

* only scroll specs and leave filter in place
2019-08-01 16:55:53 -04:00
Ben Kucera
3e41428a2f fix skipped test in screenshot_spec (#4900)
* fix skipped test in screenshot_spec

* move to .finally
2019-08-01 16:52:14 -04:00