Commit Graph

57 Commits

Author SHA1 Message Date
Chris Breiding
383fa22f10 fix: Resolve tsconfig.json for plugins file from the plugins directory (#8377) 2020-08-24 17:02:26 -04:00
Ben Kucera
860a20af30 feat: support test retries (#3968)
* add retries e2e test

* restore runner/test/eslintrc

* use mocha pass event, move runner.spec to runner package

* fix .eslintignore

* remove npmInstall logic in helper/e2e script, force custom reporters to use our mocha

* temp 04/09/20 [skip ci]

* add retries output to server/reporter, fix mocha pass event order, cleanup

* e2e tests - dont run electron tests in other browsers

* Update readme to reflect how to start server for cypress tests

* fix after merge

* fix .coffee -> .js after merge

* fix attempt.tsx

* fix runnable titles emitted to terminal reporters

* fix more tests: update snapshots, fix 7_record_spec, 8_reporters_spec

* remove styling for 'attempt-error-region' so it's not indented

- This was the older styling before error improvements and is no longer
necessary.

* try 2: fix rerun before/after hooks

* fix runner with only, runner snapshots, lint fixes

* temp 04/29/20 [skip ci]

* backport changes from test-retries

* change logic to rerun before hooks after top navigation

* fix windowSize for browser e2e test

* fix windowSize for xvfb chrome in e2e test

* ok fine, just disable screenshots

* fix after merge: decaffed navigation.js

* update server/unit test snapshots

* fix after merge: decaffed aliases.js

* fix usage of cypress --parallel flag in circle.yml

* fix circle.yml integration-tests jobs

* fix decaf related typo

* fix circle.yml separate command for runner-integration-tests

* update runner/integration tests + snapshot after error improvements

* fix runner/integration snapshots for chrome/ff stacktrace differences

* rerun ci

* fix passing --parallel to runner-integration tests

* perf: faster lookup for hooks without runnables

* fix afterAll hook switch logic

* simplify mocha prototype patches

* fix decaf utils.coffee after merge

* backport to before/after fix

* backport to before/after fix 2

* cleanup from decaf, fix ui/package.json

* update helpers, simplify runner.spec

* fix lint-types errors, flaky spec

* fix noExit passed to e2e test inline options

* cleanup snapshot utility - refactor to use util file

* remove before/after changes

* make cy obj a class instance

* cleanup/unmerge before/after fixes PR...

* more cleanup

* add comment

* fix runner.spec

* cleanup snapshot utility more, cleanup reporter.spec

* fix after merge

* minor rename variable

* fix after merge: decaffed files

* fix specName in reporterHeader, spec_helper require

* replace reporter specPath usages with spec object from config

* cleanup, fix specs, fix types tests

* fix config spec paths in isolated runner, fix snapshot plugin button

* combine runner.spec.js and runner_spec.js

* fix incorrect merge

* minor minor cleanup

* rename driver/test/cypress to driver/test

* use yarn workspace over lerna for individual package commands

* add error message to driver start

* remove usage of wait-on

* update <reference types/>, import string

* fix driver/readme

* fix readmes after regex replace

* revert wait-on changes

* Revert "revert wait-on changes"

This reverts commit 6de684cf34.

* update yarn.lock

* fix broken path in spec

* fix broken paths in specs with @packages/driver

* move runner/test/cypress into runner/cypress

* start server in pluginsFile in runner/cypress tests

* fix more broken spec paths

* fix broken paths after runner/cypress folder move

* move type definition loading for driver/cypress into dedicated file

* move internal-types to "types" folder, fix driver/index.d.ts

* fix type-check in packages/runner. not exactly sure why

* fix runner type-check by excluding test folder in tsconfig

* bump timeout on e2e/8_error_ui_spec

* update snapshot utility, rename tests in runner/runner.spec, fix README yarn commands

* delete old spec

* fix snapshot naming, remove redundant test in reporter_spec

* fix file renames after merge

* rename runner/ snapshot

* update server/unit/reporter_spec snapshot

* update runner/runner_spec snapshot

* rename runner snapshot file

* address feedback: move server reporter snapshot specs out

* address feedback: add comment about exposing globals

* fix test-retries after merging isolated-runner

* fix runner/test helper, update snapshot

* address feedback: split out runner/retries spec, move reporter/ui tests to runner/ui spec (mostly done), various cleanup

* fix scrolling, attempt opening, update snapshots

* fix e2e support file

* fix 5_spec_isolation

* fix mislabeling attempt screenshots

* only add test results prevAttempts if exists

* fix reporter/unit tests, server/unit tests

* remove dead code, fix test isOpen

* update snapshots for retries.mochaEvents, fix snapshot error in state hydration test, remove dead snapshots

* new moduleAPI schema using attempts array, fix wrapping errors from hook retries, update snapshots

* add displayError, null out fields in moduleAPI schema

* change default retries to {runMode:2, openMode:0}

* fix reporter type-check

* upgrade json-schemas, update snapshots

* reformat error.stack to be only stacktrace, update snapshots

* fix stacktrace replacing in 5_spec_isolation

* fix navigation error causing infinite reloading, bump timeout on e2e/8_error_ui

* fix server/unit tests for new schema

* fix reporter/unit tests

* fix reporting duplicate screenshots using cy.screenshot during test retry

* update snapshot for 6_uncaught_support_file_spec

* bump x-route-version: 3

* fix test.tsx collapsible content, css, fix e2e/8_error_ui, e2e projects excluding retries

* fix css, fix padding in runnable-instruments, fix runner/integration tests

* fixup after merge

* fix reporter/runner to work with split hooks

* update api tests, runner/cypress tests, reporter

* fix 5_spec_isolation snapshots, fix runner/cypress errors.spec, fix null reference in test.tsx

* fix e2e/non_root spec, fix type_check, fix reporter/unit tests

* setup percy snapshots in runner/cypress, fix driver/runner test:after:run event, add tests for only,skip in runner/cypress, fix retried css

* add customPercySnapshot

* fix circle.yml

* fix circle.yml 2

* fix circle.yml 3

* add warning for incompatible retries plugin

* add more percy snapshots

* fix firefox screenshot resolution in e2e test

* Fix testConfigOverrides not affecting viewport (#8006)

* finish adding percy snapshots to runner/cypress retries spec, update error msgs, add tests to be fixed

* remove .only

* fixing missing repo argument

* fix testConfigOverrides usage with retries, fix test

* fix issues from previous merge

* add script that can query CircleCI workflow status

* add circleci job to poll

* add retries

* try yarn lock

* retry, percy finalize

* check for current running job

* do not swallow request error

* better print

* use job name from circle environment

* use debug instead

* renamed circle polling script

* refactor circle to conditionally run percy-finalize when env var is available

- pass job-names to wait on as an argument

* use multi-line strings and quote --job-names

- rename —circle-jobs to —job-names

* add comment

* only poll until the jobs to wait for are blocked or running

* fix running hooks at correct depth after attempt fails from hook and will retry, update e2e snapshots

* fix reporter/unit tests, remove unused toggleOpen code

* move custom percy command into @packages/ui-components and apply them to desktop-gui

* halt percy finalize job if env variable is not set

* if only I could code

* update runner/cypress mochaEvent snapshots, fix e2e firefox resolution

* fix css for attempt border-left, fix attempt-tag open/close icon, add color to attempt collapsible dot

* try percy set viewport width

* set default retries back to {runMode:0, openMode:0}

* formatting: add backticks to warning message

* write explicit test for screenshot overwriting behavior, fix snapshots after changing retries defaults

* fix e2e.it.only`

* cleanup whitespace

* update snapshots

* fix cypress module API types for new result schema

* build and upload binary for test-retries branch too (linux)

* add pre-release PR comment

* fix pre-release commit comment

* rename runner/cypress test

* update retries.ui.spec test titles

* fix after merge: use most recent attempt for before/after hooks

* add suite title to hook error in runner/cypress tests

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
2020-08-10 18:36:45 -04:00
Chris Breiding
daeab10e46 fix: Remove default esModuleInterop option from ts-node and preprocessor (#8143)
* make tests preprocessor agnostic

* update eslintignore

* put back deps needed for e2e test

* remove obselete snapshot

it was replaced by 1_typescript_support_spec.ts.js

* switch from browserify to webpack preprocessor

* cmon github

* fix/update tests

* bump preprocessor and update snapshots

* update snapshots

* bump preprocessor to gain json support

* fix e2e tests with webpack-originated errors

* bump preprocessor version, fix node globals

* update snapshot

* remove support for ? in file path

* bump preprocessor version

* bump preprocessor again

* bump preprocessor

* bump preprocessor

* update snapshots

* bump preprocessor version

* bump preprocessor, quiet the paths plugin

* add test verifying tsconfig paths work

* refactor registering ts-node

* separate spec/support file typescript tests from plugins file typescript tests

* fix unit tests

* fix: Remove esModuleInterop default from ts-node (#7808)

* Remove esModuleInterop from ts-node.

* Add e2e test.

* Fix test.
Change test name.
Add comment.

* Fix test snapshot name.

* update snapshotting

Co-authored-by: Chris Breiding <chrisbreiding@gmail.com>

* clean up e2e project

* bump preprocessor to 1.3.2, which removes esModuleInterop default value

* improve esmoduleinterop e2e tests

* change spec file

* bump batteries-included preprocessor and install latest webpack preprocessor beside it

* update snapshots

* put back snapshot

* update snapshot

* update snapshot

Co-authored-by: Kukhyeon Heo <sainthkh@naver.com>
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2020-08-10 18:18:30 -04:00
Chris Breiding
474bcddbd3 feat: Change default preprocessor to webpack (#7982)
* make tests preprocessor agnostic

* update eslintignore

* put back deps needed for e2e test

* remove obselete snapshot

it was replaced by 1_typescript_support_spec.ts.js

* switch from browserify to webpack preprocessor

* cmon github

* fix/update tests

* bump preprocessor and update snapshots

* update snapshots

* bump preprocessor to gain json support

* fix e2e tests with webpack-originated errors

* bump preprocessor version, fix node globals

* update snapshot

* remove support for ? in file path

* bump preprocessor version

* bump preprocessor again

* bump preprocessor

* bump preprocessor

* update snapshots

* bump preprocessor version

* bump preprocessor, quiet the paths plugin

* add test verifying tsconfig paths work

* bump batteries-included preprocessor and install latest webpack preprocessor beside it

* update snapshots

* put back snapshot

* update snapshot

* update snapshot

Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2020-08-10 16:55:15 -04:00
Chris Breiding
d583fb4f62 Merge branch 'develop' into v5.0-release 2020-07-22 09:24:02 -04:00
Kukhyeon Heo
cb4deee8d1 Pass version number to plugin. (#7925) 2020-07-22 11:53:54 +06:30
Brian Mann
09c72e3589 silence deprecation warnings rather than patch transient deps for Buffer warnings 2020-07-17 13:53:26 -04:00
Zach Bloomquist
0e632635cd chore: rm non-test-related coffeescript references 2020-06-10 10:49:31 -04:00
Zach Bloomquist
fe785749e8 server decaf cleanup
cleanup
2020-06-04 14:48:33 -04:00
decaffeinate
e7d1f313b0 decaffeinate: Run post-processing cleanups on api.coffee and 35 other files
decaffeinate: Run post-processing cleanups on reporter.coffee
2020-06-04 14:03:03 -04:00
decaffeinate
0f035b976c decaffeinate: Convert api.coffee and 35 other files to JS
decaffeinate: Convert reporter.coffee to JS
2020-06-04 14:03:01 -04:00
decaffeinate
c7dd989893 decaffeinate: Rename api.coffee and 35 other files from .coffee to .js
decaffeinate: Rename reporter.coffee from .coffee to .js
2020-06-04 14:02:58 -04:00
Jennifer Shehane
a27bd34df3 Reporter error improvements (#3930) 2020-05-06 12:18:29 -04:00
Gleb Bahmutov
aae90bbbe0 Set CommonJS module format when transpiling TS code (#7197) 2020-05-04 08:57:39 -04:00
Gleb Bahmutov
4290a85875 More logs, more tests for TypeScript preprocessor (#7189) 2020-05-01 09:45:59 -04:00
Gleb Bahmutov
f31cb3cdc3 Add bundled endpoint (#7153) 2020-04-27 10:00:56 -04:00
Dmitriy Kovalenko
379a9e7008 feat: improve component based tests approach (#5923)
- new mode that mounts the spec iframe instead of application iframe
2020-04-26 16:25:24 -04:00
Ben Kucera
16aecbafaa [internal] watch+reload on file change for e2e tests with --no-… (#6873)
* allow watching files for e2e tests with --no-exit
2020-04-23 10:45:57 -04:00
Kukhyeon Heo
d7c545223a Fix typo that made user projects include bundled typescript. (#7072) 2020-04-20 19:51:37 +06:30
Kukhyeon Heo
e22b362d4c Out-of-the-box TypeScript Support (#5906)
* Out-of-the-box TypeScript support for plugins

* Out-of-the-box TypeScript Support for tests.

* Fix server unit tests.

* Don't use bundled typescript.

* Added esModuleInterop option.

* Fixed unit tests.

* Added simple_tsify to integration test.

* Added integration tests for ts spec files.

* simple_tsify to ignore transpiling json files.

* transpile on flush.

* Fix lint failure.

* Added error message.

* Add error message for restart test runner for support file.

* Added JSDoc comment.

* Remove preset-typescript.

* Fix integration test failure.

* Fix type errors.

* Add e2e test for typescript

* Fix lint error.

* Add plugin support and e2e test.

* Fix server unit test failures.

* Update snapshots.

* Migrate typescript compilation code to browserify-preprocessor

* Remove unnecessary files and test.

They're tested in preprocessor.

* Fix test failures.

* Update @types/react.

* Update yarn.lock.

* Clear name: registerTS -> tsRegistered.

* Clarify why tsRegistered = true exists.

* Add working examples for support and plugins.

* Move TypeScript tests to its own file.
2020-04-13 21:39:13 +06:30
Chris Breiding
a22d0cc756 Chore: Refactor saved state utility (#6759)
* decaffeinate: Rename saved_state.coffee from .coffee to .js

* decaffeinate: Convert saved_state.coffee to JS

* decaffeinate: Run post-processing cleanups on saved_state.coffee

* decaffeinate: Rename saved_state_spec.coffee from .coffee to .js

* decaffeinate: Convert saved_state_spec.coffee to JS

* decaffeinate: Run post-processing cleanups on saved_state_spec.coffee

* refactor saved state

- create a single saved_state module instead of having two
- export an object with methods instead of a function with methods
2020-03-17 15:20:26 -04:00
Ben Kucera
dd51b41ae2 render ansi colors for file:preprocessor error message (#6535)
* show colored spec compile errors in browser reporter
2020-03-10 10:24:11 -04:00
Chris Breiding
e93e6ae0b4 Validate plugin event registration (#5356)
* Turn exception message into something human readable

* Pass ipc as parameter to invoke function

* Creating file to validate event name and handler

* Creating tests to validate_event

* Remove ipc from invoke parameter

* Removing ipc parameter being passed to validateEvent

* convert spec to js

* increase line-height for plugins error message

* refactor error messages and implementation

* fix race condition where async error in plugins file could hang run

a quick async error at the root of the plugins file had the potential to hang the run because the ‘exitEarlyWithErr’ listener was registered later than that error was emitted

this enables that error to be tracked so we can properly exit at the appropriate time

it also refactors run.js to not rely on an event emitted on the project and instead passes through an onError handler, which makes more sense since the event was only used in run.js (except for one case). it also makes for easier unit testing

* fix missing reference

* fix duplicate reference

* fix args being passed in incorrectly

* fix way args were handled in server.open

* fix exit early implementation

* fix duplicate logging

* fix unit test

* update snapshot

* fix missing reference

* add e2e test to cover plugin registration validation

* clean up after merge

* add back snapshot

* fix e2e tests

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-03-05 16:00:42 -05:00
Chris Breiding
474b80a50f Fix race condition when there's an early asynchronous error in… (#6610)
* fix race condition when there's an async error in root of plugins file

* return the promise

* fix routes creation

* fix tests

* fix error throwing and add tests

* update snapshots

* revert changes to server.open signatures in tests

* fix test

* properly wrap error so it doesn't log twice

* slow down test to ensure plugins error occurs before run is over

* wait to log early exit error until after run start
2020-03-04 11:59:01 -05:00
Chris Breiding
778321786f Pass projectRoot and configFile to plugins file through config (#6317)
* decaffeinate: Rename index.coffee from .coffee to .js

* decaffeinate: Convert index.coffee to JS

* decaffeinate: Run post-processing cleanups on index.coffee

* refactor decaffeinated plugins/index.js

* decaffeinate: Rename 3_plugins_spec.coffee from .coffee to .js

* decaffeinate: Convert 3_plugins_spec.coffee to JS

* decaffeinate: Run post-processing cleanups on 3_plugins_spec.coffee

* fix wrongly removed return

* refactor e2e plugins spec, update snapshot

* pass env argument to plugins file

* decaffeinate: Rename index_spec.coffee from .coffee to .js

* decaffeinate: Convert index_spec.coffee to JS

* decaffeinate: Run post-processing cleanups on index_spec.coffee

* update plugins tests

* update scaffold snapshot

* add back server test script and document running individual tests

* add projectRoot and configFile directly to config

* normalize browsers in snapshot

* add types for configFile and projectRoot

* fix linting issues

* return return

* Merge

* remove file

* remove unnecessary returns
2020-02-28 14:13:36 -05:00
decaffeinate
230072ee0a decaffeinate: Run post-processing cleanups on index.coffee 2020-02-24 14:20:02 -05:00
decaffeinate
708f4683eb decaffeinate: Convert index.coffee to JS 2020-02-24 14:14:11 -05:00
decaffeinate
ad5d4eb7d3 decaffeinate: Rename index.coffee from .coffee to .js 2020-02-24 14:14:09 -05: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
Ben Kucera
94176149c4 deprecated before:browser:launch event (#6293)
* deprecate old API for before:browser:launch

* trigger ci

* allow chrome preferences to be overwritten in before:browser:launch

* add e2e test for chrome preferences

* add launchOptions.windowSize, refactor plugin handling into browser/utils

* async/await-ify chrome.ts, update e2e.js

* add padding to warning, allow more than 1 warning in run mode

* remove psInclude

* bump snap-shot-it, remove patch-package

* fix failing tests, tighten up code

* remove unused Promise.all

* more code cleanup from coffeescript conversion

* fix expectedExitcode

* update snapshot with cross origin error message

* more code cleanup from coffeescript conversion

* remove global state, cleanup normalizing stdout in snapshots

* fix asserting on the expected exit code

* remove firefox a default browser in e2e tests

* remove dupe const

* make onStdout return first arg by default

* remove only

* make expectedExitCode: 0 the default, remove duplicate option from all e2e tests

* fix test for electron

* reuse _getArgs() properly, tighten up dupe code, move perf e2e tests to use new e2e.it helpers

* make e2e test pass properly, and capture snapshot

- this was being overlooked because expectedExitCode wasn’t being set
(until now its the default)

* revert firefox specific changes to reduce PR diff

* remove newline

* temp 02/04/20 [skip ci]

* add more scenarios / return values

* rename plugin deprecation project fixture

* prevent warnings in run mode from being called multiple times in the same browser launch

- add plugin integration tests
- cleanup some promise code in browsers/chrome
- refactor the e2e deprecation tests

* update e2e deprecation specs, test that deprecation warning is displayed once per spec on a run

* cleanup let -> const, coffescript conversion

* bump snap-shot-it, remove patch-package

(cherry picked from commit ba23be5349)

* bump cli snap-shot-it

* cleanup: let -> const, parseFloat, formatting

* revert cross origin normalization

* fix spacing

* add types for plugin events

* dont pad warning message in run mode

* add e2e test for adding extensions before:browser:launch

* fix failing electron unit test, consolidate creating default launch options

* add extensions for electron + warning if install fails

* fix failing tests, yield the right before:browser:launch args signature

* e2e test electron via devtools extension

* remove .only

* add stdout assertions to e2e/1_deprecated_spec

* remove snapshot whitespace

* rename deprecation event

* update deprecated browser launch args warning message

* throw error on unexpected bbl property

* add tests for warning + error on bbl

* update snapshot

* revive 2 useful tests to validate how launchOption args are merged

* try fix e2e fullscreen spec, update snapshots

* tighten up code for throwing errors on unknown launch options properties

- list out the unknown and expected properties using existing
conventions
- tighten up the error message a bit

* rename options -> launchOptions, add e2e test for adding unknown properties to launchOptions, removed dupe snapshots

* fix fullscreen e2e test

* only push user gesture arg if chromium

* add e2e tests for throwing + rejecting errors, run e2e tests on all browsers, avoid ps logic only in electron

* remove conditional args in fullscreen test

* dont automatically install the latest version of chrome in circle

* add stubs for new electron properties

* switch from using port 5555 to 5544 to avoid common conflicts

* temporarily commenting out windowSize launchOption so release is unblocked and all tests pass

- can add it back in later once the e2e tests pass in CI

* make the path to chrome profile correctly dynamic to account for all operating systems

* remove magic length(8) and slice out the first 4 custom args set from the plugin launch options

* add back --start-maximized in chrome

* deleting windowSize-related code... for now!

Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2020-02-05 13:07:59 -05:00
Zach Bloomquist
0784af719c Merge branch 'develop' into v4.0-release 2020-01-31 13:31:36 -05:00
Zach Bloomquist
d816772133 Add process profiler for debugging (#6171)
* add process profiler for debugging

* remove existing CYPRESS_MEMORY check

* rename some columns, format PIDs a little nicer, start when debug is enabled or verbosedebug is enabled

* use shared method for determining if this is the electron process running

* finish adding enhanced grouping

* cleanup

* add tests for changes to other parts of cypress

* add tests for process_profiler

* use browser displayname to group

* fix ffmpeg and add tests

Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2020-01-31 12:29:47 -05:00
Chris Breiding
f2600b5e35 Merge branch 'develop' into v4.0-release 2019-12-09 13:46:05 -05:00
Gleb Bahmutov
b03b25c258 feat: pass list of browsers to plugins file (#5068)
and allow project to customize the list of browsers
2019-11-19 09:02:17 -05:00
Chris Breiding
006bf51d93 Merge branch 'develop' into v4.0-release 2019-10-29 10:16:23 -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
Gleb Bahmutov
4ec77e3d58 use Node path from config file to run plugins (#4436)
* use Node path from config file to run plugins

* add finding system node

* memoize node find, use fix-path if Node is not found

* find Node asynchronously

* update note on ENFILE

* print node version before executing registered event

* use nodeVersion option, add validator isOneOf

* linting

* remove resolve-dir

* debugging unit test

* resolve original promise to make the tests run correctly

* update second test

* add unit tests

* upgrade snap-shot-it package to be able to update snapshots

* make finding node path part of startup, merge into config

* update tests

* add node version & path to run output

* add node version display to desktop-gui

* add warnings, add tests, add learn more link in desktop-gui

* Revert "add node version & path to run output"

This reverts commit 40a3218175.

* only show Node Version if it is non-default

* Add e2e test for using system node

* cleanup

* add tests that resolvedNodePath and Version are available in tests

* assert nodeVersion == system

* add nodeVersion to schema

* add new configoptions to types

* add fallback if pluginsfile is disabled

* new package.json sorting

* update some of the wording/styling of Node Version panel

* remove ` from schema file

* clean up decaffeinated tests + update wording when no pluginsfile is present

* playing with messaging.

* push updated node version panel design

* update design + copy of Node panel again

* some more iteration on design (WIP)

* Finish design changes + fix tests

* add debug message

* linting problems

* add missed require

* Add comment to refactor the colWidths in this PR after another PR goes

* replace the exact length of Node version in specfiles

* print object for node version and path instead of %s %s

* update snapshot to match v12 length


Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2019-10-01 17:08:11 -04:00
Chris Breiding
6ba8d7cc93 Electron v5.0.10 (#4720)
* fix specs

* use debugger protocol for cookie handling in electron

* use latest gulp

* use rimraf instead of gulp-clean

* use electron 3.1.8 and node 10.2.1

* use gulp 4 in packages/static

* fix sendCommandAsync, log Schema.getDomains on CDP connect

* autofill e2e test name [skip ci]

* electron@5.0.7, see what new failures exist

* --no-sandbox for launching Electron

* update cookies logic for electron

* node 12

* update snapshot for new node

* update error message for new node

* stub sendCommandAsync

* only connect to socket if path has been replaced, fixes #4776

* update node-sass to support node 12

* skip wacky socket tests for now

* snapshot

* fix run_plugins_spec snapshot, don't include stack trace

* use --no-sandbox on linux to run as root

* allow sendCommandAsync to resolve

* use euid for root check

* log domains even if undefined

* don't worry about ending 1xx responses immediately anymore

* use --max-http-header-size, change max size from 8kb to 1mb, fix #76

* do not send 502 on failed websocket, just send back ECONNRESET

* update websocket spec port to not collide with other test

* update outdated expect

* Revert "only connect to socket if path has been replaced, fixes #4776"

This reverts commit f179eda5ca.

* update gulp in root

* update https-proxy unit tests

* update network spec to properly close server

* update reporter spec

* update https-proxy-agent to fix node 10.10.0 change

discussion: https://github.com/nodejs/node/issues/24474\#issuecomment-511963799

* only pass --max-http-header-size on node >=12

* use own server-destroy implementation that supports secureConnect events

* oops

* update socket_spec

* electron 6.0.0

* console.table introduced in node 10

* change browserify entry to init.js

* handle edge case when no response body

* console.table added in node 10

* do not exit app when all BrowserWindows are closed

* update e2e snapshots

* value may not be null

* update plugins spec

* correct cookie expiry, use browser.getversion for CDP version check

* fix snapshotting for require stacks

* reorder cookies in spec

* warn when depreated electron callback apis are used

* only report 1 plugin error per process

* cleanup

* node 12.4.0, cypress/browsers:node12.4.0-chrome76 docker image

* update shell.openExternal to promisified

* update dialog.showOpenDialog to promisified

* update webContents.session.setProxy to promisified

* updating native dependencies since we don't need ancient node ABI support anymore

* WIP: switch cookies to simpler, jar-less approach

* WIP: switch cookies to simpler, jar-less approach

* making tests pass

* improve cookie filtering logic

* Remove unneeded Promise.try

* filter what makes it to the extension

* properly re-set superdomain cookies on cross-origin cy.visit

* allow comma-separated list of e2e tests

* sort cookies in order of expiration date, ascending

* updating tests, cleanup

* update tests

* version electron as a devDependency, electron@6.0.1

* cleanup, remove old automation

* cleanup, remove old automation

* bump chokidar to fix win10 + node12 issue

was seeing this on windows:
https://github.com/nuxt/nuxt.js/issues/6035

fixed with version bump

* enable now-supported quit role, re-enable old tests

* don't need that arg there

* remove last deprecated callback electron invocations

* Delete cypress.json

* responding to PR feedback

* cleanup

* invoke

* use 'quit' role

* Use new appMenu role for Cypress menu on mac

* electron@6.0.2

* electron@6.0.3

* remove domain: cookie.domain and see what happens

* remove setErrorHandler

* Revert "remove domain: cookie.domain and see what happens"

This reverts commit 49e916896d.

* add unit tests for cookies

* ci

* fix project-content css

* electron@6.0.4

* fix specs_list test

* electron@6.0.7

* some cleanup

* electron@6.0.9

* Update 8_reporters_spec.coffee.js

* electron@5.0.10 - Chromium 73, Node 12

* cli: fix the STDIN pipe on Windows (#5045)

* cli: pipe stdin

* uggh, here is the actual change

* update cli unit tests

* add unit test

* more permissive check for json to include application/vnd.api+j… (#5166)

* more permissive check for json to include

* add json test for content-type application/vnd.api+json

* cruder solution passes e2e tests locally, so let's go with that

* Remove 'charset' from content-type before checking if JSON

* fix eslint for fixture specs (#5176)

* update eslint to lint files within 'fixtures' in support files

- ignore some edge cases like jquery, jsx and obvious js files we wrote
with broken code

* Fixes from eslint to 'fixtures' files

* 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

* Addresses #2953 (#5174)

* Addresses #2953

* Added proper test for new error message

* Didn't realize it ran this test as well, whoops

* Implementing changes as suggested by @jennifer-shehane

* Fixing tests and error output. Moved the checks to the start of the get command to ensure we always catch improper options

* Removing issue test since the querying spec covers it

* Using coffescript isArray check

* depromisify things that were promisified b/t electron 5 <=> 6

Revert "update shell.openExternal to promisified"

This reverts commit 8b6460d015.

Revert "update dialog.showOpenDialog to promisified"

This reverts commit 5f178b075b.

Revert "update webContents.session.setProxy to promisified"

This reverts commit 727df3a4e5.

* node12.4.0-chrome76 => node12.0.0-chrome75

* fix tests for electron downgrade

* node12.0.0-chrome75 => node12.0.0-chrome73


Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2019-09-24 14:35:24 -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
Jennifer Shehane
11ff857d54 Merge branch 'develop' into v4.0-release
# Conflicts:
#	cli/__snapshots__/cli_spec.js
#	packages/driver/test/cypress/integration/cypress/cypress_spec.coffee
#	packages/server/package.json
2019-06-26 13:36:07 +06:30
Zach Bloomquist
1f185f7f11 Fix cy.visit slowness by removing Electron timers workaround (#4385)
* add tests for getAddress on localhost

* add test for visit resolving quickly

* add debug logs to network

* network: override addRequest in HttpAgent, not createSocket

* don't need to add connection: keep-alive to all responses

https://github.com/cypress-io/cypress/pull/4385#issuecomment-499103484

* test that visit finishes quickly

* do not forward connection header

* add tests to help reproduce

* cleanup

* still send keep-alive

* update tests

* remove timers

* add snapshots to e2e test

* remove tests for debugging

* try making console writes async

* Revert "remove timers"

This reverts commit b9d65a4e5c.

* allow DEBUG_COLORS to be passed in an e2e test

* try: using system node for the timers, setting up our own IPC

* Revert "try: using system node for the timers, setting up our own IPC"

This reverts commit c51b3957e2.

* put the interesting test first

* use electron-mocha to run tests in electron

* Revert "use electron-mocha to run tests in electron"

This reverts commit 8b82f0eeb3.

* support legacy addRequest invocation

* Revert "Revert "remove timers""

This reverts commit 93f15fcb17.

* update snapshot

* Revert "try making console writes async"

This reverts commit 9c8337e433.

* complete in 150ms, not 1000ms
2019-06-17 12:41:22 -04:00
Chris Breiding
a99aa66cea eslint auto-fixes 2019-05-21 16:08:12 -04:00
Chris Breiding
21effb4a9a handle case where task handler is undefined (#2581) 2018-10-15 15:21:34 -04:00
Chris Breiding
70b0fa21eb merge handlers for multiple task registrations (#2289) 2018-09-08 19:06:57 -04:00
Brian Mann
2689ff8416 add more debug logs (#2109) 2018-07-06 17:19:20 -04:00
Chris Breiding
7f1a69f20e Add 'after:screenshot' plugin event (#2058)
- Fixes #2039
- Fixes #2040
2018-06-28 23:11:43 -04:00
Chris Breiding
0e2246785c Screenshot fixes/enhancements (#1858)
* create directory path from screenshot name

* fix screenshot e2e specs

* ensure unique file paths for non-named screenshots

* append failure screenshots with ‘— failure’

* fix snapshot differences caused by slow computer

* fix driver specs

* fix minutes/seconds e2e snapshot replacer

* fix minutes/seconds e2e snapshot replacer again

* fix e2e specs failing due to screenshot path differences

* more snapshot fixes

* more snapshot fixes

* more snapshot fixes

* fix reporter showing wrong path for nested spec when no tests

* nest non-named screenshots in path based on spec path

* fix specs

* fix snapshot

* test that server + project state is reset between specs in cypress run mode

* rename spec.path to spec.relative. pass around the spec object instead of a string path

- store state on the project for current spec + browsers
- simplify how desktop gui passes around spec object
- fixes #1921
- make all specs a real spec model
- rename ‘Run all tests’ to ‘Run all specs’

* remove pretty-error dependency

* fixes #1919 and #1918, add Cypress.spec and Cypress.browser

* fixes all the failing tests

* fixes failing tests

* types: Cypress.spec

* add types for Cypress.browser

* fixes more failing tests

* enable null for spec props when running "All Specs"

* read comments per PR

https://github.com/cypress-io/cypress/pull/1858#issuecomment-396121876

* fixes failing tests

* fix linting

* fix types assertion

* fixes failing tests

* fixes failing tests, update from -- failed to (failed)

* ugh regexp

* fixes more tests

* add name, specName, and testFailure to the afterScreenshot props

* fix failing tests. append (failed) for failed screenshots

- use { testFailure: true } to indicate a failing test screenshot for
use in props
2018-06-17 20:01:27 -04:00
David Almeida
a77e7255ca server(fix) cleanup integrationFolder in filePath, close #1704 (#1705) 2018-06-05 15:22:56 -04:00
Brian Mann
fc423ca467 WIP creating a new banner + summary table for runs #1588 (#1722)
* WIP creating a new banner + summary table for runs [skip ci]

* WIP continuing to iterate on new run output, use tables for results [skip ci]

* log -> debug

* switch out 400 -> 412 status code on schema errors

* update humanTime to take short or long formats

* debug the starting argv

* create terminal-size wrapper to return terminal columns + rows

* created custom terminal tables for displaying new stdout results for running multiple specs

- made tables responsive when columns < 100

* add e2e tests around exiting with error when browser cannot be found or specs cannot be found

- instead of creating a run, immediately die without making any requests
- improve BROWSER_NOT_FOUND error message

* strip ansi color codes from terminal spec, use chalk instead of colors

* pass webUrl from recording runs to be able to display URL before tests run

* finished new stdout flow for running specs iteratively

* when webUrl is present, display the recorded run in the header + footer

- move from ‘white’ to ‘reset’
- tighten up intro table

* change results output from "Video Captured" to "Video" to pair with newest config option

* use runUrl, not webUrl, fix white space, ensure that e2e snapshots are accurately normalized

* use console.log, not console.error to capture stdout for dashboard

* e2e tests around logging warnings when cannot record video

* 0 seconds -> X seconds

* Tests Starting -> Run Starting, Tests Finished -> Results

* Started video recording -> hr line break

* All Done -> Run Finished

* evenly space stdout section headers

* add a new line when exiting early from bundle errors

* sanitize stdout better, replace duration seconds, etc

* update all the various e2e stdout snapshots

* ensure that COLUMNS env is set to 100 for snapshots to pass

* better logging for env var

* env -> stdout

* store as string

* remove columns

* echo columns

* add columns back in

* comment out

* set terminal columns

* cleanup circle.yml [skip ci]

* normalize more result properties for browser, os, cypress

* set columns for server tests

* enforce no colors and correct columns + rows for e2e tests, fix cloning env vars

* update e2e tests for newest stdout

* set env vars for columns + lines for e2e tests, remove stty

* fix snapshots when duration is X second, X seconds, or XX seconds

* use process.env.COLUMNS not process.stdout

* ugh

* stringify

* log crap out

* quotes oh my

* fix failing e2e snapshot tests

* fix failing e2e tests

* fix failing integration tests

* fixes failing unit tests
2018-05-21 18:37:35 -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