Commit Graph

163 Commits

Author SHA1 Message Date
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
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]
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
Gleb Bahmutov
21cdf6fc47 cli: add sizzle types needed by jQuery types (#5247) 2019-09-30 12:47:22 -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
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
renovate[bot]
0e867e0bda chore(deps): update dependency dtslint to version 0.9.0 🌟 (#4852)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-07-29 16:52:13 +06:30
renovate[bot]
3faae834ca chore(deps): update dependency @types/chai to version .x 🌟 (ma… (#4828)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-07-26 16:06:40 +06:30
Jennifer Shehane
f189d5e408 remove packages that do not appear to be used (#4755)
- I may have broken things - let’s see.
2019-07-25 11:08:01 +06:30
renovate[bot]
9756a0382d fix(deps): Update dependency lodash to version 4.17.15 🌟 (#4784)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-07-23 15:54:46 +06:30
renovate[bot]
5ab23f022f chore(deps): update dependency @cypress/eslint-plugin-dev to version 3.3.0 🌟 (#4723)
* chore(deps): update @cypress/eslint-plugin-dev to 3.3.0 🌟

* sort json package.json files + add note to skipped tests
2019-07-16 14:21:08 +06:30
Zach Bloomquist
79c7a6c36a Mention HTTP_PROXY if download error occurs; fall back to NPM's… (#4705)
* Mention HTTP_PROXY if download error occurs; fall back to NPM's proxy config in install

* better debug logs

* snap-shot-it@7.7.1 -> 7.8.0

* respect npm_config in server, add debug logs for proxy
2019-07-15 15:21:48 -04:00
Ben Kucera
f518e6e8c2 refactor typedefs for cy (#3499)
* refactor typedefs for cy

* fix dtslint

* fix dtslint

* add test for extending types
03-00000014

* typo

* docs and examples for cy type

* sorted props

* remove a few tabs

* better jsdoc
2019-07-15 10:36:12 -04:00
renovate[bot]
325fbf6f63 fix(deps): Update dependency lodash to version 4.17.14 🌟 (#4709)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-07-15 12:34:22 +06:30
Ben Kucera
fbd523615e [internal] Lint typescript, json, new eslint rules (#4449)
* temp 07/01/19 [skip ci] main lint files

* use lint-staged scripts

* fix all auto-fixable eslint errors

* manually fix lint issues in files

* temp 07/01/19 [skip ci]

* bump eslint plugin versions, update circle.yml

* [lint fix] remaining js files

* update vscode/settings.json

* add back stop-only

* use stop-only for linting .onlys

* fix verify_spec, build_spec

* update json plugin

* relint & apply corrections

* fix appveyor.yml not cleansing env vars (very bad)

* dont echo commit message in appveyor script

* retry build &

* re-add & upgrade lint-staged

* update contributing docs

* only let stop-only catch staged changes
2019-07-12 13:59:44 -04:00
renovate[bot]
e51f87ba7d chore(deps): update dependency dependency-check to version 3.4.… (#4690)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-07-10 16:24:33 +06:30
renovate[bot]
a474755e16 fix(deps): Update dependency lodash to version 4.17.13 🌟 (#4684)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-07-10 10:11:47 +06:30
Gleb Bahmutov
c57d302176 Verify downloaded test runner zip file 812 (#4193)
* if download has checksum use it to verify downloaded file

* check only filesize if no checksum available

* add download tests

* move checksum into util for reuse, be explicit

* add comments explaining headers used to verify checksum

* move hasha to dev dependency

* remove unnecessary function

* do not use deprecated Promise.join with spread

* fix promise join callback

* linting
2019-07-09 14:03:00 -04:00
renovate[bot]
a3daee100b fix(deps): update dependency request-progress to version .x 🌟 (#4584)
* fix(deps): update request-progress to 3.0.0 🌟

* Added method to utils to convert percent value to percentage

- Wrote unit tests for both calculateETA and the percent to percentage
conversion


Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-07-01 09:07:33 +06:30
renovate[bot]
c2d9ae4e42 fix(deps): update dependency fs-extra to version .x 🌟 (#4555)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-06-25 17:20:04 +06:30
Gleb Bahmutov
932bd1a585 chore: newline at the end of package.json 2019-06-19 15:39:01 -04:00
renovate[bot]
d01c4f0715 chore(deps): Update dependency snap-shot-it to version 7.7.1 🌟 (#4498)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-06-19 15:08:24 +06:30
Zach Bloomquist
60318a7f0f Use is-html as a fallback to check if cy.visit() response is HTML (#4321)
* use is-html as a fallback to check if response is HTML

* end response with passthru stream

* clean up network_failures

* add test that visit passes with undef content-type

* handle empty responses too

* try to fix dtslint: bump package version 2
02-00000876

* fix failing tests via develop merge


Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-06-19 03:05:38 -04:00
Jennifer Shehane
a151428e8e remove unused nyc dev dependency (#4486) 2019-06-18 12:04:07 +06:30
renovate[bot]
86574be7ea chore(deps): update dependency snap-shot-it to version 7.5.1 🌟 (#4465)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-06-14 22:45:22 +06:30
renovate[bot]
be5909f63c fix(deps): Update dependency fs-extra to version .x 🌟 (#4437)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-06-12 10:50:22 +06:30
Jennifer Shehane
e354d160fb Only submit forms with buttons of type='submit' or that are not type='reset' or type='button' (#4365)
* Fix issue where button of type='reset' would be activated during implicit form submission instead of button type='submit'

* Update to account for the fact that default type of button is 'submit'


Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
2019-06-04 10:05:12 +06:30
Ben Kucera
c3397dceb2 fix flaky spec: server e2e snapshot spec (#4324)
* fix flaky spec: server e2e snapshot spec - cleanse uploading multi results
05-00001bc5

* try to fix dtslint: bump package version
01-000059dc

* try to fix dtslint: bump package version 2
02-00000876

* clean up whitespace bonanza
2019-05-28 14:54:19 -04:00
renovate[bot]
83bc2cc83e chore(deps): update snap-shot-it to 7.4.4 🌟 (#4224) 2019-05-17 13:19:27 +06:30
renovate[bot]
76cb0efe52 fix(deps): update dependency getos to version .x 🌟 (#4222)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-17 12:05:47 +06:30
Gleb Bahmutov
d25cfacc6f Automatically retry verify and run commands on Linux if suspect DISPLAY problem (#4165)
* cli: debug explanation for XVFB

* linting

* add chai-as-promised to CLI dev

* show Linux specific error solution if cannot verify

* add todo

* chore: consolidate github issue url logic

* linting

* add npm script lint-changed to quickly eslint fix changes JS files

* retry verify with our XVFB

* update errors and tests

* update CLI tests

* add test for display error message

* fix unit test

* add successful test with retry

* finish verify retry test

* warn users if hit display problem on first verify

* try to detect display problem when running electron and retry with our xvfb

* add warning message to spawn when attempting xvfb re-run

* add test for display retry behavior on spawn

* more comments for clarity

* fix typo
2019-05-13 15:19:53 -04:00
Jennifer Shehane
6d5963b9ca remove unused devDep and dep "clear-module" (#4153) 2019-05-07 16:57:26 +06:30
renovate[bot]
a90bc3a3e5 chore(deps): update dependency snap-shot-it to version .x 🌟 (#4151)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-07 16:21:22 +06:30
renovate[bot]
c18a5eef63 chore(deps): update dependency dependency-check to version .x 🌟 (#4137)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-06 15:36:43 +06:30
renovate[bot]
33a9ab35a1 chore(deps): update dependency proxyquire to version .x 🌟 (#4115)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-03 18:58:09 +06:30
renovate[bot]
4733694bc2 fix(deps): update dependency tmp to version 0.1.0 🌟 (#4111)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-05-03 11:59:45 +06:30
Ben Kucera
1f0071002b Add timeout for cli/verify smoke test (#4080)
* temp 04/29/19 [skip ci] cli verify timeout

* add smoke test timeout error and tests

* cleanup code

* normalize snapshots for ci

* remove promise cancellation config

* cleanup error messaging and spacing for displaying the error details + descriptions


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-05-02 15:20:58 -04:00
renovate[bot]
57eda8cacf fix(deps): update dependency debug to version .x 🌟 (#3793)
* fix(deps): update debug to 4.1.1 🌟

* bump cli 'debug' down to 3.2.6 - last version that still supports Node 4


Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-05-01 13:12:07 +06:30
renovate[bot]
eb0097d8d3 chore(deps): update dependency mock-fs to version 4.9.0 🌟 (#4075)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-04-30 17:38:05 +06:30
renovate[bot]
610c64cac0 chore(deps): update dependency dtslint to version 0.7.1 🌟 (#4058)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-04-29 17:04:06 +06:30
renovate[bot]
875186ed36 chore(deps): update dependency bin-up to version 1.2.0 🌟 (#4047)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-04-29 16:11:09 +06:30
renovate[bot]
628f61a6c6 chore(deps): update dependency @cypress/bumpercar to version 2.0.7 🌟 (#4045)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-04-29 14:48:25 +06:30
renovate[bot]
9ef619cddf chore(deps): Update dependency shelljs to version 0.8.3 🌟 (#4049)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-04-29 13:59:33 +06:30
renovate[bot]
720d12c76f chore(deps): update snap-shot-it to 6.3.3 🌟 (#3953)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2019-04-12 18:16:40 +06:30
Zach Bloomquist
db752f5f93 Only package Windows builds of ffmpeg with Windows, build for win32 and win64 (#3877)
* appveyor build for this branch

* don't force install ffmpeg on windows

don't force install ffmpeg on windows

* derp

* fix

* build in appveyor

* oops

* delete using del

* use RMDIR instead of DEL

* only build 32-bit

* build for x64 and x86 windows

* separate win32 and win64

* require lodash

* make electron arch configurable

* cross-compile 32, only run in 64-bit

* force install ffmpeg if necessary

* it's all win10 x64, but we can force it to build for ia32 in x32 mode

* add windows util

* who's idea was it to make whitespace meaningful?

* pass arch to npm install, pass arch to uploader

* add TARGET_PLATFORM

* fun fact: appveyor titlecases env var names

fun fact: appveyor titlecases env var names

* fix: pass args

* use process

* cli: use arch package to send arch to server

* pass TARGET_ARCH to all npm installs

* run-all

* always call getUploadNameByOs

* use the precise version of node, enable both x64 and ia32 arch

* quotes

* uh wat

* move console logs to script because windows

* add yet another env var to install the right node arch

* use x86, not x32

* give ia32 a try, why not

* use platform env again

* and also try x86 again

* remove notion of target_arch since we're using the right node version with arch set correctly

* more comprehensive checks to ensure the arch is correct

* simplify building the binary, do not accept arch as options

* build the binary and test it on this branch

* remove arch, ensure that process.env.Platform is set to x86

* do build the binary unless this is a forked PR

* attempt to verify that this is a 32bit or 64bit windows binary

* remove unused dep

* consolidate commands

* don't install packages in windows - just build the binary

- this avoids needing to reinstall all node_modules and build-js twice

* build the binary on more branches

* cd up appveyor

* ugh

* right logic for whether or not this is a forked PR

* remove unused deps

* fix undefined var

* platformArch

* set in options

* turns out we do have to npm install before building the binary

* options.platformArch

* comment out appveyor build 32bit/64bit verification temporarily


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-04-08 11:48:14 -04:00
Zach Bloomquist
cd4156f166 Remove @cypress/get-windows-proxy from CLI (#3898) 2019-04-06 17:13:38 -04:00
Brian Mann
46a38c1c8b bump dep to support node 4 in the CLI 2019-04-03 02:50:38 -04:00
Brian Mann
1aa397f830 bump dep again 2019-04-02 00:05:08 -04:00
Brian Mann
2001b11065 bump dep in CLI too 2019-04-01 23:04:50 -04:00
Zach Bloomquist
c1a345dce2 Improved proxy support (#3531)
* https-proxy: unused file

* server: wrap all https requests that use a proxy

* server: use request lib in ensureUrl if proxy is in use. this makes runs tab work behind a proxy

* electron: pass --proxy-server to app itself, so the embedded github login page works

* cli: first attempt at env vars from windows registry

* cli: api cleanup

* cli: lint

* cli: fix crash on no proxy, add tests

* add desktop-gui watch to terminals.json

* cli: pass along --proxy-source

* electron: pass --proxy-bypass-list too

* server: whitelist proxy* args

* cli: better wording

* desktop-gui: display proxy settings

* extension: force proxy [wip]

* extension: finally, i am victorious over coffeescript

* extension: add -loopback to bypasslist

* extension: revert changes

Revert "extension: force proxy [wip]"

This reverts commit 3ab6ba42a763f25ee65f12eb8b79eb597efc9b11.

* desktop-gui: skip proxysettings if there aren't any

* https-proxy, server: proxy directConnections using https-proxy-agent

* https-agent: pool httpsAgents

* https-proxy: work when they're not on a proxy

* https-proxy: ci - use agent 1.0

* https-proxy: tests

* desktop-gui: hide proxy settings when not using proxy

* https-proxy: pass req through to https-proxy-agent callback

* cli: use get-windows-proxy

* desktop-gui: always show proxy settings

* server: use get-windows-proxy

* electron, server: supply electron proxy config when window launched

* server: fix

* https-proxy: cleanup

* server: clean up ensureUrl

* https-proxy: cleanup

* cli: fix

* cli: fix destructuring

* server: enable ForeverAgent to pool HTTPS/HTTP connections

#3192

* server: updating snapshot

* https-proxy: don't crash, do error if proxy unreachable

* https-proxy:

* get-windows-proxy@1.0.0

* https-proxy: use proxy-from-env to decide on a proxy for a url

* server: fallback to HTTP_PROXY globally if HTTPS_PROXY not set

* server: proxy args test

* cli: add proxy tests

* cli: add test that loadSystemProxySettings is called during download

* cli, server: account for the fact that CI has some proxy vars set

* https-proxy: ""

* cli, https-proxy, server: ""

* desktop-gui: update settings gui

* desktop-gui: cypress tests for proxy settings

* server: strict undefined check

* cli, server: move get-windows-proxy to scope, optionalDeps

* server, cli: use new and improved get-windows-proxy

* cli, server: 1.5.0

* server: re-check for proxy since cli may have failed to load the lib

* server, cli: 1.5.1

* server: NO_PROXY=localhost by default, clean up

* https-proxy: disable Nagle's on proxy sockets

\#3192

* https-proxy: use setNoDelay on upstream, cache https agent

* https-proxy: test basic auth

* https-proxy: add todo: remove this

* server: add custom HTTP(s) Agent implementation w keepalive, tunneling

* server: typescript for agent

* add ts to zunder

* server: more ts

* ts: add missing Agent type declaration

* server: create CombinedAgent

* server: use agent in more places

* ts: more declarations

* server: make script work even if debug port not supplied

* server: begin some testing

* server, ts: agent, tests

* server: test

* server: agent works with websockets now

* server: update snapshot

* server: work out some more bugs with websockets

* server: more websockets

* server: add net_profiler

* https-proxy: fix dangling socket on direct connection

* server: fix potential 'headers have already been sent'

* https-proxy: nab another dangler

* server: update test to expect agent

* https-proxy: fix failing test

* desktop-gui: change on-link

* server: add tests for empty response case

* server: tests

* server: send keep-alive with requests

* server: make net profiler hook on socket.connect

* server: only hook profiler once

* server: update tests, add keep-alive test

* server: only regen headers if needed

* server: move http_overrides into CombinedAgent, make it proxy-proof

for #112

* server: update snapshot

* server: undo

* server: avoid circular dependency

* https-proxy, server: use our Agent instead of https-proxy-agent

* server: add dependency back

* cli: actually use proxy for download

* server, launcher, ts: typescript

* Revert "server, launcher, ts: typescript"

This reverts commit d3f8b8bbb6.

* Revert "Revert "server, launcher, ts: typescript""

This reverts commit 818dfdfd00.

* ts, server: respond to PR

* server, ts: types

* ts: really fix types

* https-proxy, server: export CA from https-proxy

* agent, server, https-proxy: move agent to own package

* agent => networking, move connect into networking

* fix tests

* fix test

* networking: respond to PR changes, add more unit tests

* rename ctx

* networking, ts: add more tests

* server: add ensureUrl tests

* https-proxy: remove https-proxy-agent

* server: use CombinedAgent for API

* server: updates

* add proxy performance tests

* add perf tests to workflow

* circle

* run perf tests with --no-sandbox

* networking, ts: ch-ch-ch-ch-changes

* server, networking: pr changes

* run networking tests in circle

* server: fix performance test

* https-proxy: test that sockets are being closed

* https-proxy: write, not emit

* networking: fix test

* networking: bubble err in connect

* networking: style

* networking: clean p connect error handling

* networking => network

* server: make perf tests really work

* server: really report

* server: use args from browser

* server: use AI to determine max run time

* server: load electron only when needed


Co-authored-by: Brian Mann <brian@cypress.io>
2019-03-31 23:39:10 -04:00