Commit Graph

256 Commits

Author SHA1 Message Date
Brian Mann 2f8da7a7f0 server: fix runaway regexp fails parsing a massive JS file (#1331)
* server: fix runaway regexp fails parsing a massive JS file

* server: fix linting errors, better debug logs

* server: lint fix again
2018-02-17 00:26:38 -05:00
Brian Mann 4db34c9c75 Issue 1124 (#1310)
* server: fixes #1124, clear the disk cache whenever launching the browser

* server: bump express to 4.16.2

* server: fixes failing tests
2018-02-14 15:08:12 -05:00
Brian Mann a648ee4686 server, driver: fixes #886 redefine self + parent to prevent framebusting and clickjacking security measures (#1295)
* server, driver: fixes #886 redefine self + parent to prevent framebusting and clickjacking security measures

- add modifyObjectiveCode config, true by default

* driver: increase timeout for flaky test in CI

* server, driver: moved obstructive code rewriting to the proxy layer, out of JS, providing more comprehensive fix

* server, driver: fixes failing tests, make regexp much more conservative

* server: increase security specificity... down the rabbit hole we go
2018-02-12 01:01:00 -05:00
Brian Mann a360ac098a server, driver: fixes #1292 relax domain parsing rules and fallback to naive segment parsing to fix local and localhost (#1293)
* server, driver: fixes #1292 relax domain parsing rules and fallback to naive segment parsing to fix local and localhost

* driver: simplify ip address regexp
2018-02-11 16:05:06 -05:00
Brian Mann b48d29c07e electron: upgrade to 1.8.2, node 8.2.1, chromium 59 (#1275)
* electron: upgrade to 1.8.2, node 8.2.1, chromium 59

* server: update snapshots for node

* server: try to debug timeouts for mochawesome

* bump zunder

- node-sass 3.13.1 does not work with Node 8, since we’re upgrading the
project to node 8.2.1, we needed node-sass 4.5.3+. This node-sass dep
was coming from gulp-sass dep in zunder which has since been updated

* server: figured out that fixture scaffolding can cause timeouts

* bump zunder - get fix so that asserts are not prefixed with /

* server: use our own heroku example app

* use cypress/browsers:chrome64 docker image on Circle with Node 8

* update root folder name

* add hash to root cache

* disable permissions test, because cannot run as root

* server: only disable test in CI

* test new binary against other projects

* all: rename cypress-monorepo -> cypress

* scripts: use latest docker container

* server: don't skip as this messes up hooks which cause failures downstream

* driver: bump timeout for zonejs

* server: make tests pass for node 8.2.1 and 8.4.0
2018-02-10 22:08:56 -05:00
Brian Mann c56e35c818 server, driver: fixes #1288, handle basic auth at the network level, attach authorization headers to requests matching remote origin (#1290)
* server, driver: fixes #1288, handle basic auth at the network level, attach authorization headers to requests matching remote origin

* server, driver: fixes failing tests

* driver: fix tests, move around order of ops

* driver: try cypress promise

* server, driver: increase timeouts, don't disable background networking
2018-02-10 21:44:28 -05:00
Brian Mann 31f22c24b2 Issue 1155 (#1272)
* server: move hosts out of CLI args, keep as config only

* server, desktop-gui: fixes #1155 accept blacklistHosts from config CLI, display array on desktop gui settings

* server: pass args.config since its no longer flattened

* server: WIP trying to simplify config management

* server: fixes failing tests and circular refs

* server: fix failing tests with config hosts updates
2018-02-07 16:56:40 -05:00
Brian Mann 001a310b04 Issue 1159 (#1259)
* server: pass --cwd from CLI to use when resolving relative paths for various options

- remove unnecessary cwd manipulation in scripts/start

* server: fixes #1159, specs are normalized into an array resolved against cwd

- projectPath is now normalized against cwd as well

* server: move hosts out of CLI args, keep as config only

* server: convert spec array to string on module API

* cli: must ref root package directly

* server: fixes busted specs due to cherry pick

* server: temporary fix for specs being normalized into an array

* server: move around spec flattening earlier

* server: pass absolute path for specs

* server: revert flattening hosts into config temporarily

* server: add correct relative + absolute path to spec

* driver: normalize spec path against project

* driver: skip flaky test for now [skip ci]
2018-02-07 12:11:24 -05:00
Brian Mann e08778dd89 Issue 1175 (#1257)
* server: fixes #802 and fixes #380 and fixes #402 and fixes #493 and fixes #1161

- use the public suffix when parsing tld’s so that document.domain is
set correctly

* driver: move location spec back into cypress tests

* server, driver: fixes: #600 and fixes #1175 use public suffix for parsing tld, handle multiple different subdomains on cy.visit
2018-02-04 17:28:33 -05:00
Brian Mann aa667d5319 server: fixes #802 and fixes #380 and fixes #402 and fixes #493 and fixes #1161 (#1256)
- use the public suffix when parsing tld’s so that document.domain is
set correctly
2018-02-04 17:28:13 -05:00
Peter Hrynkow 893406f121 Allow .localhost tld to be parsed correctly (#1216)
* closes #451 - allow .localhost tld to be parsed correctly

* server: add unit + e2e tests for localhost, simplify regexp
2018-02-04 15:27:51 -05:00
Jacob Rothstein d462e0b83b return NODE_ENV to previous state after konfig() (#1224) close #1223
if the key previously did not exist, delete it
2018-01-25 09:25:05 -05:00
Gleb Bahmutov 11f1d1b6e3 Banner for server e2e tests (#1199)
* server: use terminal-banner in e2e tests

* add mocha-banner to integration tests

* different banner between e2e specs
2018-01-17 12:49:18 -05:00
Brian Mann edab5a452b driver: ufff move back e2e setup prior to all reporter tests 2018-01-07 11:27:01 -05:00
Brian Mann d42be106ef server: derp .only 2018-01-06 17:36:04 -05:00
Brian Mann 0e539c0232 server: enable long stack traces, nest mocha awesome setup 2018-01-06 15:45:37 -05:00
Brian Mann f83c39dd3c Issue 551 1063 1141 (#1158)
* server: fixes #1141 use runner.failures and increment them ourselves

* server: opt, install to server node_modules and then copy into e2e

* server: fixes #1063 and #551, ensure hooks cause exit codes + mochawesome resports are generated

* server: reduce unnecessary async ops
2018-01-06 13:10:40 -05:00
Brian Mann 93317d5e1b server: fixes #1142 polyfill titlePath for reporters using peer dependencies of mocha >= 4 2018-01-05 17:40:05 -05:00
Brian Mann 3fce3b5dd8 server: use niv to handle multiple versions of node modules 2018-01-04 15:02:37 -05:00
Brian Mann 3dafede470 server: fixes #977, capture stdout in windows (#1129)
* server: fixes #977, capture stdout in windows

* driver: skip flaky tests for now

* root: fix breaking eslint due to 4.14.0

* cli: bump xvfb to make node4 happy

* cli: bump xvfb fix context
2017-12-24 21:49:00 -05:00
Brian Mann d54156e2f2 cli, fixes #921, #1113, #1126, #1127, make DEBUG logs work, show error when xvfb exits with status code 1, force tty in linux, handle colors in windows, enable logging cypress:xvfb stderr
* cli: fixes #838 start cypress in dev by routing through the CLI

- matches how we run in production better to keep parity and consistency

* cli: add coerceFalse for clarity

* cli: add global flag, update to work with windows

* server: bring into parity with root scripts

* cli: just execute start script directly to work with windows

* cli: if colors are supported then force them via env vars

- this fixes windows not displaying colors from electron because by
default isTTY is false (due to electron)

* cli: fixes #921 don't ignore stderr, inherit stdio on everything except when linux + xvfb

- filter out stderr messages coming from Xlib or libudev (from xvfb)

* cli, server: force stderr tty so that normalize tty behavior when piping

* server: drop in supports color so debug outputs more colors!

* server: remove empty line

* root: refer to cypress not monorepo

* cli: make util.supportsColor return boolean

* cl: add tests around spawn behavior with forcing colors, tty, and stdio configuration

* cli: handle xvfb onStderrData callback to output debug information

* cli: handle non zero exit code error from xvfb with special message
2017-12-24 19:03:57 -05:00
Brian Mann bc6d8f0a4d cli: fixes #838 start cypress in dev by routing through the CLI (#1106)
* cli: fixes #838 start cypress in dev by routing through the CLI

- matches how we run in production better to keep parity and consistency

* cli: add coerceFalse for clarity

* cli: add global flag, update to work with windows

* server: bring into parity with root scripts

* cli: just execute start script directly to work with windows

* cli, server: fixes failing tests
2017-12-24 15:05:29 -05:00
Brian Mann 88c367ff13 server: fixes #1093, ensure github login works (#1094)
* server: fixes #1093, ensure github login works

- add more comprehensive tests around windows and events
- test that github callbacks work as expected

* server: fixes failing tests

* server: fixes failing tests, more resets
2017-12-19 12:54:35 -05:00
Brian Mann 191dbfb354 server: fixes #691, add event for exposing browser launch args (#1078)
* server: fixes #691, add event for exposing browser launch args

- enable special handling of ‘—load-extension’
- add e2e / integration / unit tests
- handle both chrome + electron cases

* server: iterate on failing tests, don't strip electron options else we lose valuable properties

- add better debugging

* server: fix failing tests, browsers needed

* server: send in a complete browser object for 'before:browser:launch'

- useful for doing conditional things with version and/or path
2017-12-17 16:57:26 -05:00
Brian Mann 1fbfcd6087 Issue 442 - blacklisting hosts with config.json (#1062)
* erver: fixes #442 implements blacklisting hosts with config

* server: add validation rules for blacklistHosts

* server: fix bad cherrypick / merge for WIP feature

* server: enable passing exit false to prevent browser teardown on completed runs

* server: add e2e tests for blacklists, fix edge case where blacklisted localhost was causing ws connection issues

* server: add snapshot for blacklist e2e test
2017-12-14 21:38:57 -05:00
Brian Mann 26873b60f2 server: add validation rules for userAgent 2017-12-13 00:17:18 -05:00
Brian Mann 9ab2855337 fixes #364 enable user agent to be changed in cypress.json (#1060)
* fixes #364 enable user agent to be changed in cypress.json

* server: fixes failing tests
2017-12-12 19:35:27 -05:00
Brian Mann c1bcb2f641 Issue 1042 (#1057)
* server: remove unused file

* server: WIP, start implementing accepting plugin returning promise and yielding config overrides [skip ci]

* server: cleanup the env + environentVariables disaster. simplify and only use 'env'

* server, desktop-gum: rename 'env' to 'cypressEnv' to avoid conflicts, fix failing tests

* server: modify plugins error content to be clearer

* runner, driver: more environmentVariables -> env cleanup

* fixes #509 return the complete configuration object to Cypress.config()

* fixes #1042 enable plugins to return a promise and modify config

* desktop-gui: add 'plugin' override to configuration display

* server: bug fix when plugin cause a project not to open

* desktop-gui: fix for failing e2e test

* server: make errors clearer when plugins crash

* server: fix bug with PLUGINS_FUNCTION_ERROR not sending right arguments

- fix failing tests
- improve plugin error content

* server: fix failing snapshots, preprocessor is invoked for support + spec files

* server: fix tests, don't watch the support file initially

- this was causing a problem where unhandled preprocessor errors were
causing the entire process to hang.
- this was happening because we weren’t properly running support files
through a custom preprocessor initially

* fixes failing tests
2017-12-11 20:53:23 -05:00
Brian Mann 2e9fe69e30 Issue 1020 1021 (#1028)
* release 1.0.3 [skip ci]

* use chrome62 docker image

* server: fixes #1020 and #1021 - disable gnu and add no sandbox when in linux and launching chrome
2017-12-06 20:46:30 -05:00
Brian Mann dc37dff548 server: (WIP) properly pass in browserName + version to API when creating instances (#1000)
* server: (WIP) properly pass in browserName + version to API when creating instances

* server: fixes #854 and failing tests

* server: fix using wrong property on found browser
2017-12-04 00:43:44 -05:00
Brian Mann a25b828675 driver: provide additional context when uncaught errors originate either from spec code or app code (#999)
* driver: provide additional context when uncaught errors originate either from spec code or app code

* server: fix failing snapshots for uncaught exceptions in spec + test code
2017-12-04 00:01:14 -05:00
Jamie 875e378930 feature: Update cy.visit to allow for visiting non-2xx response pages when option set (#982)
* Update requestUrl method to accept options param

* Update requestUrl to only throw error when failOnStatusCode option is true

* Set the default option value for failOnStatusCode to true

* Pass options to requestUrl call

* Update _onResolveUrl to take an options param

* Update _onResolveUrl to set domain for invalid status codes when visitable

* Update socket delegator to pass options arg to onResolveUrl

* Add server test case for new functionality around resolving non-2xx responses

* Add new driver test routes

* Add driver pkg test case for visiting non-2xx pages

* Add error test for edge case when non-2xx and non html response

* driver: normalize error messages by reducing 2 or more new lines into only 2 new lines

* driver: make test server routes clearer, remove unused route

* driver: simplify accepting bad status codes logic

- keep the isOkStatusCode logic in the server only, instead of also
putting it in the driver
- update the tests accordingly
- remove test that was unnecessary

* driver: add error message for explaining how to test bad status codes

* server: fix failing snapshot tests due to error message changes new line normalization
2017-12-03 17:10:49 -05:00
Gleb Bahmutov 8e21f87526 Add platform arch 824 (#986)
* add platform and arch to configuration object for #824

* pass platform and arch from config

* test Cypress.platform and Cypress.arch

* add TypeScript definitions for platform and arch
2017-11-30 15:30:18 -05:00
Gleb Bahmutov f8d8670763 server: parse JSON with unicode escape, close #964 (#965) 2017-11-29 16:21:20 -05:00
Chris Breiding 915264f834 Fix firing 'watched:file:changed' twice on change (#975)
* server: upgrade browserify preprocessor to 1.0.1

* server: rename preprocessor config to file object

* server: normalize path when removing preprocessor file

* server: only add one listener for file:updated in socket

previously, a listener would be added for every spec file opened, linearly increasing how many watched:file:changed events would be fired when a single file changed
2017-11-29 13:33:12 -05:00
Csaba Palfi d2a1705390 Issue 962 - Skip invalid cookies instead of crashing (#963)
* skip invalid cookies instead of crashing

* driver: ignore invalid cookies, add test
2017-11-27 17:45:22 -05:00
Chris Breiding eb7110bcd0 Fix plugins process error reporting (#946)
* server: fix error sent from plugins process to main process

* server: improve snapshot normalization
2017-11-22 17:13:02 -05:00
Chris Breiding 88efc33aba server: fix missing reject arg and add test (#935) 2017-11-20 20:56:12 -05:00
Chris Breiding 1ec6f7815f Create plugins API and add preprocessor plugin support (#888)
* fix broken menu specs

* extract browserify code and create preprocessor abstraction

* server: remove unused code

* server: implement logic for importing preprocessor

* server: add eslintrc and ignore test fixtures

* server: implement plugins API

* server: add node_cache module to manage clearing a package and its dependencies

* server: clear plugins file from cache to re-require it

* server: set pluginsFile to absolute path

* server: add debug logging to plugins

* server: watch pluginsFile

* server: throw the right error when requiring plugins file

* server: organize config folders and keys visually

* server: scaffold plugins file

* server: require plugins file via nodeCache.require

* server: update browserify preprocessor name and point to github for now

* server: remove redundant integration tests

* server: always scaffold plugins file, except when falsey

* server: add plugins file test to scaffold spec

* server: always provide util.fileUpdated to preprocessor

* server: update browserify-preprocessor dep

* server: fix integration tests

* server: remove redundant logic

* server: catch errors thrown synchronously by plugins function

* server: reduce chances of flakyness in async test

* driver: fix broken spec

* server: don’t check for dirname of supportFile and pluginFile when we know they’re already a directory

* driver: there is no dist

* server: update default options sent to browserify preprocessor

* server: send config into browserify instead of options

* server: add test around default preprocessor

* server: update browserify preprocessor

* server: refactor events spec to better handle multiple calls to handleEvent

* server: add tests around project:open events

* server/desktop-gui: handle errors when plugins file changes

* server: fix events spec

* server: allow any file types to be spec files

* server: validate config.pluginsFile

* server: remove link to error doc

* server: improve plugins error message

* server: simplify example plugins file

* server: on:spec:file:preprocessor -> file:preprocessor

* server: wrap plugins in a child process

* server: rename specsGlob to testFiles

* server: bump browserify-preprocessor ‘version’

* server: fix references left by merge

* server: fix incorrect function names

* server: fix plugin error serialization

* server: display error if plugins process has an uncaught exception or unhandled rejection

* server: reset domain on reset

* server: exit early on plugin error headlessly

* server: add e2e tests for plugins/preprocessors

* server: remove obselete node cache file

* server: fix integration tests

* server: log plugins error before exiting

* server: use npm version of browserify preprocessor

* server: extract string-splitting function

* socket: use path.join in spec

* server: eslint ignore scaffold files

* server: fix scaffolded plugins file links, add snapshot test

* server: if app_spec runs, cause a failure [skip ci]

- tested locally
2017-11-19 23:20:54 -05:00
Gleb Bahmutov a888f89d4d Do not format fixture on run (#924)
* do not reformat JSON / JS fixtures, close #902

* do not reformat coffee fixtures

* remove html rewriting

* update JS rewriting tests

* remove .only
2017-11-16 15:58:38 -05:00
Gleb Bahmutov 6f657d0740 Send list of specs with record build 861 (#862)
* server: log some basic info when creating build through api

* send list of specs to API, close #861

* update a few unit tests

* set exact version of typescript and ts-node

* test integeration test

* use bluebird instead of ramba for tap-tap-tapping

* server: find and filter specs by specPattern, return name relative to integration folder, add better integration specs
2017-11-01 21:00:03 -04:00
Gleb Bahmutov 386fea5d49 Simpler git parsing 841 (#843)
* replace gift with plain git commands, close #841

* testing git commands

* working as before

* reworked git command and sha unit test

* removed git module, using @cypress/commit-info

* update to pass the test

* remove one more reference to old git file
2017-10-29 20:22:26 -04:00
Gleb Bahmutov bac9d70a90 server: warn user if passed group id but not group flag (#829)
* server: warn user if passed group id but not group flag

* stop wrapping console.log twice
2017-10-27 10:05:03 -04:00
Gleb Bahmutov 46ac9aff69 server: read record key from environment variable, close #820 (#821) 2017-10-26 12:01:55 -04:00
Brian Mann 8ae23df329 fixes #777, add buildkite branch for recorded runs (#779)
* fixes #777, add buildkite branch for recorded runs

* server: cleanup buildkite env var
2017-10-20 18:16:40 -04:00
Brian Mann 4a2a6ffabc server: add integration test, clarify on what the regexp does 2017-10-13 16:59:19 -04:00
Brian Mann 84205ee9e7 Merge branch 'develop' into hotfix/env-parsing 2017-10-13 16:46:25 -04:00
Brian Mann d3aeb01b14 rename config option, consolidate some logic, add more comprehensive tests for recording, add integration test 2017-10-13 15:08:14 -04:00
Carlos Granados 3ca307e8d7 Change the name of the setting to videoUploadOnPassing 2017-10-12 12:43:53 +01:00
Carlos Granados 13fcd118a7 Add option to only upload videos on test failure 2017-10-12 00:19:24 +01:00