Commit Graph

63 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 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 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 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
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 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 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 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
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 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
Brian Mann 628281dd65 server / https-proxy: add more debug logs [skip ci] 2017-10-13 21:25:40 -04:00
Brian Mann 4a2a6ffabc server: add integration test, clarify on what the regexp does 2017-10-13 16:59:19 -04:00
Hugo Giraudel c98f77f2d4 Fix parsing error in parseNestedValues 2017-10-10 16:15:11 +02:00
Gleb Bahmutov 8673393e91 server: detect and remove stray double quote at the end of path
To patch https://github.com/cypress-io/cypress-monorepo/issues/535 a little. Note that if there are multiple arguments with backslashes passed via `npm start -- ...` then the entire thing is screwed up beyond hope: https://github.com/npm/npm/issues/18670
2017-09-29 14:03:29 -07:00
Gleb Bahmutov 4b54e049b7 print project file when cannot find it for #535 2017-09-29 15:31:59 -04:00
Gleb Bahmutov 449537a7ea windows: solve shell exec problem
Cypress executes multiple exec commands in local and global mode correctly
2017-09-28 19:22:32 -07:00
Gleb Bahmutov b2a3476dba sourcing shell profile 2017-09-28 16:01:38 -04:00
Gleb Bahmutov a0c08bbdf3 Windows support (#484)
* try installing on Windows

* Handle windows setup

- no browser detection on windows yet, just placeholder code
- symlink types

* add appveyor file

* add appveyor windows build

* use execa to run server unit tests

* run server unit tests on appveyor

* ignore root install errors

* upgrade rebuild-node-sass

and work on Json unit test that fails on Windows

* print npm version

before installing, commented out caching node modules in the root

* a few small tweaks for windows support

* fix bin-up in launcher project

use bin-up@1.1.0 for windows support, close #491

* cli: build script on Windows, close #492

* cli: build errors are fatal

* use cross-env in extension

Fixes environment variables on Windows in #490

* extension: fix 3 tests on Windows

1 more broken test remaining

* extension: use EOL before comparing text

* example: update test for Windows

* example: replace build.sh with build.js

Close #488

* remove trailing whitespace

* cli: build script again

* server: work on unit tests for windows

* binary: add windows as build platform

* windows: try building binary

started work on building on CI for windows
2017-09-25 10:17:28 -04:00
Brian Mann f2591f81b3 fixes #657, accept --headed option, remove undocumented --show-headless-gui 2017-09-17 14:56:50 -04:00
Chris Breiding 9bd38d7d45 server: remove logs/cache/settings from raygun reporting and keep stack trace file names. Fixes #455 2017-09-12 15:16:35 -04:00
Brian Mann 3f6b71d3cd server: derp rename the events here too 2017-09-10 22:16:46 -04:00
Brian Mann c90d159315 server: error when running from the CLI without a cypress project
- never seed the kitchen sink from the command line
- error if cypress.json was not found
2017-09-06 05:14:57 -04:00
Chris Breiding cbbbee1c03 server: fix per-project state.json. Fixes #430 2017-09-05 13:38:49 -04:00
Brian Mann 3607a08efb cli: remove passing in --cli-version to binary 2017-09-01 00:55:27 -04:00
Gleb Bahmutov a7c398ce8b server: pass CI group id with API call to create run (#396)
* server: pass CI parallel id with API call to create run

* rename parallel-id to group-id

* pass --group to use --group-id or infer groupId from environment

* test group with groupId

* fix integration spec
2017-08-31 14:24:37 -04:00
Chris Breiding 5e44159750 server: end bundling when write stream is finished 2017-08-30 10:03:07 -04:00
Gleb Bahmutov 4409698c7f Remove fs sync 373 (#376)
* remove fs.existsSync in unit test, close #373

* updating an integration test

* remove unlinkSync from an integration spec

* remove only

* make saved_stage async

* switched some tests to async state

* server: fix more state tests

* working on config to async

* change config mergeDefaults to async

* more .mergeDefaults tests updated

* fix config unit tests

* remove only in config unit tests

* fix server unit test

* fix two more tests

* server: maybe all unit tests fixed

* server: handle NPM 3 vs 4 in exit codes

* fix server start

* fix another server startup in test

* server: messaging and promise.try
2017-08-25 11:31:36 -04:00
Brian Mann 7bc35ae38a Merge branch 'driver-refactor-merge' into develop
# Conflicts:
#	circle.yml
#	packages/server/package.json
2017-08-17 14:03:31 -04:00
Gleb Bahmutov 13a0ece93e server: check reporter name right away, close #346 (#348) 2017-08-15 17:26:59 -04:00
Brian Mann 498d91db08 server: don't handle window.onerror during injection, let the driver handle this 2017-08-13 23:50:47 -04:00
Brian Mann c190a01817 driver, server: change isHeadless to isTextTerminal and add isInteractive config
-this enables us to have more fine grained control over headless / gui
behavior
-enables us to have consistent driver integration tests in CI
2017-08-12 15:43:33 -04:00
Brian Mann 08aead5daa Merge branch 'master' into driver-refactor-merge
# Conflicts:
#	circle.yml
#	docs/readme.md
#	packages/driver/src/cy/commands/actions/text.coffee
#	packages/driver/src/cy/commands/fixtures.coffee
#	packages/driver/src/cypress/dom.coffee
#	packages/driver/src/cypress/snapshot.coffee
#	packages/driver/test/unit/cy/commands/actions/select_spec.coffee
#	packages/driver/test/unit/cy/commands/fixtures_spec.coffee
#	packages/driver/test/unit/cy/snapshot_spec.coffee
#	packages/runner/src/lib/event-manager.js
#	packages/server/timers/child.js
#	packages/server/timers/parent.js
2017-08-11 13:35:58 -04:00
Brian Mann 9640f34ed6 driver: renamed 'aut' to 'app' for clarity 2017-07-21 18:41:59 -04:00
Brian Mann ef37396390 driver, server: use Cypress.action on spec script errors 2017-07-18 15:46:09 -04:00
Brian Mann 18c4120070 driver: refactor onBeforeLoad
-use action instead of onBeforeLoad method
-refactored and simplified listeners with callbacks
-simplified setting remote window props
-rename event prefixed with ‘aut’ for clarity
2017-07-14 12:02:21 -04:00
Brian Mann 9d654a9e16 server: extract html rewriter to util 2017-07-12 23:59:28 -04:00
Gleb Bahmutov a364607b6b Issue 281 - add @packages/root (#282)
* link: create fake @packages/root

* server: switch to loading @packages/root

* server: update tests after using @packages/root

* load root package in other places

* load root package in build using @packages/root

* update tests that mock root package

* server: fix server start whenever loading root package in updater

* fix updater test

* uncomment code
2017-07-10 10:07:52 -04:00
Chris Breiding fde040421e server: add config.isDefault
would have liked to have just have it in lib/config, but that caused a circular dependency since lib/config requires lib/scaffold
2017-07-07 15:36:59 -04:00
Chris Breiding e2f4f5745b server: store global app data under __global__ 2017-06-29 16:44:58 -04:00
Chris Breiding bdf4b96016 server: nest project-specific app data under projects directory 2017-06-29 16:44:27 -04:00
Chris Breiding 91f204fb74 server: fix app data path 2017-06-28 14:36:52 -04:00
Gleb Bahmutov a10f5bc2c0 remove stray comma 2017-06-22 17:24:36 -04:00
Gleb Bahmutov 3f9f875b10 save output results json from current working directory 2017-06-22 17:11:25 -04:00
Gleb Bahmutov b839bcfafb server: save JSON with results if passed --output-path, close #179 2017-06-22 17:05:41 -04:00
Chris Breiding 105479c78e cli/server: use run-project instead of run and fix specs 2017-06-14 14:18:19 -04:00
Chris Breiding e333e6d82e server: use —run to signal headless instead of —project 2017-06-13 13:52:31 -04:00