Commit Graph

71 Commits

Author SHA1 Message Date
ElevateBart
52e97bedd5 fix: setup all missing options for run-ct
Now that run-ct is using the run command of cypress,
it can benefit from a wider range of options.
The most important for me was `--headless` but the complete list is
longer:
- `--parallel`
- `--reporter`
- `--spec`
- `--no-exit`
... among others
2021-02-12 17:15:39 -06:00
ElevateBart
c5e784de8e fix: add exit management on run-ct cli comand 2021-02-09 17:16:25 -06:00
Lachlan Miller
2d182902ca chore: update files based on TR review 2021-02-08 16:49:52 +10:00
Barthélémy Ledoux
9668694bc6 chore: make run-ct consistent with open-ct (#14902)
Co-authored-by: Jessica Sachs <jess@jessicasachs.io>
2021-02-04 20:54:44 -05:00
Brian Mann
af26fbebe6 feat: component testing (#14479)
Co-authored-by: Jessica Sachs <jess@jessicasachs.io>
Co-authored-by: Barthélémy Ledoux <bart@cypress.io>
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Dmitriy Kovalenko <dmtr.kovalenko@outlook.com>
Co-authored-by: ElevateBart <ledouxb@gmail.com>
Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
2021-02-04 15:45:16 -05:00
Dmitriy Kovalenko
3326e8a1d6 feat(component-testing): Cli changes (#14483) 2021-01-11 13:16:49 -05:00
Gleb Bahmutov
6a42af33d9 feat(cli): add --component to the version command (#9248) 2020-11-23 08:13:23 -05:00
Gleb Bahmutov
84d1afd27d feat: print bundled Node and Electron versions in cypress version (#9183) 2020-11-16 13:17:24 -05:00
Jennifer Shehane
61088bac2a fix: Show better error message during cypress cache list when no cache (#9023)
Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
2020-10-30 11:43:33 +06:30
Ben Kucera
1f75c81964 fix: use modern cli compile target, remove unneeded polyfills (#8938)
Co-authored-by: Kukhyeon Heo <sainthkh@naver.com>
Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
2020-10-26 10:39:49 -04:00
Greg Lahaye
b56c8c8688 feat: add cache prune command (#8766)
Co-authored-by: Zach Bloomquist <github@chary.us>
2020-10-09 15:14:19 -04:00
Kukhyeon Heo
aa4772c4cf feat: Print folder sizes with cypress cache list command. (#8590) 2020-10-05 11:31:59 -04:00
Björn Weström
121aebdf5e fix: corrected coercion of config-file argument (#8636) 2020-09-22 15:37:40 -04:00
Gleb Bahmutov
ef2363ea78 cli: expose method that parses cypress run CLI logic (#7798)
Co-authored-by: Zach Bloomquist <github@chary.us>
2020-07-14 15:39:17 -04:00
Steve
768da16a5e feat: add quiet cli arg/module option (#7714)
* Option to disable Cypress the verbose results to stdout

--quiet mode to disable the verbose results to stdout
but still use specified formatter

* Update cli/schema/cypress.schema.json

Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>

* Cypress module support for --quiet

Cypress module support for --quiet

* Apply suggestions from code review

Co-authored-by: Zach Bloomquist <github@chary.us>

* Address feedback

Address feedback, thanks

Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
Co-authored-by: Zach Bloomquist <github@chary.us>
2020-06-22 11:10:35 -04:00
Gleb Bahmutov
3b6514399d Do not silence cli commands (#6909)
* always log cache path

* cache list always logs

* cypress version should always log result
2020-04-01 11:44:27 -04:00
Jennifer Shehane
2ba53f6837 Better handle reserved key CYPRESS_ENV being set by users to va… (#6437)
* Add warning when setting CYPRESS_ENV to non-production value

* Add warning and update error when setting CYPRESS_ENV in config to non-production value

* Update config test/to throw

* we want warning, not throw

* Rename env var to CYPRESS_INTERNAL_ENV + fix warning to actually warn when staging

* update cli snapshot to include new 'info' command

* yarn.lock

* removed the warning from config, is overboard on our own tests 😓

* cleanup from review

Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
2020-03-06 16:53:48 +06:30
renovate[bot]
eab801ae3f chore(deps): Update dependency eslint to version 6.8.0 🌟 (#6509)
* chore(deps): Update eslint to 6.8.0 🌟

* fix missing dangling commas for linter

* fix missing dangling commas for linter

* more lint fixes

* yarn lock

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-02-25 00:09:47 +06:30
Gleb Bahmutov
070fceff20 add "cypress info" command (#6372)
* WIP: add cli info command to list detected browsers

* print found browsers

* change to list

* start work on info command calling into binary

* move info command into binary

* print OS info during cypress info command

* add binary cache path to info command

* add browser profile path

* add memory

* get browser profile path without partition

* pick real browsers as examples

* output same info as desired

* better names

* changed colors

* add list of cached binary versions

* do not put stable into name

* add underlined link

* conditionally show profile path, only if the folder exists

* do not list cached binaries

* human-friendly memory print

* print env proxy vars

* print CYPRESS_ env variables

* use _.sample

* update order

* store cypress info output on CI as HTML page artifact

* add percy CLI screenshots

* sanitize cypress info command

* store CLI snapshots in cli/visual-snapshots folder

* update cli unit snapshot

* add cli unit test

* start e2e testing for cypress info

* add test with proxy and cypress vars

* make sure we call the binary

* stricter start check

* start unit testing modes info

* test info mode browser print

* add test for profile path

* add cypress info command to test binary Circle job

* add cypress info to test-binary-as-specific-user circle

* print cypress info --dev on circle and on appveyor

* update .gitignore

* move error in environment load to debug
2020-02-20 10:54:25 -05:00
Zach Bloomquist
09cdcdf0cb Fix cypress cache subcommands (#6348) 2020-02-06 12:58:06 -05:00
Chris Breiding
d76123b3d9 Add Firefox support (#1359)
Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-02-06 10:52:13 -05:00
Chris Breiding
c491a3eda5 Merge branch 'develop' into v4.0-release 2020-01-29 12:47:11 -05:00
Zach Bloomquist
35109fb08c Chrome headless (#5676)
* always disable xvfb

* add --headless

* Revert "always disable xvfb" - it is still needed for Electron

This reverts commit 058679f4ce.

* updates

* update 3_plugins_spec

* update wording now that chrome can be headless

* fix video recording when headless

* Don't assume that chrome is headed

* update electron video recording message

* Add 2_headless_spec for Cypress.browser values

* update headless language

* still use headless by default for electron and headed for chrome

* fix up cli

* fix e2e tests

* update npm api types

* fix 2_headless_spec

* keep alphabetical ordering

* increase binary size limit

* add a comment on the cli error impl

* use _.defaults for default for headed

* fix

* _.defaults mutates
2019-12-12 12:26:32 -05:00
Chris Breiding
62fde51d84 update cli to work with latest commander.js 2019-12-10 10:03:58 -05:00
Jennifer Shehane
692a3c07d9 Support --tag argument (#5164)
* Alphabetize cli options for my own sanity

* begin added tag flag

* Fix some minor grammar in cli help output + be more specific for specs description

* update snapshot based on alphabetization change

* update snapshot to include --tag in help output

* update logic for pulling out space delimited args to look through --tag and --spec flags dynamically

* Support and pass along tag flag to run and record

- show err if passed without record flag
- sanitize args into comma separated string
- display tag in record errors

* fix some tests/snapshots where 'tag' was missing

* Actually try passing in tag through tests to ensure it prints.

* Merge branch 'develop' into issue-2561-tags

# Conflicts:
#	cli/__snapshots__/cli_spec.js
#	cli/lib/cli.js
#	cli/lib/exec/run.js
#	packages/server/lib/modes/run.js
#	packages/server/lib/util/args.js

* Send 'tags' as an array to backend API

* Update json-schemas to query against 2.2.0 of postRun

- this will require a bump to json-schemas repo

* update test to reflect tags array

* update snapshot to display nightly tag

* rearrange args to alphabetical order in specs

* Add tags to runResponses / remove tag from incorrect instance post

* Fix failing specs / snapshots

* Update error messages + snapshots

* Fix snapshot that no longer displays tag arg

* fix args unit test

* remove extra slash

* add a few more cli tests

* another test just in case

* a quick unit test for displayFlags utility


Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
2019-12-05 23:02:14 +06:30
Gleb Bahmutov
8c911a58ae cli: remove any leftover double quotes from group and ci build… (#5692)
* cli: remove any leftover double quotes from group and ci build id CLI args

* call function directly
2019-11-15 11:59:45 -05:00
Zach Bloomquist
49f5b3e80c Introduce --config-file argument (#3246)
* cli, server: introduce --config-file argument

* server: remove unused import

* server: wip

* server: consider --config-file in settings

* server: pass options to settings.read from config

* server: store options in Project class, pass to all settings calls

* server: _initPlugins needs to accept options, for being called from server

* server: accept optional external options in open

* cli: update help snapshots

* server: realizing now that these were written like this so they could be stubbed - removing some unnecessary usages of @options

* cli: pass configFile when it's false

* server: --config-file false and --config-file blah.json work

* server: add unit tests for --config-file

* server: pass configFile to desktop-gui

* desktop-gui: display 'cypress.json' according to --config-file arg

* desktop-gui: add integration tests for --config-file

* cli: add tests for --config-file

* PR changes

* PR changes

* cli: update snapshots

* server: updating error messages

* runner: update cypress.json mention

* fixing name overlap

* server: integration tests for --config-file

* runner: update Header component tests

* cli: fix snapshot

* desktop-gui: fix test

* driver: fixing error messages - not really any visibility to cli args from here so just static strings

* server: update snapshots

* server: update snapshots

* cli: updating snapshot

* driver: how did i miss this?

* add skipped blank line to the snapshot

* fix missing proxy require statement (was lost in merge of develop)...weird

* add module API defs to types

* module API tests

* send better error when config file can't be found

* fix dtslint test

* update cli help to use 'configuration file'

* update snapshot using 7.7.1 in place

* fix failing config_spec

* be.visible

* show custom config file name in driver errors

* add tests for non-default config file in driver error messages

* single-quote config file name

* 🙅 IIFEs 🙅

* 🤦

* fix failing test

* fix failing test, cleanup

* lint

* delete duplicate coffee spec

* Update run.js

* Delete app_spec.js.mp4

* in open mode, only store projects to recents list if 'cypress.json' is the configFile

discussion: https://git.io/JeGyF

* feedback
2019-09-27 10:25:07 -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
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
James George
70c441c9f9 fix(chore): fixup usage information (#4546)
* Fixup usage information

* Update unit test snapshot
2019-06-25 12:32:24 -04:00
Brian Mann
77c62e010b improve CLI verify + run display warnings (#4230)
* tighten up potential xvfb display problems

- improve the warning message on possible display problems
- reuse existing helper functions for platform detection
- instead of relying on timing mechanisms, if a possible display
problem is detected on linux - capture all of the stderr silently and
if the broken gtk message is detected, retry running

* consolidated and simplified smoke testing, xvfb error logging and messaging

- added —dev support to cypress verify cli command

* fix lots of tests, restore one error message

* fixed remaining CLI tests

* console.log pong only in electron mode

* remove dead code
2019-05-17 09:12:03 -04:00
Zach Bloomquist
5a0d8b5cfe Allow passing a list of space-separated specs to --spec (#3375)
* cli: add otherSpecs for varargs [wip]

* scripts: pass command-line args through to debugged command

* cli: parse space-delimited specs

* cli: undo unneeded

* cli: cleaned up parseVariableOpts, added warning

* cli: cleanup

* cli: add tests

* cli: glorious whitespace

* cli: a more robust test

* cli: better snapshot

* server: strip single-quotes around --spec arg

#2298
2019-03-15 00:42:46 -04:00
Zach Bloomquist
ef9b8f7b38 Launch browsers by path: --browser /path/to/browser (#3337)
* adding multiple possible binary names for linux

* windows launcher doesn't consider "binary", so don't pass it

* adding test for multiple binary names

* Stronger typing, clearer variable names

* Stronger typing, clearer variable names

* cleanup

* cleanup

* clean up type- why isn't this being linted?

* Add more aliases (#3217)

* launcher changes to use Browser throughout, also clarifying FoundBrowser/Browser distinction

* wip

* wip

* update tests to expect objects

* removing errant debugger calls

* Fixing tests

* desktop-gui: use displayName for display

* ' -> "

* launcher: add definitions for google chrome beta and unstable

* server: fallthrough to using chrome helper

* server: changes for run mode to pick correct version

* desktop-gui: add displayName to fixtures

* server: isolating bug with runmode

* browser was a string all along

* server: re-promisify browser detection

* launcher: remove chrome-beta for now, needs some more tweaking for that to work 100 percent

* launcher: cleaning up types

* launcher: fix type comflict when filtering browsers (#3258)

* launcher: cast Windows foundbrowsers

* launcher: mapSeries -> map

* launcher: clean up launcher, change 1 call in server to match

* launcher: test that browsers contains what we like it to

* whoops

* server: accept path in runmode

* launcher: changes for detectByPath [wip]

* server: update tests to use new errors

* launcher: error message cleanup

* launcher: detectByPath working with CLI client

* launcher: detectByPath tests

* launcher: cli client for detectByPath

* server: update error msg snapshot

* cli: allow passing --browser to open mode

* server: using --browser=/path/ works in run and open mode!!

* launcher: change displayName of custom browsers

* server: find browser with highest version property by default

* launcher: update tests, clean up types

* server: fix tests

* server: fix tests

* cli: update help snapshots

* launcher: tests

* server: wip

* server, launcher: clean up errors

* server: add unit tests for events

* server: change e2e helper to support custom browser strings in stdout

* server: e2e tests for browser by path

* server: if this break that

* server: clean up and fix? tests

* decoffeeate, entypescriptify

* server: fix test

* cli: fix whitespace

* cli: remove external browser notice

* server: detect a browser to use for the e2e launch-by-path test

* server: make stackTraceLinesRe not match all sentences with 'at' in them

* server, launcher: update 'not found at path' error msg

* server: clean up browser switch

* server: customBrowserPath

* server: update snapshots that were affected by the old stackLineRe

* server: update stubs

* server: update BROWSER_NOT_FOUND_BY_PATH to use error objects

* server: backticks in snapshots break snapshots

* server: forgetting to save without formatting will be my downfall

* server: remove comment

* desktop-gui: make custom browsers chosen

* desktop-gui, launcher: update tests
2019-02-16 15:12:17 -05:00
Ben Kucera
ef8b240bc0 improve cache help messages snapshot more (#2625)
* snapshot more, remove execa in tests for speed

* sub-command -> command, add snapshot

* restate execa
2019-01-25 00:34:58 -05:00
Brian Mann
2333d04a54 secure cookie error crash (#2685)
- fixes #1264 
- fixes #1321 
- fixes #1799  
- fixes #2689
- fixes #2688
- fixes #2687 	
- fixes #2686
2018-11-01 12:34:37 -04:00
Amir Rustamzadeh
f313dd0b84 iterate through specs in parallel (#2154)
- fixes: #2153
- fixes: #1566
- fixes: #1690
- fixes: #2275
- fixes: #2276
2018-08-06 07:24:19 -04:00
Ben Kucera
56e00981aa cache commands, --no-exit (#1875)
* add --no-exit, cache commands

* Manage -> Manages

* fix run, run spec

* remove comments
2018-06-05 16:19:23 -04:00
Ben Kucera
08d75f552f fix cli --version (#1803) 2018-05-29 15:39:18 -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
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
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
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
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
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
Brian Mann
a8dcb9671c accept a global option to force locally installed cypress into global mode (#890) 2017-11-08 17:38:27 -05:00
Gleb Bahmutov
d217d0e9d2 cli: pass group and groupId flags, close #455 (#836)
* cli: pass group and groupId flags, close #455

* upgrade commander to latest

* latest command moved options in help below command

* update tests, make sure -v, --version and version work

* run test one more time
2017-10-27 13:18:21 -04:00
Brian Mann
fa8551793b fixes #661, accept --project for cypress open 2017-09-19 11:52:44 -04:00
Brian Mann
f2591f81b3 fixes #657, accept --headed option, remove undocumented --show-headless-gui 2017-09-17 14:56:50 -04:00
Gleb Bahmutov
dca50ee6ef Pass project option (#467)
* cli: pass --project path when starting

* cli: resolve --project path automatically
2017-09-13 23:49:43 -04:00