Commit Graph

932 Commits

Author SHA1 Message Date
David Munechika
047aefc4ba fix: error regression - unexpected ANSI color chars shown on Firefox warning message about chromeWebSecurity (#20512) 2022-03-08 08:32:16 -05:00
Tyler Biethman
5a30e76819 fix: Prepare for Chrome's update for immutable document.domain (#20405)
* Setting response header for origin-agent-cluster for runner, iframes, and proxied requests that have domain injection

* Adding comments around header injection

* Adding unit tests
2022-03-04 10:46:23 -06:00
Brian Mann
e0bd6ac2aa fix: error regression - strip ansi colors out of cy.fixture() error message (#20335)
* fix cy.fixture regression - strip ansi colors out of fixture error message

* empty commit to appease the semantic release gods

* fix 2nd regression formatting when setting invalid config values - remove extra backtick

* increase webpack dev server timeout values
2022-02-28 12:01:54 -05:00
Ryan Manuel
65ea8f73e4 chore: fix server performance flake (#20271) 2022-02-18 17:57:34 -06:00
Johannes Ewald
ad50062ca2 fix: Wait for child process to be ready (#19792)
Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Zach Bloomquist <git@chary.us>
2022-02-17 18:21:08 +00:00
Brian Mann
29841f32b9 feat: redesign server errors (#20072)
* chore: rename errors.js -> errors.ts

* refactor: type safety on errors

* refactor: add err_template for consistent error formatting

* fix a few system tests

* fix tests; update snapshots

* Fix types

* normalize snapshot - remove chalk ansi colors

* more unit test fixes

* more system test fixes

* circleci build

* backtick always in stdout, fix error formatting and failing snapshots

* refactor: create @packages/errors

* fix import

* fix import

* fixing build / tests

* remove extraneous file

* move warnIfExplicitCiBuildId

* fix build / tests

* Fix

* error, type fixes, documentation, standardize child process error serialization

* fix import

* build errors on install

* wrote specs generating visual images of all errors

* remove unused dep

* sanitize stack traces

* add image diffing

- if base images don't exist, create them
- if base images don't match and local, overwrite them, if in CI throw
- if base images are stale and local, delete them, if in CI throw

* remove Courier New + MesloLGS NF font

* type fixes, remove Bluebird, general cleanup

* TS Cleanup

* skip typecheck on tests for now

* yarn.lock

* fix @types/chai version

* fix yarn.lock

* Different version of mocha types so it isnt patched

* errors spec snapshot

* CI fix

* fixes

* store snapshot images in circle artifacts

* dont change artifact destination prefix

* use Courier Prime

* antialias the text

* decrease pixelmatch threshold, fail in CI only when changed pixels > 100

* increase timeout

* overflow: hidden, remove new Promise, add debug logging

Co-Authored-By: Tim Griesser <tgriesser@gmail.com>

* run unit tests w/ concurrency=1

* unique window per file

* disable app hardware acceleration + use in process gpu + single process

* do not do image diffing

- conditionally convert html to images
- store html snapshots
- do not store images in git

* store snapshot html

* Merge branch 'tgriesser/chore/refactor-errors' of https://github.com/cypress-io/cypress into tgriesser/chore/refactor-errors

* remove concurrency

* fix assertion

* fixing ci

* Link in readme

* pass the browsers to listItems

* fix: build @packages/errors in CI, defer import to prevent errors locally

* Merge branch 'develop' into tgriesser/chore/refactor-errors

* develop:
  chore: fix cypress npm package artifact upload path (#20023)
  chore(driver): move cy.within logic into it's own file (#20036)
  chore: update automerge workflows (#19982)
  fix(selectFile): use target window's File/DataTransfer classes (#20003)
  chore: Update Chrome (stable) to 98.0.4758.80 and Chrome (beta) to 98.0.4758.80 (#19995)
  fix: Adjust ffmpeg CLI args for performance (#19983)
  build: allow unified to run cypress on Apple Silicon (arm64) (backport #19067 to 9.x) (#19968)

* fix run-if-ci.sh

* remove dead code

* Mark the .html files as generated in gitattributes

* fix running single error case, slice out more of the brittle stack

* remove additional brittle stack line

* firefox web security error

* nest inside of describe

* reformat and redesign errors

* more error cleanup and standardization

* additional formatting of errors, code cleanup, refactoring

* update ansi colors to match terminal colors

* cleanup remaining loose ends, update several errors, compact excess formatters

* fix types

* additional formatting, remove TODO's, ensure no [object Object] in output

* add test for 412 server response on invalid schema

* update unknown dashboard error on creating run

* use fs.access instead of fs.stat for perf

* added PLUGINS_FILE_NOT_FOUND error

- separated out from PLUGINS_FILE_ERROR
- add system tests for both cases
- update snapshots
- remove stack trace from PLUGINS_FILE_NOT_FOUND fka PLUGINS_FILE_ERROR

* add plugins system test around plugins synchronously throwing on require

* remove forcing process.cwd() to be packages/server, update affected code

- this was a long needed hangover from very old code that was doing unnecessary things due to respawning electron from node and handling various entrypoints into booting cypress
- this also makes the root yarn dev and dev-debug work correctly because options.cwd is set correctly now

* perf: lazy load chalk

* remove excessive line since the file exists but is invalid

* fix types

* add system test when plugins function throws a synchronous error

* create new PLUGINS_INVALID_EVENT_ERROR, wire it up correctly for error template use

- properly pass error instance from child to ensure proper user stack frames
- move error display code into the right place

* only show a single stack trace, either originalError or internal cypressError

* push error html snapshots

* fix tests, types

* fix test

* fix failing tests

* fix tests

* fixes lots of broken tests

* more test fixes

* fixes more tests

* fix type checking

* wip: consistent handling of interpolated values

* feat: fixing up errors, added simple error comparison tool

* wrapping up error formatting

* Fixes for unit tests

* fix PLUGINS_VALIDATION_ERROR

* fix fs.readdir bug, show rows even if there's only markdown formatting [SKIP CI]

* when in base-list, show full width of errors

* Fix type errors

* added searching and filtering for files based on error name

* fix: system tests

* updated NO_SPECS_FOUND error to properly join searched folder + pattern

- join patterns off of process.cwd, not projectRoot
- highlight original specPattern in yellow, baseDir in blue
- add tests

* fixes failing tests

* fix test

* preserve original spec pattern, display relative to projectRoot for terminal banner

* make the nodeVersion path display in gray, not white

* fix tests, pass right variables

* fix chrome:canary snapshots

* update snapshots

* update snapshot

* strip newlines caused by "Still waiting to connect to {browser}..."

* don't remove the snapshotHtmlFolder in CI, add additional verification snapshots match to error keys symmetrically

* update snapshot

* update snapshot

* update snapshot

* update snapshot

* update snapshot

* update snapshot

* update gitignore

* fix snapshot

* update snapshot html

* update logic for parsing the resolve pattern matching, add tests

* update snapshots

* update snapshot

* update snapshot

* update snapshot

* fix failing test

* fix: error_message_spec

* fix snapshot

* run each variant through an it(...) so multiple failures are received

* add newlines to multiline formatters, add fmt.stringify, allow format overrides

* stringify invalid return values from plugins

* move config validation errors into packages/errors, properly highlight and stringify values

* add component testing yarn commands

* fix the arrow not showing on details

* fix typescript error

* fixed lots of poorly written tests that weren't actually testing anything. created settings validation error when given a string validation result.

* fixes tests

* fixes tests, adds new error template for validating within an array list (for browser validation)

* remove dupe line

* fix copy for consistency, update snapshots

* remove redundant errors, standardize formatting and phrasing

* more formatting

* remove excess snapshots

* prune out excessive error snapshot html files when not in CI

* add missing tests, add case for when config validation fails without a fileType

* fixes test

* update snapshot

* update snapshot

* update snapshot

* sort uniqErrors + errorKeys prior to assertion - assert one by one

* add system test for binding to an event with the wrong handler

* fixes tests

* set more descriptive errors when setting invalid plugin events, or during plugin event validation

* remove duplicate PLUGINS_EVENT_ERROR, collapse into existing error

* use the same multiline formatting as @packages/errors

* standardize verbiage and highlighting for consistency

* fix incorrect error path

* fixes tests, standardized and condensed more language

* Update packages/errors/src/errors.ts

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* Update guides/error-handling.md

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* Update guides/error-handling.md

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* added some final todo's

* fix types

Co-authored-by: Tim Griesser <tgriesser10@gmail.com>
Co-authored-by: Tim Griesser <tgriesser@gmail.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
2022-02-11 02:06:07 -05:00
Blue F
2c1ecabf7d fix: Adjust ffmpeg CLI args for performance (#19983)
* Adjust ffmpeg CLI args for performance

* Properly use and clean up metadata file

* Always limit encoder to 1 thread regardless of os.cpu count

* Typo in last commit

* Add comments to ffmpeg args

* Remove threads arg, back to original threading behavior
2022-02-02 07:37:32 -08:00
Emily Rohrbough
99f24863a2 fix: move node 17 Check from Binary to CLI (#19977) 2022-01-31 12:03:36 -06:00
Tyler Biethman
1f70b21bc4 fix: Correctly parse single --spec globs containing a range (#19789) 2022-01-21 13:12:43 -06:00
Chris Breiding
edb4642328 chore: Use @typescript-eslint/indent instead of eslint's indent (#19772) 2022-01-19 13:38:16 -05:00
Rob
273b7035b0 fix: CLI filtering --spec when commas in glob pattern (#19557)
* Added is-glob as dependency for packages/server

* Parsed spec argv for glob patterns.

* Removed setGlob parameter.

* Updated glob implementation to revert side effects

* Removed is-glob dependency.

* Wrote parseSpecArgv method

* Added back resolvePath.

* Added unit tests.

* Added jsdoc & comments.

* pushing trivial update to kick off build

Co-authored-by: Matt Henkes <mjhenkes@gmail.com>
2022-01-18 09:10:07 -08:00
Matt Schile
642ec41406 fix: retrieve 'exit' from config instead of options (#19567) 2022-01-06 14:26:03 -07:00
Aku Kotkavuo
59e42afd23 fix: Improve heuristic for --openssl-legacy-provider (#19320) (#19522)
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
2022-01-06 14:42:18 -06:00
Emily Rohrbough
a81fa26c89 fix: surface openSSL unhandled rejection errors that occur within plugin code (#19553)
Co-authored-by: Matt Henkes <mjhenkes@gmail.com>
2022-01-05 16:53:19 -06:00
Emily Rohrbough
8e23567d5b fix(cy.intercept): allow fixtures to define null encoding when used in static response (#19379) 2021-12-16 16:44:01 -06:00
Alejandro Estrada
f79bdd665a fix: close chrome when closing electron (#19322) 2021-12-09 21:12:47 +00:00
Zach Bloomquist
65cf6e899d fix: disable automatic request retries (#19161) 2021-12-08 22:27:19 +00:00
Blue F
6b19381f79 fix: Add support for system node 17 (#19094) 2021-12-02 09:36:58 -08:00
Zach Bloomquist
71d92e0e49 test: node_modules installs for system-tests, other improvements (#18574)
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
2021-11-24 20:10:28 +00:00
David Munechika
de4fca351b feat: Set CYPRESS=true as env var in child processes where Cypress runs user code in Node (#18981) 2021-11-22 08:39:42 -06:00
Kukhyeon Heo
2a6ded2352 chore: Update TypeScript to 4.4.4 (#18930) 2021-11-19 10:01:23 -05:00
Blue F
81626870bf fix: Loading of specs with % in the filename (#18877) 2021-11-17 08:27:40 -08:00
David Munechika
941cef10a0 fix: flaky system-tests-firefox job (#18848)
Co-authored-by: Zach Bloomquist <github@chary.us>
2021-11-15 08:44:03 -06:00
Emily Rohrbough
99c8d466c8 feat: create config package for config validation (#18589) 2021-11-09 13:19:05 -06: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
Jennifer Shehane
0273f3ebae Merge branch 'develop' into 9.0-release 2021-11-01 11:58:55 -06:00
Tim Griesser
c0d781d28f refactor: remove Ramda (#18723) 2021-11-01 13:37:33 -04:00
Emily Rohrbough
e396956534 feat: remove windows 32-bit support (#18630)
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Zach Bloomquist <git@chary.us>
2021-10-29 08:54:02 -05:00
BlueWinds
96aaac37f1 Merge remote-tracking branch 'origin/develop' into issue-1558-null-encoding-for-binary-files 2021-10-25 12:18:38 -07:00
Blue F
776b7301fd feat: Add 'slowTestThreshold' and fix this.slow() inside specs (#18496)
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2021-10-25 14:49:32 -04:00
BlueWinds
14ab9ecd02 Simplification based on review comments 2021-10-25 11:31:29 -07:00
Emily Rohrbough
252be9e26e chore(server): align test folder structure to src folder structure (#18597) 2021-10-25 09:41:03 -05:00
David Munechika
a51ea0c618 fix: Electron video not playable in Firefox/Safari browsers or Quicktime player (#18530)
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
2021-10-20 11:53:14 -04:00
BlueWinds
5a9c52ca5f Once more with feeling 2021-10-19 15:41:44 -07:00
BlueWinds
6943186887 More attempts to get fixtures working properly 2021-10-19 15:14:48 -07:00
BlueWinds
798755813f Add 'null' encoding for fixtures, comment code more 2021-10-19 11:59:08 -07:00
Jessica Sachs
a045e4f59a chore: move server e2e tests to system-tests (#16354)
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Zach Bloomquist <git@chary.us>
Co-authored-by: Zach Bloomquist <github@chary.us>
2021-10-18 19:53:14 +00:00
BlueWinds
2e52a2b68c Allow explicit null encoding for readFile/writeFile 2021-10-18 12:10:02 -07:00
Blue F
f4fee905e7 Merge pull request #18445 from cypress-io/local-server-integration-test-fix
fix: server cypress_spec permissions test now passes
2021-10-14 15:03:10 -07:00
Blue F
d51779308f Update packages/server/lib/scaffold.js
Co-authored-by: Zach Bloomquist <github@chary.us>
2021-10-14 09:51:35 -07:00
Barthélémy Ledoux
83a1f09b11 fix: warn when the projectRoot is not writeable (#18495)
closes #18485
2021-10-14 11:26:49 -05:00
Kukhyeon Heo
af472b6419 fix: revive type checker (#18172)
Co-authored-by: Zach Bloomquist <github@chary.us>
2021-10-13 23:51:38 +00:00
BlueWinds
0d5ff9b9c6 Fix cypress_spec to run permissions test locally 2021-10-11 16:19:38 -07:00
David Munechika
1d08280f4a fix(driver): cy.pause() should not be ignored with cypress run --headed --no-exit (#18358) 2021-10-08 21:17:34 +00:00
Tim Griesser
32464f3b5b fix: remove .json check from require_async, prevent child_process spawn (#18416) 2021-10-08 14:15:27 -04:00
David Munechika
9265669a7e fix: everyNthFrame should only be applied for Chrome 89+ (#18392)
Co-authored-by: Zach Bloomquist <github@chary.us>
2021-10-08 10:28:14 -04:00
Lachlan Miller
d857e7fe42 chore(server): share client route (#18215) 2021-10-06 10:05:44 +10:00
David Munechika
56928c8ca0 fix: Prevent Cypress from crashing when argument parsing "spec: {}" (#18312) 2021-10-05 13:31:27 -04:00
Barthélémy Ledoux
b4996ff148 feat: allow to use TypeScript in the config file (#18300)
* feat: allow to use typescritpt in the config file

* add end to end test

* test: add test for the default config file ts

* tests: add a tests for language conflict

* fix: only compile typescript if main file is ts

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

Co-authored-by: Zach Bloomquist <github@chary.us>
2021-10-02 09:15:21 -05:00
David Munechika
0e7d882a53 feat(driver): Add "overwrite" option to cy.screenshot() (#18280)
Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2021-09-30 11:26:59 -04:00