Commit Graph

21 Commits

Author SHA1 Message Date
Emily Rohrbough
2324d703c2 chore(server): remove redundant supportFile check (#23543)
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2022-08-29 10:21:58 -05:00
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
Brian Mann
923ab0a9ba export additional properties on error, update refs, fix tests 2022-02-15 02:03:14 -05:00
Tim Griesser
678bedeca6 Merge branch 'develop' into 10.0-release
* develop:
  feat: gray out the path to system node in cypress run header (#20121)
  feat: redesign server errors (#20072)
  test: fix awesome-typescript-loader test and remove test-binary job (#20131)
  fix: Fix issues with stack traces and command log in Chrome 99 (#20049)
  fix: `cy.type(' ')` fires click event on button-like elements. (#20067)
  fix: `change`, `input` events are not fired when the same option is selected again. (#19623)
  build: publish vue3 on latest (#20099)
  chore: release @cypress/webpack-preprocessor-v5.11.1
  chore: release @cypress/webpack-dev-server-v1.8.1
  fix: detect newly added specs in dev-server compilation (#17950)
  chore: Remove pkg/driver //@ts-nocheck part 3 (#19837)
  chore: set up semantic-pull-request GitHub Action (#20091)
  chore: release @cypress/react-v5.12.2
  fix: remove nullish coalescing in js files to support node 12 (#20094)
  docs: update @cypress/webpack-preprocessor links (#19902)
  refactor: use aliases instead of meta (#19566)
2022-02-13 15:36:48 -05: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
Zach Bloomquist
815fe3d913 fix: pass correct spec URL in cypress run on Windows (#19890)
Co-authored-by: Barthélémy Ledoux <bart@cypress.io>
2022-01-31 17:52:14 +00:00
Lachlan Miller
721e586625 feat: use unified app for run mode (#19625)
* start graphql server in run mode

* update url logic

* use correct mobx instance

* expose util method for testing selector playground

* add __Cypress__ global

* correctly order aut lifecycle methods

* correct spec url in tests

* fix server integration tests

* add title to html

* update url encoding

* uni test

* encoding

* encode ssr data as base64

* set correct cypress.spec.name

* set arch and os options

* add version to options

* update config test

* update encoding

* temp skip

* more skips

* try to fix launchpad tests

* update test

* update runner

* feat: automation

* ignore error

* remove unused runner steps

* try remove error

* config

* Ensuring a provided testId gets rendered on a consistent element reference within HeaderBar.

* better conditionals

* automation connection

* try applying firefox cdp automation

* skip spec

* skip for now

* skips

* respond to failed visit event correctly

* chore: fix screenshot system tests (#19686)

* set fake  __CYPRESS_MODE__ on window

* vue logic for screenshot + run-mode checks

* Restore AUT wrapper div, make the name more clear

* switch to await for `before:screenshot` event send

* remove skipped tests

* add CYPRESS_INTERNAL_MODE to env

* move logic into component

Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>

* do not run runner-shared tests anymore

* dont care about runner unit test

* add reference screenshots confirmed to be good

* fix rerun spec

* do not hardcode http protocol, remove old code

* revert protocol and add missing pre-fetch gql query

* correctly pass ssr data, update request policy

* automation element updates

* do not apply CDP automation for firefox

* make assertions more debug-friendly

* up timeout, make firefox pixels slightly looser on CI

* Fix TS

* Try to fix tests

* Try to fix tests

* do not require urql for run mode

* wip: request policy changes

* use separate component for run mode and open mode

* expose selector playground function globally for testing purposes

* fix typescript

* fixing unit tests

* encode ssr data to match production

* fix test

* fix test

* readme

* fix: Run mode for unified runner resolve conflicts (#19743)

* merge in 10.0-release

* Fix merge conflict with client route

* Fail earlier when trying to run cypress in cypress in a browser other than chrome

* Fix some tests

* Set empty obj if config is not set

* Update tests

Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* update automation namespace, remove old code

* remove skipped test

* handle non proxied case

* clean up code

* revert png

* do not start graphql server in run mode

* Fix ts error

* revert type.cy.js to original test

* revert change in driver screenshot

* remove unused async

* remove unused env var

* remove old todo comment

* remove needless console.log

* unskip test

* use pause: true to avoid gql request

* remove unused automation element

* remove unused setAutomationStatus method

* change pane -> panel

* reimplement 1px flake fix for firefox type.cy.js

* chore: remove launchpad environment variable (#19778)

* remove LAUNCHPAD conditionals

* add timeout to test

* revert file

* correctly normalize url

Co-authored-by: Tyler Biethman <tbiethman@gmail.com>
Co-authored-by: Mark Noonan <oddlyaromatic@gmail.com>
Co-authored-by: Mark Noonan <mark@cypress.io>
Co-authored-by: Alejandro Estrada <estrada9166@gmail.com>
Co-authored-by: estrada9166 <estrada9166@hotmail.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
2022-01-20 15:02:00 +10:00
Lachlan Miller
792980ac12 feat: support specPattern, deprecate integrationFolder and componentFolder (#19319)
* use new specPattern API

* remove projectApi.findSpecs

* do not require integration folder

* support --spec

* support --spec

* remove old code

* remove old code

* nuke old code

* no appvetor

* update

* correct url for ct

* work on migrating launchpad

* update ct spec url

* types

* types

* dead code

* remove old endpiont

* revert back circle.yml

* update missing config

* delete spec util

* update config

* update config

* config again

* update spec pattern

* updated vue config

* update spec pattern for ui components

* update config for vite dev server

* update snapshots

* update config

* update design system config

* fix spec pattern in reporter

* update default

* update deprecated spec snapshots

* update system tests

* update run mode output

* revert changes

* lint

* remove scaffold tests

* update angular

* fix CT

* update circle yml

* fix system tests for ct

* fix tests

* work on server unit tests

* patch package

* patch package again

* update test

* try not to rely on config async loading too much

* normalize specPattern to array

* update snapshot

* use base name

* deal with react-scripts later

* update snapshot

* hacky way to update snapshots

* new hack to update snapshots

* trying again

* hacky fix

* ci: snapshots

* ci: snapshots

* snapshots

* mas updates

* update spec API

* fix test

* fix test

* update

* update test

* fix test

* update plugin

* update spec

* webpack optinos

* Update launchpad tests

* fix screenshot paths

* updated snapshot

* change pattern

* guard

* fix smoke test

* patch code coverage

* update percy config

* fix specs

* try updating example project

* update snapshots

* remove old test

* remove snapshot hack

* add back appveyor

* remove old code

* update snapshot

* Fix tests

* wip

* revert snapshot

* reverted all snaps

* remove only

* remove commnet

* remove old code

* reverted file

* lint

* revert video compression spec

* update snapshot

* update spec path logic

* update snap

* updated snap

* snaps

* snaps

* fix spec

* rename ignoreTestFiles to ignoreSpecPattern

* update screenshot dir for runner-ct

* update deprecations

* update

* upate

* fix test

* update snaps

* update snap

* updating snap

* added missing snaps

* updated cypress run mode integration spec

* electron snapshot

* ensure newly scaffold specs are cached

* fix launchpad spec

* types

* update test

* transpile based on spec pattern

* add back example

* remove unnecessary async and nodeVersion

* removed old test

* update spec pattern and add defensive check around platform

* remove unused feature flag

* added tests

* fix react example

* update test

* update config

* fix spec finding in run mode

* fix tests

* fixing specs

* fix switching between specs

* remove invalid test

* increase timeout

Co-authored-by: estrada9166 <estrada9166@hotmail.com>
2022-01-04 14:24:24 +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
9d975ec81e refactor: makeLegacyContext -> getCtx (#19308)
* refactor: makeLegacyContext -> getCtx

* Fix tests & types

* fix: failing tests

* CI fixes
2021-12-09 10:56:31 +10:00
Barthélémy Ledoux
33233e97a0 fix: various Nav Bar fixes (#19283)
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
Co-authored-by: Zachary Williams <ZachJW34@gmail.com>
2021-12-08 11:17:38 -06:00
Zachary Williams
a4bec4a8a3 feat: switch browser runner (#19048)
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
2021-11-24 11:57:25 -06:00
Lachlan Miller
ded63adeb2 feat(app): remove __vite__ route and default to unified runner (#18909)
Co-authored-by: Mark Noonan <mark@cypress.io>
2021-11-15 12:32:10 -05:00
Alejandro Estrada
081dd19cc6 feat: Use .config files (#18578)
Co-authored-by: Tim Griesser <tgriesser10@gmail.com>
2021-11-02 10:24:39 -04:00
Lachlan Miller
db3e7b3aab chore: merge in develop to unified-desktop-gui (#18388)
* chore: merge in develop

* fix types
2021-10-07 17:29:14 +10:00
Barthélémy Ledoux
07d4340ce5 feat: allow cypress.config.js to be a default config file (#18221)
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2021-09-29 14:34:01 -05:00
Lachlan Miller
a27793ddda improve types 2021-08-31 10:41:53 +10:00
Lachlan Miller
633c91b366 fix unit tests 2021-08-24 14:29:56 +10:00
Lachlan Miller
0d66d79152 launch browser 2021-08-24 12:39:24 +10:00
Lachlan Miller
f02cc75b11 change open_project to TS and define some interfaces 2021-08-23 17:23:50 +10:00
Lachlan Miller
b945b8197e chore(server): reduce coupling between methods to instantiate a project (#17200)
* wip

* wip: use async/await

* slowly refactor

* slowly refactor

* use typescript

* use async/await

* update spec

* do not use tap because bluebird sucks

* refactor

* update

* remove bluebird

* update

* remove then

* change to async/await to make it easier to reason about

* remove more bluebird

* no more bluebird

* remov ts ignore

* do not tap

* refactor

* simplify cfg

* move static methods to separate file

* update snapshot

* comment out test

* simplifying options merging

* update tests

* change order of options

* move code out of project-base

* update tests

* update tests

* type reporter

* simplify onWatchSettings function

* sep starting websockets and watching settings. reduce need to pass large cfg object

* move util functions out of project class

* move tests to new file

* update test

* move code around

* update tests

* remove need to pass options to getConfig

* fix tests

* separate get and init config

* set browser warnings in initializeConfig

* move Ct specific concerns to same function

* do not pass config to initializeSpecStore

* remove onOpen function

* improve types

* update typing errors

* update types

* types

* fix types

* update tests

* update tests

* fix tests

* update tests

* comment back in test

* update methods

* update types

* add defensive code against config.clientRoute

* do not use async

* update tests

* use same baseUrl for proxy regardless

* remove comment

* revert change to baseUrl
2021-07-13 11:32:59 +10:00