Commit Graph

32 Commits

Author SHA1 Message Date
Brian Mann
e31b356519 ensure aborted requests are propagated forward (#2802)
- this prevents situations where long running connections build up over
time
2018-11-19 04:52:22 -05:00
Noel Yoo
999c217751 Refactor buffer constructor (#2489) 2018-10-01 10:25:40 -04:00
Brian Mann
126933385e capture electron console logs and more debug logs (#2303) 2018-08-09 08:27:53 -04:00
Brian Mann
dc28e87fb8 add support for handling event streams / server sent events / SSE (#2054)
* WIP: fixing SSE

* adds tests and error handling for event streams

* fixes failing tests due to request dep upgrade

* whoops, make sure e2e tests finish. add snapshot
2018-06-28 06:22:38 -04:00
Brian Mann
a9d08cfebe security stripping oversight (#2031)
fixes #2030
2018-06-26 18:36:02 -04:00
Brian Mann
c2256684be decode multi bytes correctly when stripping security from files (#1977)
* decode multi bytes correctly when stripping security from files

* fixes proxy errors occurring due to bad gzip responses from servers

- test that error handling on streams works as intended, send back 502
- test that truncated gzip responses are handled correctly
2018-06-19 03:21:42 -04:00
Chris Breiding
0e2246785c Screenshot fixes/enhancements (#1858)
* create directory path from screenshot name

* fix screenshot e2e specs

* ensure unique file paths for non-named screenshots

* append failure screenshots with ‘— failure’

* fix snapshot differences caused by slow computer

* fix driver specs

* fix minutes/seconds e2e snapshot replacer

* fix minutes/seconds e2e snapshot replacer again

* fix e2e specs failing due to screenshot path differences

* more snapshot fixes

* more snapshot fixes

* more snapshot fixes

* fix reporter showing wrong path for nested spec when no tests

* nest non-named screenshots in path based on spec path

* fix specs

* fix snapshot

* test that server + project state is reset between specs in cypress run mode

* rename spec.path to spec.relative. pass around the spec object instead of a string path

- store state on the project for current spec + browsers
- simplify how desktop gui passes around spec object
- fixes #1921
- make all specs a real spec model
- rename ‘Run all tests’ to ‘Run all specs’

* remove pretty-error dependency

* fixes #1919 and #1918, add Cypress.spec and Cypress.browser

* fixes all the failing tests

* fixes failing tests

* types: Cypress.spec

* add types for Cypress.browser

* fixes more failing tests

* enable null for spec props when running "All Specs"

* read comments per PR

https://github.com/cypress-io/cypress/pull/1858#issuecomment-396121876

* fixes failing tests

* fix linting

* fix types assertion

* fixes failing tests

* fixes failing tests, update from -- failed to (failed)

* ugh regexp

* fixes more tests

* add name, specName, and testFailure to the afterScreenshot props

* fix failing tests. append (failed) for failed screenshots

- use { testFailure: true } to indicate a failing test screenshot for
use in props
2018-06-17 20:01:27 -04:00
Chris Breiding
5efe2db542 Ensure errors from res.sendFile propagate and fail test run (#1883)
* ensure errors from res.sendFile propagate and fail test run

* fix e2e specs

* fix e2e test regression by correctly catching res.sendFile errors
2018-06-06 14:14:13 -04:00
Brian Mann
fc423ca467 WIP creating a new banner + summary table for runs #1588 (#1722)
* WIP creating a new banner + summary table for runs [skip ci]

* WIP continuing to iterate on new run output, use tables for results [skip ci]

* log -> debug

* switch out 400 -> 412 status code on schema errors

* update humanTime to take short or long formats

* debug the starting argv

* create terminal-size wrapper to return terminal columns + rows

* created custom terminal tables for displaying new stdout results for running multiple specs

- made tables responsive when columns < 100

* add e2e tests around exiting with error when browser cannot be found or specs cannot be found

- instead of creating a run, immediately die without making any requests
- improve BROWSER_NOT_FOUND error message

* strip ansi color codes from terminal spec, use chalk instead of colors

* pass webUrl from recording runs to be able to display URL before tests run

* finished new stdout flow for running specs iteratively

* when webUrl is present, display the recorded run in the header + footer

- move from ‘white’ to ‘reset’
- tighten up intro table

* change results output from "Video Captured" to "Video" to pair with newest config option

* use runUrl, not webUrl, fix white space, ensure that e2e snapshots are accurately normalized

* use console.log, not console.error to capture stdout for dashboard

* e2e tests around logging warnings when cannot record video

* 0 seconds -> X seconds

* Tests Starting -> Run Starting, Tests Finished -> Results

* Started video recording -> hr line break

* All Done -> Run Finished

* evenly space stdout section headers

* add a new line when exiting early from bundle errors

* sanitize stdout better, replace duration seconds, etc

* update all the various e2e stdout snapshots

* ensure that COLUMNS env is set to 100 for snapshots to pass

* better logging for env var

* env -> stdout

* store as string

* remove columns

* echo columns

* add columns back in

* comment out

* set terminal columns

* cleanup circle.yml [skip ci]

* normalize more result properties for browser, os, cypress

* set columns for server tests

* enforce no colors and correct columns + rows for e2e tests, fix cloning env vars

* update e2e tests for newest stdout

* set env vars for columns + lines for e2e tests, remove stty

* fix snapshots when duration is X second, X seconds, or XX seconds

* use process.env.COLUMNS not process.stdout

* ugh

* stringify

* log crap out

* quotes oh my

* fix failing e2e snapshot tests

* fix failing e2e tests

* fix failing integration tests

* fixes failing unit tests
2018-05-21 18:37:35 -04:00
Brian Mann
9efad08f8c fixes #1585 exit with status 1 whenever no specs were found (#1587)
* fixes #1585 exit with status 1 whenever no specs were found

* add a couple tests around spec video file name

* cleanup old circleci branch filters

* bump up range of expected timings

* rename specsUtil for clarity, fix failing tests
2018-04-15 00:43:34 -04:00
Brian Mann
40813b1954 Issue 416 431 681 980 1248 (#1583)
* extract random string to util

* run specs in isolation, aggregate totalFailures, display output per spec, enable globbing for specs

* extract electron app ready into its own module

* WIP: e2e tests around spec isolation, snapshots, stdout, and complete test results

* removed unused and deprecated remove id's feature

* move fs_warn to fs util to promisify an fs singleton

* create a glob singleton util

* cleanup dead removeIds code

* extract files controller specs into its own file

* extract finding specs out of project instance into its own utility with no state

* use glob util singleton

* use fs util singleton

* lots of formatting and cleanup

* fixes failing headless specs

* fixes all failing unit tests

* fixes failing integration test

* WIP: temporarily throw old error msg

* WIP: skip failing --record integration tests for now

* fix failing e2e tests
2018-04-14 23:13:44 -04:00
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
b10210883c server: add logs for when requests are blacklisted 2018-02-12 13:03:19 -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
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
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
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
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
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
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
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
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
036cc22070 server: fix server throwing when fixturesFolder is false 2017-07-07 16:30:08 -04:00
Brian Mann
2421180cae server: accept only allowed content encodings (gzip) 2017-06-14 18:12:09 -04:00
Gleb Bahmutov
0e074f4c5e server: upgrade glob in server to get absolute paths of specs for #118 2017-06-06 12:03:43 -04:00
Gleb Bahmutov
ba87bd5dfe Issue 118 - scaffolding in /tmp folder (#128)
* server: detect symlinked case in support file search for #118

* server fix problem found by unit test

* add unit test for paths

* correctly determining files in /tmp for a project

* server: cleanup resolving symlinks
2017-06-06 10:03:49 -04:00
Gleb Bahmutov
92f0cae349 bundles are saved and served from subfolders 2017-06-01 13:33:27 -04:00
Brian Mann
817758e4b6 all: symlink all cypress packages in root node_modules for easy access 2017-05-31 12:51:35 -04:00
Brian Mann
71f07c2512 server: rename packages/app -> packages/server 2017-05-09 13:51:45 -04:00