Commit Graph

430 Commits

Author SHA1 Message Date
Matt Henkes
6ee305ba41 feat: Allow cy.visit to visit cross origin sites. (#23297)
* Initial async changes

* Small fixes and test updates.

* updating tests

* Fixes for cookie login tests

* remove the onlys

* Most tests passing

* Fix driver tests?

* fix firefox test?

* fix unit tests

* fix tests??

* a better check

* fix integration tests

* minor cleanup

* Comment out tyler fix for 10.0 origin issue

* also fix integration tests

* remove fixmes

* Adding Retries for cookie actions. May break other error tests.

* Address (some) PR comments

* update to warn about cross origin command AUT in assertions

* Fix type errors

* Move document.cookie patch to injection

* Adding iframe patching.

* forward errors prior to attaching

* Add error message when using visit to visit a cross origin site with the onLoad or onBeforeLoad options.

* Attempt to fix test errors.

* more fixes, but not all

* use the origin policy

* Fix types

* more fixes

* consider chromeWebSecurity when checking if you can communicate with the AUT

* firefox

* prevent hangs if before unload happens after on load.

* Fix some ToDos

* code cleanup

* remove quotes

* Code review changes

* more cr changes

* fix tests possibly

* for realz this time

* roll back change

* Fix some flake

* Fix flakey xhr test hopefully.

* oops, forgot communicator changes. need those.

* modify error message to not lose the original error

* read config right derp

* simpler check

* no unused vars

* don't put config on window

* Make isRunnerAbleToCommunicateWithTheAUT a util function instead of attaching it to cypress.

* fix a race condition maybe

* clear document when window is cross origin... we'll see if this breaks anything.

* Retry if querying against the wrong AUT

* use timeout

* Don't print the retrying string unless you're retrying due to command aut origin mismatch

* try handling undefined document

* Code review updates. What could go wrong??

* Apply suggestions from code review

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* minor fixes

* try aut location and move the async state collection.

* fix flake around the loading message, probably

* Fix system tests and some flake around redirect counts.

* Improve error handler prior to attaching.

* Code review suggestions

* use a generated ID when promisifying post message

* clean up promise helper

* skip xhr test until issue is resolved.

* Apply suggestions from code review

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>

* use state directly

* Apply suggestions from code review

Co-authored-by: Bill Glesias <bglesias@gmail.com>

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

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>

Co-authored-by: Bill Glesias <bglesias@gmail.com>
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2022-09-15 12:28:27 -05:00
Adam Stone
fada0be117 chore: fix flake for experimentalStudio config error test (#23800) 2022-09-13 15:14:27 -04:00
Zach Bloomquist
566a1a208c feat: gate WebKit behind experimentalWebKitSupport in prod (#23711) 2022-09-13 01:56:13 +00:00
Zachary Williams
96b03abc74 fix(svelte): default mount log to true (#23771) 2022-09-12 17:20:02 -05:00
Tyler Biethman
405e7f7ccb chore(webkit): update error stack parsing and related system tests (#23730)
* chore(webkit): update error stack parsing and related system tests

* Adding better comment

* Putting column back. Indexing at 1.

* Let's wait for WebKit fixes to land for this

* Using default name/location values already used in stack enhancing logic

* Incorrect bracket in regex

* Trying without location, as the fake location causes more problems downstream.

* Loosening regex around locations in stack replacement

* Defaulting location sans row/column

* Parsing stack lines for reporter with unique regex

* D'oh

* Making the validation against '<unknown>' more specific

* Don't want a capture group here

* Updating spec_isolation system tests

* Consolidating regex pattern to errors package

* Can just keep this global now

* Simplifying regex. Removing lineAndColumn numbers from unknown locations.

* Updating system test stack regex

* Getting better baseline

* Revert "Updating system test stack regex"

This reverts commit 2b91eff369.

* Forking normalization for webkit to track down diffs

* Ensure line or column are set before rendering in enhanced stack

* Need to be a little more flexible

* Tweaking leading newline detection

* Trying out new composed regex

* Few more tweaks for multiple leading newlines and file locations without function name

* Updating remainderOfStack pattern with proper escaping

* Cleaning up comments

* Filtering native code from absolute path logic

* Rebuild CI after outage
2022-09-12 15:40:12 -05:00
Lachlan Miller
a2170ac1ff chore: add regression test (#23695) 2022-09-12 10:21:13 +10:00
Rachel
406eb069a6 fix: issue-7715 (#23575)
Co-authored-by: Chris Breiding <chrisbreiding@gmail.com>
2022-09-09 11:36:19 -07:00
Emily Rohrbough
e32e3638df fix: suite-level-only configuration does not throw when config is restored (#23646) 2022-09-08 21:19:04 -05:00
Emily Rohrbough
38412925ba fix: correct dashboard result when successful spec run and videoUploadOnPasses=false (#23660) 2022-09-07 19:42:34 -05:00
Lachlan Miller
b6dad0a674 fix: support type: module in Node.js 16.17.0+ and 18.6.0+ (#23637)
* chore: bump ts-node version

* debugging

* update tests with docker images and docker script

* Update system-tests/scripts/bootstrap-docker-container.sh

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

* use chown

* Update system-tests/scripts/bootstrap-docker-container.sh

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

* Update bootstrap-docker-container.sh

* Update bootstrap-docker-container.sh

Co-authored-by: Zach Bloomquist <git@chary.us>
2022-09-07 10:21:02 +10:00
Zach Bloomquist
b5ba6d7b87 chore(webkit): add before:browser:launch and download support (#23662) 2022-09-06 18:19:42 +00:00
Zach Bloomquist
dc9e9dc62c chore(webkit): add video recording (#23579) 2022-09-06 17:12:13 +00:00
Emily Rohrbough
4e0e1cb85b chore: remove skipped test - covered elsewhere (#23675) 2022-09-02 17:50:49 -05:00
Jon Hieb
8b8f20eec7 fix: cypress/react18 rerender (#23360)
Co-authored-by: astone123 <adams@cypress.io>
2022-09-02 08:40:23 -04:00
Emily Rohrbough
c8b1b30323 fix: run "before:spec" plugin event when experimentalInteractiveRunEvents is enabled (#23634)
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
Co-authored-by: Rachel <Raquel.rudermano@gmail.com>
2022-08-31 13:40:11 -05:00
Zachary Williams
b615e8ac30 fix: don't show deps warning for projects that don't require bundler (#23598) 2022-08-30 15:43:01 -05:00
Lachlan Miller
72b8a65e78 feat: Cypress Studio for Cypress 10 (#23544)
* chore: wire up Cypress Studio  (#23413)

* wip

* wip

* wip - spike

* more wip [skip ci]

* update style

* fix ts

* move types around

* extract types

* lint

* fixing tests

* fix component test

* skip some tests

* do not error on experimentalStudio flag

* add studio controls placeholder

* fixing tests

* revert

* revert changes

* rename store

* rename method

* remove comment

* refactor

* correctly feature flag studio

* simplify code

* simplify code

* lift check into useEventManager

* correctly hide create studio prompt based on flag;

* remove superfulous css

* rename variables

* fix bugs

* wip

* unskip tests

* unskip more tests

* fix a bug in the assertion API

* fix bug in assertions [skip ci]

* wip - bugs [skip ci]

* feat: add experimentalStudio flag back (#23506)

Co-authored-by: astone123 <adams@cypress.io>

* chore: Add Studio UI to Cypress 10 (#23537)

* wip

* wip

* wip - spike

* more wip [skip ci]

* update style

* fix ts

* move types around

* extract types

* lint

* fixing tests

* fix component test

* skip some tests

* do not error on experimentalStudio flag

* add studio controls placeholder

* fixing tests

* revert

* revert changes

* rename store

* rename method

* remove comment

* refactor

* correctly feature flag studio

* chore: wip add barebones studio modals

* simplify code

* simplify code

* lift check into useEventManager

* correctly hide create studio prompt based on flag;

* remove superfulous css

* chore: style studio toolbar

* chore: misc feedback

* chore: remove studio store prop

* chore: studio URL prompt and other changes

* update component

* chore: UI styling and remove studio init modal

* chore: revert unnecessary changes

* chore: fix types

* chore: fix some tests, minor refactor (#23545)

* fix test

* fix test

* add noHelp link to StandardModal

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

* test: studio e2e tests (#23546)

* add basic e2e test

* add some e2e tests for studio and a note on limitations

* additional spec

* add more tests, refactor helper

* fix bug in studio

* remove test code

* chore: UI feedback

* fix race condition

* update tests

* rename test

* improve types in reporter

* remove dead code

* improve tests

* merge tests into one spec

* chore: Cap instruction modal width; exit studio mode when new spec is chosen

* chore: Only render studio error when test has failed; add test for studioEnabled

* correctly check if command is studio or not

* improve specs and hopefully reduce flake

* communicate studio state from app->reporter

* receive studio save state validity from app

* fix test

* improve test coverage

* fix external link

Co-authored-by: astone123 <adams@cypress.io>
2022-08-30 07:45:06 +10:00
Zachary Williams
2f337dbfa2 fix: angular 14.2 mount compilation error (#23593) 2022-08-29 13:40:43 -05:00
Zachary Williams
f6eaad40e1 feat: adding svelte component testing support (#23553)
Co-authored-by: Jessica Sachs <jess@jessicasachs.io>
Co-authored-by: Rocky <25568640+rockindahizzy@users.noreply.github.com>
2022-08-26 12:36:05 -05:00
Emily Rohrbough
9ba71c6093 perf(cy.session): keep page state after validation runs (#23503) 2022-08-26 12:22:50 -05:00
Jordan
5db08bc6ac chore: rename types, add comments 2022-08-23 20:03:33 -04:00
Jordan
a07a2a118d fix(webpack-dev-server): add custom project config to handler 2022-08-23 10:18:38 -04:00
Rachel
ab23d7797b chore: skip or fix flaky tests II (#23386)
* fix leftover percy network-idle-timeout

* Skip another instance of 23153

* fix 23147

* Revert fix 23147

* try percy upgrade again

* Update yarn.lock

* skip 23404

* bring in emilys override version change for percy ui

* skip 23406

* skip 23407

* downgrade percy to 1.2.0

* fix percy diff

* fix percy diff

* update comment

* restore lock file

* Update yarn.lock

* Update yarn.lock

* percy fixes

* possible fix

* fix verison flake??

* Revert "fix percy diff"

This reverts commit e4c4e2e990.

* Revert "Revert "fix percy diff""

This reverts commit 94284e4694.

* Remove version assertion

* Trigger Build

* ignore spec duration in percy snapshots

* use .each to preserve order of execution

* add comment

* fix comment

* try new logic for header wait

* Revert "try new logic for header wait"

This reverts commit bfed31edce.

* add timeout to choose a browser

* Trigger Build

* try without promise.all; revert timeout to choose a browser tests

* ignore spec-duration in percy in runner

* clean up .thens

* clean up diffs

* move around .thens

* wait for tooltip to take snapshot, skip flakers

* try hiding spec duration

* Revert: try hiding spec duration

* Bring back duration mock

* Add another duration mock

* try cy.contains with tooltip, comment out removeGlobalStyles

* skip 23417

* skip choose a browser failures

* skip 23419

* skip 23414

* bring back // removeGlobalStyles()

* skip 23422

* skip 23423

* skip 23424

* set version to empty string to make percy happy

* Remove duration mock

* Do not display top-nav-cypress-version-current-link, skip 23433?

* skip 23434, clean up diffs

* clean up diffs, skip percy flake

* skip 23434

* skip 23437

* fix 23156

* fix 23250 and similar

* fix 23157

* skip more percies

* skip 23443

* skip more tooltip snapshots

* Update net_stubbing.cy.ts

* Update cookies.cy.js

* Update e2e_cookies.cy.js

* add missing github issue

* Update circle.yml

* Skip all of network stubbing

* Skip 23158

* Skip 23448

* remove unnecessary async, add skip for 23444

* more skips for 23444

* skip 23451

* More skips 23436

* More skips 23444

* skip 23455

* more skips 23444

* skip 23457

* more skips 23444

* mroe skip 23455

* Trigger Build

* skip set cookie 23444

* skip 21300

* skip 23417

* Trigger Build

* potential fix for 23308

* skip 23472

* skip snapshot

* skip 23474

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* skip more 23245

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* skip 23480,23481

* skip 23307

* Trigger Build

* addtl skip 23481

* skip 23484

* try cy.origin stability fix on nav commands issue

* Revert: try cy.origin stability fix on nav commands issue

* skip more 23452

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* skip 23493

* Trigger Build
2022-08-22 10:50:12 -07:00
Adam Stone
03182625cf feat: Enable create from Vue component for projects with custom spec patterns (#23298) 2022-08-18 11:00:29 -04:00
Emily Rohrbough
ae5cbb592d fix: persist registered spec sessions (#23347) 2022-08-16 09:27:28 -05:00
Lachlan Miller
91beb9012c feat: experimental single tab run mode for component testing (#23104)
* revive logic to run CT in a single tab

* add feature flag: experimentalSingleTabRunMode

* remove log

* reset browser state between tests

* document single tab run mode experiment;

* add system test for experimental run mode

* fix snapshots

* use more simple project for testing

* additional guard;

* fix test

* Apply suggestions from code review

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>

* destroy aut after each spec

* update snapshot

* fix types

* add experiment flag error

* add warning when using experimental flag with e2e

* build binaries for experimentalSingleTabRunMode feature

* build binaries take 2

* make error message more open ended

* destroy AUT later in run mode lifecycle

* add additional assertion around experimental flag

* simplify error

* remove test code from production code

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
2022-08-16 10:44:14 +10:00
Zach Bloomquist
4580330763 chore: WebKit support (development-only) (#15533) 2022-08-15 22:53:37 +00:00
Bill Glesias
17f430768b Merge branch 'master' into develop 2022-08-15 12:29:07 -04:00
Rachel
c40a120aa7 chore: skip or fix flaky tests (#23167) 2022-08-15 08:50:34 -07:00
Tyler Biethman
e80e4e8334 fix: remove working directory from --spec glob patterns (#23296)
* fix: remove working directory from glob patterns

* Adding a few specs to FileDataSource

* Cleaning up leaky stubs

* Adding little system test

* Get mac binary too
2022-08-15 16:57:05 +10:00
Emily Rohrbough
f1122fcf62 fix: clear session state when changing specs in open mode (#23146) 2022-08-12 13:00:01 -05:00
Emily Rohrbough
0729a6833b feat: add testIsolation option and support describe-only overrides (#23040)
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
Co-authored-by: Bill Glesias <bglesias@gmail.com>
Co-authored-by: Matt Henkes <mjhenkes@gmail.com>
2022-08-12 11:56:39 -05:00
Emily Rohrbough
0129a80883 fix: cypress hang caused in run mode when test:before:run handler throws (#23226)
Co-authored-by: Matt Henkes <mjhenkes@gmail.com>
2022-08-10 14:53:05 -05:00
Lachlan Miller
3e76ed0523 chore: add warning encouraging react users to update mount function (#23182)
Co-authored-by: Zachary Williams <ZachJW34@gmail.com>
2022-08-10 12:27:10 -05:00
rockindahizzy
eab950bec0 fix(react18): unmount component with react18 API (#23204)
* fix(react18): unmount component with react18 API

* Add null check and explicit typing per code review

* update snapshots and make code more concise

Co-authored-by: Zachary Williams <zachjw34@gmail.com>
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
2022-08-10 21:50:28 +10:00
Adam Stone
7ef6f972aa feat: Create spec from Vue component (#22898)
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
Co-authored-by: Zachary Williams <ZachJW34@gmail.com>
2022-08-09 11:50:27 -04:00
Matt Schile
453f53f070 chore: Updated UI styling for Cypress about:blank pages (#23095)
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
2022-08-09 10:21:15 -05:00
Jordan
d201b37b3d feat: add template support, teardown & standalone (#23117)
Co-authored-by: Jordan <jordan@jpdesigning.com>
Co-authored-by: Zachary Williams <zachjw34@gmail.com>
Co-authored-by: Zachary Williams <ZachJW34@gmail.com>
2022-08-08 09:38:52 -05:00
Zachary Williams
20f89bfa32 fix: remove dependency causing semantic-release to fail (#23142) 2022-08-05 15:54:44 -05:00
Adam Murray
915859c1a7 fix(cypress/schematic): add --e2e option. ensure binary is installed in Angular 14 (#22922)
Co-authored-by: Zachary Williams <zachjw34@gmail.com>
2022-08-04 10:45:51 -05:00
Lachlan Miller
cbb5e35762 feat: warn when detecting unsupported dependencies for component testing (#22964)
* wip: basic implementation

* update dependencies to have maxVersion

* handle promises correctly

* fix test

* update test project and styling

* only check for CT deps in CT

* install required deps

* revert

* rework detection and extend tests

* remove unused code

* remove more code

Co-authored-by: Zachary Williams <ZachJW34@gmail.com>
2022-08-01 11:40:52 +10:00
Zachary Williams
a7b140d438 feat: add angular-ct project setup (#22897) 2022-07-28 11:14:37 -05:00
rockindahizzy
72078ef3d2 fix: Throw error when custom config file does not return expected value (#22927)
* fix: Throw error when custom config file does not return expected value

* Improve test to avoid false positive

* Code review changes

* remove old code

* remove unused yarn.lock

Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
2022-07-28 10:19:39 +10:00
Lachlan Miller
6adba462ea feat: update to Vite 3 (#22915)
* chore: do not rely on transitive dep. from npm/react

* chore: bump to vite 3.0.2

* revert

* target es6

* remove unused code

* update styles

* remove ts-ignore

* bump to vite 3.0.3
2022-07-28 10:00:31 +10:00
Emily Rohrbough
b0590a1505 style: update session verbiage & styles and update alias styles (#22857)
Co-authored-by: Bill Glesias <bglesias@gmail.com>
2022-07-27 13:07:02 -05:00
rockindahizzy
952a9aad86 chore: fix glob pattern for system tests (#22918)
* chore: Adjust system test glob pattern for m1

* Address windows issue and add branch to windows workflow
2022-07-27 09:51:18 +10:00
Jordan
4131b1fa84 feat(angular): angular mount (#22858)
Co-authored-by: Zachary Williams <zachjw34@gmail.com>
2022-07-26 17:44:44 -05:00
renovate[bot]
7c3a4f8bb6 chore(deps): update dependency nock to v13.2.9 🌟 (#22854)
* chore(deps): update dependency nock to v13.2.9 🌟

* chore: update nock api from v12 to v13 by changing socketDelay to delayConnection. See https://github.com/nock/nock/releases/tag/v13.0.0 for more details

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Bill Glesias <bglesias@gmail.com>
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
2022-07-25 15:17:32 -04:00
Emily Rohrbough
65d29cdcf3 chore: remove dead server code (#22902) 2022-07-25 10:29:14 -05:00
Jordan
dc5d9de290 feat(webpack-dev-server): add angular handler (#22314)
Co-authored-by: Zachary Williams <zachjw34@gmail.com>
2022-07-22 13:41:23 -05:00