Commit Graph

220 Commits

Author SHA1 Message Date
Job
a4fa1b32f7 fix cli: global binary cache reuse (#1819)
closes #1813
2018-05-30 08:42:42 -04:00
Brian Mann
d92d51a8eb rename videoRecording -> video (#1804) 2018-05-29 17:23:01 -04:00
Ben Kucera
08d75f552f fix cli --version (#1803) 2018-05-29 15:39:18 -04:00
Gleb Bahmutov
1d43023064 cli: bump chalk to 2.4.1 close #1800 (#1801) 2018-05-29 14:23:42 -04:00
Brian Mann
96bd9c403f rename planId -> groupId (#1796)
* remove old / unused dead code for groupId

* rename planId -> groupId
2018-05-29 06:46:36 -04:00
Brian Mann
4053596a88 validate cli + env var config, add breaking config changes (#1784)
* fixes #1783 validate configuration values after they're set from CLI + Env Vars

* fixes #1754 remove screenshotOnHeadlessFailure and rename trashAssetsBeforeHeadlessRuns

* derp copypasta fail
2018-05-28 01:27:54 -04:00
Brian Mann
dc54d232c4 do not include process.env in debug logs 2018-05-26 19:02:13 -04:00
Brian Mann
93906dc8c4 put args on 1 line 2018-05-26 18:14:46 -04:00
Chris Breiding
7db71497a4 Update typescript types for screenshots (#1757)
* update typescript types for screenshots

* fullpage -> fullPage
2018-05-22 20:15:50 -04:00
Brian Mann
d154739726 colors, piping, utf8 characters, stream overrides (#1749)
* handle colors and platform piping

- pipe stderr to ignore high sierra fixes #1745,
- always pipe windows for utf8 encoding fixes #1143 and #1550
- force color in CI by default #1747
- support NO_COLOR argument #1748

* reset TTY for stdin and stdout not just stderr

* fix for failing tests in ci

* fix failing environment unit tests due to sinon env change

* fix failing integration request specs

* fix failing tests, cleanup cache before each test, not after

* fix failing integration server tests
2018-05-20 18:32:36 -04:00
Brian Mann
1d0b35bd47 Cli env var changes (#1734)
* wip [skip ci] update

* wip [skip ci] update test

* [skip ci] fix env var

* bump sinon, create helper utility to always throw when a stub is called without being given stubbed behavior

* update failing specs

* fix some error messages

* update snapshot

* warning -> note, add snapshot tests

* change snapshot os.release, test env vars
2018-05-19 15:37:52 -04:00
Chris Breiding
118297a30e Add screenshot configuration API (#1504)
* server: handle undefined values from plugins

* server: have plugins process inherit stdio

so console.logs and such from plugins file come through

* add cy.task()

* server: fix config spec

* driver: fix task spec

* server: change ‘task’ to ‘task:requested’

* server: have ‘task’ event take object literal instead of function

* server: document how to run individual integration and e2e tests

* fix cy.task specs

* server: fix task e2e spec

* add Cypress.Screenshot.defaults, implement most options

* accept new options in cy.screenshot()

* add jsconfig files for vscode’s sake

* only open test when capturing runner

* use dom to hide runner ui instead of react

* screenshot capture “all” -> “runner”

* fix specs

* refactor pausing timers

* implement before/after screenshot callbacks

* fix lint error

* enforce order of captures

* fix spec

* refactor app.jsx screenshot handling

* wait two ticks for repaint to occur before/after screenshots

* use special pixels to ensure cypress ui is hidden when taking app screenshot

* crop non-app from app screenshots

* add e2e test for pathological case where app has pixels that match rendering helper pixels

* fix screenshot app capture snapshot

* add unit tests for lib/automation/screenshot

* use blackout in app capture spec to ensure it renders

* fix task e2e spec

* fix driver screenshot spec

* use Promise.map {concurrency: 1} instead of utils.runSerially

* normalize minute durations in e2e test snapshots

* increase timeout for screenshot app capture e2e test

* correct app capture snapshot

* always run screenshot afterAll step

* call timer functions with context set

* simplify screenshot capture option to just be a string

* clone screenshot config to prevent mutation

* always capture runner w/o blackout on failures

* refactor and add more tests for screenshot events

* default to app capture

* try/catch screenshot dom modifications in case the iframe is cross-origin

* don’t blackout on runner captures

* update e2e test with latest screenshot api

* fix screenshots e2e test now that app capture is default

* refactor server/screenshots

* implement fullPage screenshot capture

* use capture: ‘fullpage’ instead of fullPage: true

* remove unnecessary try/catches

* add e2e tests for fullpage captures

* fix unit tests

* refactor full page screenshots

* rename/refactor from fullpage to multipart

* implement element captures

* split up screenshot e2e tests

* expose clip as screenshot option

* take devicePixelRatio into account for screenshot cropping

* some formatting and fun with retina offscreen images

* determine device pixel ratio server-side

window.devicePixelRatio can’t be trusted, because in headless electron it returns 1 even on a retina screen. Instead, we determine it server-side by dividing the screenshot resolution by the viewport size.

* refactor screenshot buffer handling

* add support for cy.within

* make fullpage the default capture

* only allow one element to be screenshotted

* coerce capture into ‘app’ for element captures

* fix specs broken by fixture change

* make top-left screenshot helper pixel less noticeable

* add some code comments

* refactor runner screenshots handling

* clean up before/after screenshot code

* ensure cleanup if test restarts in middle of screenshot

* skip pixel-checking on failure screenshots to reduce latency

* add types for new screenshot api

* fix typescript linting issues

* @sandbox -> sinon

* fix screenshots spec

* fix e2e spec

* fix specs

* fix specs
2018-05-16 15:00:59 -04:00
Ben Kucera
8a55864ae9 CLI caching (#1699)
* WIP [skip ci] tests passing -1

* WIP [skip ci] tests passing -1

* [WIP] [skip ci] more passing tests

* add run,open,verify cli tests

* fix package.json

* fix install_spec

* rename info_spec -> state_spec

* refactor cli options

* more useful logging

* change binary location, change folder name

* fix --binary-path arg

* update error message for cache

* lib/tasks/install.js changes

* add progress for direct unzip, prefer cache with override version with url/zip

* update cli logs

* prettier logs, remove arg

* fix failing test- stub os.release

* fix cli_spec snapshot, remove group and groupid args
2018-05-16 04:34:12 -04:00
Chris Breiding
d1fe365eca Add cy.task() command (#1422)
* server: handle undefined values from plugins

* server: have plugins process inherit stdio

so console.logs and such from plugins file come through

* add cy.task()

* server: fix config spec

* driver: fix task spec

* server: change ‘task’ to ‘task:requested’

* server: have ‘task’ event take object literal instead of function

* server: document how to run individual integration and e2e tests

* fix cy.task specs

* server: fix task e2e spec

* ensure stack trace comes through for task error

* don’t show stack for ‘known’ user errors

* add types for cy.task

* @sandbox -> sinon

* add e2e spec for task returning undefined

* update readme re: e2e —spec

* timedout -> timedOut

* new Promise + setTimeout -> Promise.delay

* improve cy.task() error messages

* fix specs
2018-05-15 20:49:20 -04:00
Aftab Khan
d8572371cb Adding the options normalizing step for open API (#1447)
* Adding the normalizing step for open API

* Adding tests to ensure normalization happens
2018-05-15 16:39:07 -04:00
Gleb Bahmutov
8188a44192 cli: print NODE_OPTIONS when DEBUG=cypress... is used, close #1673 (#1675) 2018-05-15 15:51:10 -04:00
Gleb Bahmutov
1f1935b361 Show help on unknown option 837 (#1615)
* cli: if user passed unknown option, show help and exit, close #837

* cli: test unknown option output

* linting
2018-05-15 15:10:26 -04:00
Gleb Bahmutov
bf4f6b9c75 fix: typescript definition for scrollIntoView, close #1606 (#1609)
* fix: fix the typescript definition for scrollIntoView, close #1606

* separate scrollTo options from scrollIntoView
2018-05-15 12:45:20 -04:00
Dumitrana Alinus
95f86236c4 Update index.d.ts (#1622)
Use local types for blob, bluebird, minimatch
2018-05-12 10:15:50 -04:00
PINGUET Julien
a88c04b3bd Add .filter(Function) typing (#1670)
* Add .filter(Function) typing

* Add .filter(Function) typing
2018-05-11 22:10:20 -04:00
Gleb Bahmutov
97e3092300 cli: pass timeout 5 seconds for XVFB, close #1628 (#1629) 2018-04-23 16:16:57 -04:00
Nicholas Boll
039192b1cd chore(types): Add initial Cypress.log API (#1289) 2018-04-15 01:56:59 -04:00
Nicholas Boll
075a3a0757 feat: Add type definitions for Cypress.off (#1514)
* feat: Add Cypress.off type definitions

* Added .off types and tests
2018-04-15 01:53:04 -04:00
Gleb Bahmutov
b839828fd4 place package keywords in root package.json, close #1508 (#1575)
* place package keywords in root package.json, close #1508

* update test snapshot

* add cypress.io keyword
2018-04-15 01:50:40 -04:00
Zaid Hoona
6dd7edea5c Add keywords to allow searching cypress in npmjs.com (#1522)
* Add keyword in package.json
* Also add keywords to the build script
2018-04-09 13:06:38 -04:00
Gleb Bahmutov
cf07e21d23 Fix engines 1373 (#1375)
* fix: use engines from CLI package, close #1373

* chore: add integration test for build script that writes package.json file

* do not hardcode version

* build npm package in this branch too
2018-02-25 21:04:12 -05:00
Brian Mann
46c1c21ea5 schema: add new modifyObstructiveCode option [skip ci] 2018-02-16 00:42:17 -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
Nicholas Boll
88f534bf08 fix: Incorrect type for 'then' returning a wrapped 'undefined' (#1220) 2018-02-04 14:45:42 -05:00
Gleb Bahmutov
99302267df Banner to separate test output (#1190)
* cli: add mocha-banner so we can see what each test outputs

* linting
2018-01-16 13:22:00 -05:00
Nicholas Boll
ae8b147e28 feat: Add TypeScript support for Cypress action events (#1187)
* feat: Add support for Cypress action events

* fix: Fixed documentation URL for actions

* fix dtslint test failures
2018-01-16 10:59:00 -05:00
Nicholas Boll
a51ea1f783 doc: should/and chainer autocomplete (#1132)
* fix: within type definition

* doc: should/and chainer autocomplete

* chore: Updated example documentation to match #1117
2018-01-09 17:05:55 -05:00
Sam
a7d0cff93f Fixing incorrect type for supportFile (#1167) 2018-01-09 16:59:38 -05:00
Adam Binks
0cb90927ce Fix typos in CLI errors.js (#1138)
* Fixed typos in errors.js

* Revert "Fixed typos in errors.js"

This reverts commit 99085af24c.

* Fixed typos in errors.js

* Fixed typo in errors spec snapshot

Hopefully tests should be passing now

* Fixed typo in verify spec snapshot
2018-01-02 13:23:35 -05:00
Brian Mann
17d1f85ec8 cli: bump xvfb 2017-12-25 00:07:36 -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
Gleb Bahmutov
aa0a41caf5 Doc ts better 1117 (#1122)
* ts: document common assertions, cy and Cypress

* document more common methods

* more comments for #1117

* todomvc examplehas good intellisense, close #1117
2017-12-24 18:25:06 -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
Gleb Bahmutov
ad0357dce0 cli: upgrade debug and extract-zip, close #1103 (#1104) 2017-12-21 20:17:29 -05:00
Gleb Bahmutov
d865439367 add cypress.schema.json close #1109 (#1112) 2017-12-20 21:02:01 -05:00
Nicholas Boll
233ddf8d7b fix: Unwrap subject returned by cy.then (#1085)
* fix: Unwrap subject returned by cy.then

* update to use Cypress.Promise
2017-12-19 11:15:05 -05:00
Chris Breiding
d406018fea Add selector playground to runner (#1079)
* runner: display css selector helper and highlight on hover

* runner: use unique-selector lib

* runner: eslint auto-fixes

* upgrade zunder to 5.5.1 and update configs

* reporter: add babel deps

* runner/reporter: lock react to 15.6.2

* runner: add highlight w/ tooltip and copy-to-clipboard

* runner/reporter: upgrade react-tooltip to 0.3.1

* server: upgrade browserify-preprocessor to 1.0.2

* cli: eslint auto-fixes

* upgrade zunder to 5.5.2

* runner: add defensive style resets to selector helper highlight

* runner: ensure iframe contents exist before acting on them

* runner: hide selector helper button when tests are loading or running

* runner: use shadow dom for selector helper highlight

* runner: reset state when selector helper is disabled

* runner: rebind selector helper when snapshot changes

* runner: don’t show tooltip when hovering over selector

* runner: integrate playground input into selector helper

* runner: fix mouseover/mouseout for selector

* runner: fix selector clearing

* runner: allow selector area to scroll

* runner: enable switching between get and contains

* runner: refactor method

* runner: add tooltip to selector helper toggle

* runner: focus selector helper input when method changes

* runner: remove references to cypressEnv

* runner: keep selector even if snapshot changes

* runner: persist selector helper state instead of clearing it when things change

* runner: hide method picker when clicking outside of it

* runner: pass model into selector helper

* CSS style changes to selector helper

- merge in changes + fix conflicts

* update close icon to not be so bold

* runner: keep selector helper styles out of main runner styles

* runner: rename playgroundInfo to info

* runner: simplify selector helper model

* driver: restrict more nodes from contains selector

* runner: cleanup

* runner: move selector helper to top

* more style updates for selector-helper

* move arrow to left of cy.

* Added a 'print to console' button

* runner: use fork of unique-selector and accept attribute selectors

* runner: implement print to console

* runner: close selector helper when re-running tests

* runner: improve header responsive design

* reporter: shorten console print message and lengthen duration shown

* more styling for css selector panel.

* style changes off of conversation

* updated main dropdown button

* update colors of input on invalid / no elements to be red

* disable copy to clipboard & print to console buttons if invalid / no elements

* style disabled clipboard & print buttons

* update tooltip on click of 'print to console' to say 'printed!'

* runner: refactor header to use mobx state

* add link to docs help to selector playground

* runner: add tests for header

* runner: use the right button

* runner: add tests for selector helper

* runner: remove unused variable

* runner: focus and select input when selector helper enabled or method changed

* runner: hide tooltip when selector helper is open

* runner: keep highlight from playground unless hovering over aut

* runner: always show selector helper info

* runner: show highlight when hovering over info

* Update SelectorHelper name from old Footer

* move 'selector highlight' behavior into 'highlight button'

* Added tooltip to 'highlight' button.

* runner: some style changes to selector-helper

* runner: do not focus and select input when 'turning off inspect mode'

* runner: fix issue w/ 'close' button on helper not working.

* runner: use Cypress methods for printing elements to console. bring console messages into parity with driver

* driver: revert experimental change to contains

* reporter: fix failing tests

* runner: fix failing tests
2017-12-17 14:17:19 -05:00
Nicholas Boll
a06ca4a19b chore: Add extra chainer types for auto-complete (#1059) 2017-12-14 16:47:39 -05:00
Nicholas Boll
5d761630f2 chore: Update type definitions to match API more closely (#1048)
* chore: Fill out Cypress API types

* chore: Convert Chainable into a Generic with a subject

* chore: undefined return of then keeps Subject

* fix: Remove incorrect comment

* chore: Add element keys to all selector methods

* chore: Remove generic from cy.not - it doesn't make sense

* chore: Add ChainableArray for array Subjects

* chore: Add ChainerArray to thread types through

* chore: Remove ChainableArray interface

* chore: Fix stub/spy types - returns Agent interface
2017-12-11 21:45:39 -05:00
Nicholas Boll
6db7a83125 chore: Add dtslint and Cypress static types (#1044)
* chore: Add dtslint and Cypress static types

* chore: Fix types location for cli build

* chore: Removed api from api command paths

* chore: Remove semicolons from type definitions

* chore: Removed semicolons not caught by tslint

* chore: Add type tests
2017-12-08 16:41:34 -05:00
Vincent Timofti
532cf38208 Typings: fix Cypress interface (#1010) 2017-12-05 11:55:57 -05:00
Ray Gesualdo
3a538601e1 Allow skipping binary download during install (#1008)
* added CYPRESS_SKIP_BINARY_INSTALL env var check before installing

* cli: provide reason binary installation is being skipped

- more linting, why not

* cli: prettify snapshots by removing whitespace at end of line
2017-12-05 11:39:29 -05:00
Gleb Bahmutov
da374e39e4 document failOnStatusCode for cy.visit 2017-12-04 16:59:32 -05:00
Gleb Bahmutov
f6e87c97ad Allow http download url 1001 (#1004)
* fix: allow http: download url, close #1001

* linting

* relinting JS files
2017-12-04 14:28:29 -05:00