Commit Graph

101 Commits

Author SHA1 Message Date
Zachary Williams
110f8ae02d fix: remove --config-file false references and update types (#20643)
* fix: remove --config-file false references and update types

* cleanup tests and types, catch errors when calling open

* fix test

* remove string check

* code quality feedback
2022-03-21 22:49:14 +10:00
Lachlan Miller
76129e26af merge in develop to 10.0-release 2022-03-07 10:44:26 +10:00
Tim Griesser
4626f7481c feat: ProjectLifecycleManager & general launchpad cleanup (#19347)
See #19347 for full summary

Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
Co-authored-by: estrada9166 <estrada9166@hotmail.com>
Co-authored-by: Alejandro Estrada <estrada9166@gmail.com>
Co-authored-by: Jess <jess@jessicasachs.io>
2021-12-21 21:28:44 -05:00
Tim Griesser
806a31a989 refactor: Improved support for e2e testing (#19306) 2021-12-09 21:23:58 -05:00
Tim Griesser
7c339d41c8 Merge branch 'develop' into 10.0-release
* develop: (52 commits)
  feat: use hoisted yarn install in binary build (#17285)
  fix: compile npm packages for node 12 (#18989)
  fix: show call count even if `cy.stub().log(false)`. (#18907)
  chore: Update TypeScript to 4.4.4 (#18930)
  fix: wrap playground selectors in double quotes if not included (#18442)
  fix: flaky settings_spec test (#18979)
  chore: Update Chrome (stable) to 96.0.4664.45 (#18931)
  fix: Loading of specs with % in the filename (#18877)
  chore: refactor `create` into class `$Cy` (#18715)
  chore: Update Chrome (beta) to 96.0.4664.45 (#18891)
  fix: flaky `system-tests-firefox` job (#18848)
  chore: release @cypress/webpack-preprocessor-v5.10.0
  chore: release @cypress/vue-v3.0.5
  chore: release @cypress/schematic-v1.6.0
  chore: release create-cypress-tests-v1.2.0
  release 9.0.0
  feat: ensure major release
  have conduit app wait on localhost:3000
  fix install-required-node
  use --legacy-peer-deps
  ...
2021-11-20 16:03:53 -05:00
Blue F
f967908704 fix: Exit when both --e2e and --component flags are passed in (#18855)
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2021-11-12 09:15:10 -08:00
Matt Henkes
82429c0027 feat: Defaulting nodeVersion to system (#18732)
* Defaulting nodeVersion to system

* try to fix system test

* Rename arg parameters, fix system test in a much better way.

* remove invalid comment

* Add deprecation warning for the nodeVersion config.

* Remove default value to avoid warning regardless of the presence of `nodeVersion`

* More tests fixes 😅

* Updates to deprecation message

* update node version in deprecation notice.

* flex config file name that we tell consumers to update

* simplify validateNoBreakingConfig options
2021-11-04 11:45:25 -07:00
Tim Griesser
6a9f5a1a41 Merge branch 'develop' into unified-desktop-gui
* develop: (40 commits)
  fix(driver): Sticky elements within a fixed container will not prevent an element from being scrolled to (#18441)
  chore: make `create` function on server.ts obsolete (#18615)
  docs: Add instructions to squash commits to develop in Contributing (#18728)
  fix(@cypress/react): throw if using Next.js swc-loader without nodeVersion=system (#18686)
  refactor: remove Ramda (#18723)
  chore: Increase paralleled machines for desktop-gui tests (#18725)
  chore: Update Chrome (stable) to 95.0.4638.69 (#18696)
  chore: release @cypress/vue-v3.0.4
  chore: release @cypress/react-v5.10.2
  chore: release @cypress/schematic-v1.5.3
  fix: remove outdated registry link (#18710)
  chore: release @cypress/schematic-v1.5.2
  chore: release create-cypress-tests-v1.1.3
  chore: Update Chrome (beta) to 96.0.4664.27 (#18676)
  chore(tests): Remove flaky assertion that relies on png how compression (#18668)
  fix: make sure to go back to no-specs when delete spec file (#17760)
  fix: Next.JS 12 components testing failing with ` TypeError: Cannot read property 'traceChild' of undefined` (#18648)
  Backport .gitignore from unified-desktop-gui
  chore(docs): add 'Upgrading Electron' instructions (#18594)
  release 8.7.0 [skip ci]
  ...
2021-11-02 21:35:26 -04:00
Tim Griesser
c0d781d28f refactor: remove Ramda (#18723) 2021-11-01 13:37:33 -04:00
BlueWinds
e7d6e6db82 Add shorter --ct alias for --component 2021-10-07 10:25:57 -07:00
BlueWinds
e01d3acfe8 Add --e2e and --component CLI options 2021-10-07 10:25:46 -07:00
Tim Griesser
c200e95e14 chore: unify e2e tests launchpad (#18314) 2021-09-30 16:50:39 -04:00
Jessica Sachs
d39b1694aa feat: improved DX and support for running component and e2e tests w/ gulp (#18135)
Co-authored-by: Tim Griesser <tgriesser10@gmail.com>
2021-09-30 12:11:47 -04:00
Tim Griesser
94541d4f18 feat: merging / delegating remote queries to cloud schema (#17875)
Changes:
- Pulls down & stitches in the "Cypress Cloud" schema from remote. Currently defaulted to "staging" so we can make quick fixes / iteration there
- Add dedicated type checking CircleCI job `check-ts`
- Adds [graphcache](https://formidable.com/open-source/urql/docs/graphcache/) to normalize the cache & provide better auto-reactivity when data changes
- Removes `LocalProject` / `DashboardProject` in favor of `Project` / `CloudProject`
- General cleanup of Vue components' GraphQL fragments
- Parallelizes launchpad tests & recording to new Cypress project: https://dashboard.cypress.io/projects/sehy69/runs
  - Did this b/c tests were frequently timing out, need to figure out the source of this
- Basic mocks for remote schema
2021-09-20 17:12:59 -04:00
Tim Griesser
a851d797a8 feat: improved DX for unified-desktop-gui (#18099)
- Moves graphql-codegen config to the root, which will serve all packages needing it
- Adds gulpfile for coordinating scripts related to dev environment in launchpad app
- yarn dev from the root runs yarn gulp dev, which:
  Runs autobarrel for rolling up the @packages/graphql files
  Cleans the dist & cache for .vite
  Starts the a codegen watcher for Nexus
  Starts the graphql-codegen --watch & highlights output
  Starts vite servers for launchpad & app
  Starts electron watch.js
2021-09-15 11:54:14 -04:00
mrmeku
cf689dd609 feat: Support running cypress as node process (#16505) (#16537)
Co-authored-by: Ben Alman <cowboy@rj3.net>
2021-07-09 09:38:28 -05:00
Adam Gastineau
b8527a2a7f feat(component-testing): Expose CT through CLI module API (#16368)
* Added testingType CLI module option

* Removed isComponentTesting custom arg and replaced with testingType

* Added default value to docstring

* Removed mutating of args

* Added Module API manual testing docs
2021-05-07 12:44:15 -04:00
Jessica Sachs
8d0829fb26 feat: adding electron support for cypress component testing (#15731) 2021-04-01 18:15:20 -04: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
Jennifer Shehane
bb0d98d3c6 Merge branch 'develop' into v6.0-release 2020-11-17 22:38:39 +06:30
Gleb Bahmutov
84d1afd27d feat: print bundled Node and Electron versions in cypress version (#9183) 2020-11-16 13:17:24 -05:00
Jennifer Shehane
3a8d9e62d4 chore: Remove code around deprecated APIs (#8951) 2020-10-27 00:45:19 +06:30
Gleb Bahmutov
653739bb5c Handle --project "" command line argument (#7744)
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2020-06-22 14:34:59 -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
Zach Bloomquist
47410d50e5 Fix "Parse Error" when performing HTTP requests (#5988)
* Detect if NODE_OPTIONS are present in binary; if not, respawn

* Always reset NODE_OPTIONS, even if no ORIGINAL_

Co-authored-by: Andrew Smith <andrew@andrew.codes>

* Exit with correct code # from stub process

* Clean up based on Brian's feedback

* how process.versions is null, i have no idea, but it is

* add repro for invalid header char

* Always pass NODE_OPTIONS with max-http-header-size (#5452)

* cli: set NODE_OPTIONS=--max-http-header-size=1024*1024 on spawn

* electron: remove redundant max-http-header-size

* server: add useCli option to make e2e tests go thru cli

* server: add test for XHR with body > 100kb via CLI

* clean up conditional

* cli: don't pass --max-http-header-size in dev w node < 11.10

* add original_node_options to restore o.g. user node_options

* force no color

* Revert "Use websockets to stub large XHR response bodies instead of hea… (#5525)"

This reverts commit 249db45363.

* fix yarn.lock

* update 4_xhr_spec snapshot

* make 6_visit_spec reproduce invalid header char error

* pass --http-parser=legacy

* still set headers if an ERR_INVALID_CHAR is raised

* add --http-parser=legacy in some more places

* update http_requests_spec

* readd spawn_spec

* improve debug logging

* remove unnecessary changes

* cleanup

* revert yarn.lock to develop

* use cp.spawn, not cp.fork

to work around the Electron patch: 39baf68790/patches/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch

Co-authored-by: Andrew Smith <andrew@andrew.codes>
2020-03-18 17:26:22 -04:00
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
Gleb Bahmutov
9ac5fe3935 add unit test for xvfb options -screen 2020-01-22 12:41:14 -05:00
Lukas Weber
ee0d6fac91 fix: set explicit screen when spawning own xvfb (#6199)
fixes `cypress verify` crashes on Ubuntu 18
2020-01-22 12:35:08 -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
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
370eb6ab0f pass -- as an argument from CLI to Electron application to avoi… (#5853)
* if cypress gets -- as leading argument, remove it

* start Eletron app args with --

* remove only

* update CLI to pass --no-sandbox before -- separator

* remove -- from args in cypress server

* do not use --no-sandbox in CLI when running in dev mode
2019-12-04 10:13:55 -05:00
Gleb Bahmutov
64f5bf0870 catch child process killed with a signal (#5810)
* WIP: catch child process killed with a signal

* unit test getError

* we don't need custom exit code

* Update cli/lib/exec/spawn.js

Co-Authored-By: Zach Bloomquist <github@chary.us>

* Update cli/lib/errors.js

Co-Authored-By: Zach Bloomquist <github@chary.us>

* update snapshots with wording
2019-11-27 15:21:47 -05:00
Zach Bloomquist
73a76cc600 Revert "Always pass NODE_OPTIONS with max-http-header-size" (#5522)
This reverts commit 978d97ee6d.
2019-10-29 13:45:58 -04:00
Zach Bloomquist
978d97ee6d Always pass NODE_OPTIONS with max-http-header-size (#5452)
* cli: set NODE_OPTIONS=--max-http-header-size=1024*1024 on spawn

* electron: remove redundant max-http-header-size

* server: add useCli option to make e2e tests go thru cli

* server: add test for XHR with body > 100kb via CLI

* clean up conditional

* cli: don't pass --max-http-header-size in dev w node < 11.10

* add original_node_options to restore o.g. user node_options

* force no color
2019-10-25 16:59:35 -04:00
Zach Bloomquist
74a174bc82 Close CLI when exit event fires (#5413)
* Close CLI when exit event fires

* fix debugging for code and signal

* add test for exit before close

* template quotes -> single quotes

* resolveOn
2019-10-22 16:53:55 -04:00
Ben Kucera
653f52dc3c upgrade eslint-plugin-dev to 5.0.0 (#5382)
* upgrade eslint-plugin-dev to 5.0.0

* more [lint fixes]
2019-10-17 11:40:53 -04:00
Zach Bloomquist
ddf9707e6b Catch & ignore ENOTCONN errors when piping Cypress subprocess (#5293)
* Catch & ignore ENOTCONN errors when piping Cypress subprocess

* Update https-proxy-agent to point back to original repo
2019-10-07 20:19:03 +03: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
122a858607 add --no-sandbox to spawn (#5209)
* add --no-sandbox to spawn

* update tests to not require no-sandbox argument

* injecting test-runner:integration-tests for jobs that need to record to the dashboard

* add --no-sandbox positive test

* add comment
2019-09-26 14:58:41 -04:00
Gleb Bahmutov
084f25f092 cli: fix the STDIN pipe on Windows (#5045)
* cli: pipe stdin

* uggh, here is the actual change

* update cli unit tests

* add unit test
2019-09-19 13:49:57 -04:00
Gleb Bahmutov
cd8da7d5d6 fix: increase XVFB timeout from 5 seconds to 30 seconds 2019-09-10 08:33:07 -04:00
Jennifer Shehane
a7dfda9865 Show warning when binary is run directly (outside npm module) (#4701)
* commit previous changes made by @bahmutov for #1573

* Pass '--run-from-cli' flag through ping test in order to prevent warning from printing

* woops, require 'argsUntil'

* 'headed' was changed to 'interactiveMode'

* fix duplicate misspelled require

* tighten up args utils and cleanup decaf garbage

* cleanup errors.log to take a cb and conditionally be async

* remove extraneous --run-from-cli argument, consolidate to use --cli

- update tests

* fixes tests, ensure that record.createRun() always returns a promise

* refactor tests to handle new errors.logException interface

* make logException always return a promise, cleanup interface, add test

* fix linting errors


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-07-29 07:33:33 -04:00
Brian Mann
93b3edaab6 ignore garbage render worker errors coming from electron (#4644)
* ignore garbage render worker errors coming from electron

* add tests
2019-07-03 14:08:07 +02:00
Jennifer Shehane
cacd122c67 Fix mixed use of both XVFB and Xvfb to all be Xvfb (#4262) 2019-05-21 10:33:59 -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
Gleb Bahmutov
b21918921b move close too quick check into CLI (#4186) 2019-05-13 17:08:33 -04:00
Gleb Bahmutov
d25cfacc6f Automatically retry verify and run commands on Linux if suspect DISPLAY problem (#4165)
* cli: debug explanation for XVFB

* linting

* add chai-as-promised to CLI dev

* show Linux specific error solution if cannot verify

* add todo

* chore: consolidate github issue url logic

* linting

* add npm script lint-changed to quickly eslint fix changes JS files

* retry verify with our XVFB

* update errors and tests

* update CLI tests

* add test for display error message

* fix unit test

* add successful test with retry

* finish verify retry test

* warn users if hit display problem on first verify

* try to detect display problem when running electron and retry with our xvfb

* add warning message to spawn when attempting xvfb re-run

* add test for display retry behavior on spawn

* more comments for clarity

* fix typo
2019-05-13 15:19:53 -04:00