41 Commits

Author SHA1 Message Date
Chris Breiding
b53f04e4f7 feat: Fire run events in interactive mode (#15787) 2021-04-12 14:43:19 -04:00
Barthélémy Ledoux
651df1b2ad feat: make cypress schema for component & e2e keys (#15720) 2021-03-31 15:30:49 +00:00
Adam Gastineau
fa780634ca Removed experimentalComponentTesting flag 2021-03-29 10:47:52 -07:00
Lachlan Miller
43c8ae2a7c feat: support ct/e2e specific overrides in cypress.json (#15526)
Co-authored-by: Dmitriy Kovalenko <dmtr.kovalenko@outlook.com>
2021-03-21 23:28:59 -04:00
Chris Breiding
237c426707 fix: Revert cypress.json changes (#15499) 2021-03-15 18:01:06 -04:00
Lachlan Miller
a94c9d5ef0 feat: support ct/e2e specific overrides in cypress.json (#15444)
Co-authored-by: ElevateBart <ledouxb@gmail.com>
Co-authored-by: Jessica Sachs <jess@jessicasachs.io>
2021-03-13 03:47:49 -05:00
Chris Breiding
59c2c03895 feat: Remove experimentalRunEvents flag (#15276) 2021-03-02 10:07:02 -05:00
Zach Panzarino
f4b01394a8 feat: Cypress Studio - record test steps through interacting with your site (#9542)
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2021-01-19 10:23:26 -05:00
Chris Breiding
df813be133 feat: Add downloadsFolder config option (#14465) 2021-01-11 11:57:25 -05:00
Chris Breiding
9a25fd02c2 feat: Add after:run event (#14263) 2020-12-21 13:40:55 -05:00
Chris Breiding
d6c0bcfc04 feat: Add before:run event (#14238) 2020-12-21 13:06:45 -05:00
Chris Breiding
c9916c8bbd feat: Add after:spec event (#14178) 2020-12-18 09:45:15 -05:00
Chris Breiding
f47d5c0574 feat: Add before:spec event (#9646)
Co-authored-by: Zach Bloomquist <github@chary.us>
2020-12-16 16:25:14 -05:00
Luke Page
0b07e8f789 feat: add scrollBehavior option (#8837)
Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
2020-11-30 16:04:18 -05:00
Zach Bloomquist
3fec100397 feat: deprecate cy.route(), remove experimentalNetworkStubbing flag (#9185)
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2020-11-17 10:56:19 -05:00
Zach Bloomquist
3d0d1d89de feat(net-stubbing): rename cy.route2 to cy.http (#9182)
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2020-11-14 14:22:21 +06:30
Chris Breiding
d3c480f5ad chore: Deprecate experimentalShadowDomSupport flag and remove its usage (#8548) 2020-09-10 16:25:55 -04:00
Chris Breiding
9abed894eb feat: Add "global" shadow dom config option (#8479) 2020-09-10 14:31:01 -04:00
Zach Bloomquist
2469473eb2 chore: rename experimental network stubbing (#8450) 2020-08-31 11:46:00 -04:00
Zach Bloomquist
c37896089b feat(net-stubbing): experimental full network mocking support (#4176) 2020-08-31 09:41:47 -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
Jennifer Shehane
a882763f08 Merge branch 'develop' into v5.0-release 2020-08-10 20:14:11 +06:30
Laís Tomaz
fbce860f31 feat: Add configuration option for disabling screenshots (#8083)
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-07-28 11:39:38 +06:30
Laís Tomaz
27e8c817d3 Rename configuration option blacklistHosts (#7622)
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2020-07-13 15:16:19 +06:30
Zach Bloomquist
0b4529bbdb feat: make cookies have sameSite key by default (#7790)
* feat: make cookies have sameSite key by default

BREAKING CHANGE: modifies the shape of Cookie objects

* update tests

* add deprecation notice

Co-authored-by: Brian Mann <brian.mann86@gmail.com>
2020-06-29 14:41:50 -04:00
Gleb Bahmutov
aed2709637 automatically polyfill window.fetch with XMLHttpRequest (#7597)
Co-authored-by: Jessica Sachs <jess@jessicasachs.io>
2020-06-15 11:40:08 -04:00
Chris Breiding
cf87458ba3 Fix issue where click hangs if subject has a shadow root and shadow dom support is not enabled (#7692) 2020-06-12 14:42:57 -04:00
James Garbutt
a7ff8fddc2 add some shadow dom support (#7469)
Co-authored-by: Chris Breiding <chrisbreiding@gmail.com>
Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
2020-06-08 13:05:32 -04:00
Zach Bloomquist
6960f7cd78 Rewrite JS/HTML using AST-based approach (#5273)
* Add winPropAccessor to security.js, remove other replacers

* Add start of Cypress.resolveWindowReference

* Add regexes for dot and bracket access

* Some security_spec tests pass with new injection

* Add resolveWindowReference unit tests

* Old security_spec now passes with resolveWindowReference

* Inject stub resolveWindowReference so proxy still works outside of Cypress

* wip: rewrite HTML + JS with tokenizer

* Move to using esprima + hyntax to rewrite JS + HTML

* remove comment; oneLine makes the whole thing commented

* Fix tests, apple.com edge case

* wip: add getOrSet

* Revert "wip: add getOrSet"

This reverts commit a5c647c00f.

* release 3.5.0 [skip ci]

* use recast to replace window property accesses

* replace assignments to top properly

* fix yarn.lock

* bump deps

* update integration tests

* remove old security ts?

* fix integration spec

* always ignore js interception failure

* use globalThis instead of window

* add experimentalSourceRewriting flag

* restore regex-writer spec

* fix types

* update config_spec

* add source rewriting spec

* cleanup

* simplify rewriting logic, move rules into rewriter package

* create threaded rewriting tool for non-streaming use

* update @packages/rewriter to use threads for async

* use async rewriting where convenient

* add worker-shim.js

* add performance info to debug logs

* properly handle +=, -=, ...

* add proxy, rewriter to unit-tests stage

* cleanup

* use parse5 to rewrite HTML, strip SRI

* update tests

* reorganization, cleanup

* rewrite ALL parent, top identifiers except in a few cases

* handle many JS edge cases

* ensure parse5@5.1.1 is installed

* update yarn.lock

* update tests

* add debugging, add tests

* add attempted repro for .href issue

* implement source maps + extending inline source maps

* update opts passing in proxy layer

* fix sourcemap naming structure

* update tests to account for sourcemaps

* sourcemap tests

* remote source maps work

* comment

* update rewriter tests

* clean up TODOs in resolveWindowReference

* remove @types/nock

* clean up todos in deferred-source-map-cache

* fix rewriter build script

* fix concatStream import

* bump expectedresultcount

* clean up js-rules

* threading improvements, workaround for Electron segfault

* no visit_spec for now

* fix 6_visit_spec

* update MAX_WORKER_THREADS

* add repro for #3975

* cleanup

* cleanup

* make better use of namedTypes and builders

* get rid of the horrific closureDetectionTernary

ast-types keeps track of scope, so it is unneeded

* fix #3975, #3994

* add x-sourcemap, sourcemap header support

* snap-shot-it 7.9.3

* add deferred-source-map-cache-spec

* add tests

* Throw error in driver if AST rewriting fails

* Fix "location = 'relative-url'"

* fix max recursion depth

* slim down some fixtures

* fix window.location usage

* don't mess with `frames` at all

* no integration tests

* skip testing apple.com for now

* update wording: regex-based vs. ast-based

* skip real-world tests for now

* add some padding to process.exit workaround

* fix resolvers_spec

* fix html-spec

* cleanup

* Update packages/rewriter/lib/js-rules.ts

* Update packages/driver/src/cypress/resolvers.ts

* just import find by itself

* privatize typedefs for Cypress.state, remove .gitignore, remove dead code

Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
2020-05-11 12:54:14 -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
Zach Bloomquist
b6703aaec7 Add support for sameSite in cookie-related commands (#6828)
* add experimental feature for sameSite

* allow experimental descriptions to render markdown

* sameSite support mostly working

* also strip sameSite from setCookie yielded value

* don't use `unspecified` - let browser set default

* add tests

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

* decaffeinate: Convert cdp_automation_spec.coffee to JS

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

* cleanup cdp_automation_spec.ts

* update unit tests

* update settings_spec to not render as markdown

* user-friendly error for insecure SameSite=None

* fix styling

* fix markdown renderer

* update types + schema

* use renderInline

* update experiment summary

* bind renderFn to md
2020-03-27 10:04:50 -04:00
Gleb Bahmutov
b3e40b08cd allow list of search patterns in testFiles config option (#5402)
* WIP: log spec search steps

* add multiple files via glob test

* allow testFiles to be a string or a list of strings to match

* failing config tests: testFiles type change

Change `testFiles` from a string to either a string **or** array of strings; following similar pattern as `ignoreTestFiles`

* testFiles type change passing tests

* update verbiage related to testFiles type change

* enable running integration tests locally

See https://github.com/paulmillr/chokidar/issues/855 for more details.

* integration tests; failing

Seems to fail for similar reason as #4543 and is likely resolved with PR #4849

* correct test verbiage

Distinguish between the two tests; as they are subtly different.

* update TS types for testFiles type change

Updated the comments, but forgot to update the actual type. This commit rectifies that.

* correct CLI syntax in test

`--config` was not being passed the appropriate value. Now matches other test cases; such as that found in [args_spec](92b91fe514/packages/server/test/unit/args_spec.coffee (L210))

* remove unsupported syntax from tests

From looking at other tests, it does not appear that the syntax `--config=testFiles=glob1,glob2` is current supported. Removing the test for this test case.

* test the correct config value

Previously was testing `ignoreTestFiles` instead of `testFies`

* provide more accurate test assertion

* correct config's `testFiles` type

Should be a string or an array of strings.

* remove unnecessary newline

* tweak verbiage to better align with intention

Co-Authored-By: Ben Kucera <14625260+Bkucera@users.noreply.github.com>


Co-authored-by: Andrew Smith <andrew@andrew.codes>
2019-10-31 11:26:47 -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
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
e7e3153d39 Update configuration schema to match docs (#4300) 2019-06-28 19:52:15 +06:30
Gleb Bahmutov
a5f2a0f338 schema: update videoCompression to allow boolean, close #2140 (#2142) 2018-07-23 06:12:04 -04:00
Brian Mann
d92d51a8eb rename videoRecording -> video (#1804) 2018-05-29 17:23:01 -04:00
Brian Mann
4053596a88 validate cli + env var config, add breaking config changes (#1784)
* fixes #1783 validate configuration values after they're set from CLI + Env Vars

* fixes #1754 remove screenshotOnHeadlessFailure and rename trashAssetsBeforeHeadlessRuns

* derp copypasta fail
2018-05-28 01:27:54 -04:00
Brian Mann
46c1c21ea5 schema: add new modifyObstructiveCode option [skip ci] 2018-02-16 00:42:17 -05:00
Sam
a7d0cff93f Fixing incorrect type for supportFile (#1167) 2018-01-09 16:59:38 -05:00
Gleb Bahmutov
d865439367 add cypress.schema.json close #1109 (#1112) 2017-12-20 21:02:01 -05:00