Commit Graph

469 Commits

Author SHA1 Message Date
Emily Rohrbough 1a80427537 chore: remove stale snapshots & duplicate tests (#28741) 2024-01-17 21:15:42 -06:00
Jim Hays 34c8b1f884 refactor: Spellcheck (#27964)
Co-authored-by: Matthew Schile <mschile@cypress.io>
2023-10-11 10:06:10 -04:00
Adam Stone-Lord ae4cf2b553 chore: add driver, reporter, config as implicit dependencies for runner package (#27559) 2023-08-16 00:21:41 -04:00
Bill Glesias 9dd8c72134 chore: bump loaders and optimize webpack configuration (#27505)
* chore: update ts-loader from v8 to v9

* chore: update sass-loader from v10 to v13

* chore: update postcss-loader from v4 to v7

* chore: update mini-css-extract-plugin from v1 to v2

* chore: update html-webpack-plugin from v4 to v5

* chore: update css-loader from v5 to v6

* chore: update copy-webpack-plugin from v6 to v 11

* chore: update babel and babel loader to latest

* chore: remove Url import from validation as it should be available globally

* chore: update coffee-loader to latest and coffeescript to 2.6.0. coffee
script > 2.6.0 has issues with packheard transpilation, which likely
isnt worth the squeeze here to update it further

* chore: fix react component tests with webpack 4 as babl loader 9 only works with webpack 5, so we need ot pin the dep to 8 in the system-test project

* chore: remove dependency on file-loader and opt for ubilt in assert handling where applicable. Additionally, remove react-svg-loader and move to svgr loader inside the runner to bundle svgs needed for react components. Make sure that all SVGs are being imported correctly

chore: tell webpack preprocessor to process svgs inside of e2e tests for
the reporter. We did not need this before because we were using
react-svg-loader, which was used directly in source to process the svg
and allowed the svg to work under test. Since the source code is now
bundler independent, we need to tell cypress to bundle the svgs under
test. To do this, we pass our webpack config into
@cypress/webpack-preprocessor to allow loading the svgs. This is not a
breaking change.

* chore: switch from hash to contenthash

* chore: remove use of moduleIds for chunkIds as the defaults are likely better and handle caching/debugging better

* chore: mark tests that need to be updated as node 12 and 14 are no longer supported. node 12 doesnt ship with fs/promises, which causes fatal errors with babel-loader 9

try to test against new docker images [run ci]

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* skip http/https form submittal unit tests for experimental webkit due to the clientRoute 404ing after submitting

* chore: pin webpack 5 for component tests in cy in cy to prevent using 4 from hoisted deps [run ci]

* build binaries [run ci]

* chore: bump circle cache [run ci]

* fix: turn off svgo from @svgr/webpack to preserve our scss class names within the svg. see https://react-svgr.com/docs/options/#svgo [run ci]

---------

Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com>
2023-08-11 13:54:50 +10:00
Bill Glesias 171d1fa646 chore: update to webpack v5 (#27438)
* chore: [run ci] does further prerequisites for webpack 5:
https://webpack.js.org/migrate/5/#make-sure-your-build-has-no-errors-or-warnings
https://webpack.js.org/migrate/5/#make-sure-to-use-mode
https://webpack.js.org/migrate/5/#update-outdated-options
https://webpack.js.org/migrate/5/#test-webpack-5-compatibility
app builds and runs locally. Time to test out in CI and see if buffer or
process need to be polyfilled by the build

* chore: upgrade to webpack 5 and do the bare minimum to get it working

* chore: get @packages/extension working

* chore: add TODOs to finish after webpack 5 update

* chore: update the webpack config for npm/webpack-batteries-included-preprocessor to be webpack 5 compliant

* chore: patch whatwg-url 7.1.0. package 'source-map' uses
whatwg-url@7.1.0 which has a dependency on punycode node expected API.
since punycode is now polyfilled for us implicitly via the punycode npm
package, the API signatures are a bit different
https://github.com/mathiasbynens/punycode.js/blob/main/punycode.js#L101
vs https://nodejs.org/api/punycode.html#punycodeucs2. The patch uses the
punycode npm package expected API and is needed for source maps to work
for cy.origin() dependencies for Cypress.require()

* chore: convert whatwg patch into dev patch as source-map is not installed when building the binary / installing prod dependencies

* chore: only move production level patches into the binary dist directory for yarn install --production

* chore: remove --openssl-legacy-provider code for node versions 17 and over as webpack has been updated to v5

* chore: fix the webpack-batteries-included-preprocessor tests by shimming the correct node globals and built ins

* chore: provide the define plugin and evalDevtoolPlugin again as we need define in order to build the react-dom library correctly in the bundle to not include the development version

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: fix the webpack preprocessor not to change promise references under the hood when compiling the first bundle, as it was causing the webpack preprocessor to hang as the reference itself was different

* chore: fix issues from readFile that were caused by Webpack 5 using 'path-browserify'

* chore: update chrome component testing snapshots to match Webpack 5 changes

* chore: fix mismatched snapshots from webpack 5 update

* chore: use Cypress.Buffer instead of Buffer for selectFile system test to avoid having to polyfill Buffer from webpack

* chore: fix system test webpack path that now includes e2e workspace

* chore: patch enhanced-resolve to properly discover the pnp api for the yarn_v3.1.1_pnp_spec.ts system test. see https://github.com/webpack/enhanced-resolve/issues/263 for more details

* chore: set stats to 'none' for experimentalSingleTabMode to prevent different webpack compiled terminal formatting in the snapshot between local and CI.

* chore: fix node built in tests and configure webpack-batteries-included-preprocessor correctly

* chore: fallback to buffer correctly in config, even though there is no impact due to the provide plugin

* Update binary-cleanup.js to exclude added build dependencies for webpack
5 added by webpack-terser-plugin under the hood

* chore: add stream-browserify to webpack preprocessor batteries included as a dep as its used in the config [run ci]

* chore: make sure process and buffer are installed in the CLI for webpack provide

* chore: build cross platform binaries [run ci]

* chore: fix webpack evalDevToolPlugin instantiation [run ci]

* run all binary jobs [run ci]

* chore: updating v8 snapshot cache

* add find-up to the entry points that need to be kept

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: fix mocha build warnings

* chore: fix STRIPPED_INTEGRITY_TAG import warnings

* chore: add changelog event

---------

Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
2023-08-09 11:59:36 -04:00
Bill Glesias f1454dd0d1 chore: upgrade webpack dependencies to latest v4 compatible (#27396)
* chore: upgrade webpack dependencies to latest sub 5 compat [run ci]

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: build binaries [run ci]

* chore: update snapshot for darwin

* chore: downgrade tsconfig-paths-webpack-loader from v4 to v3 [run ci]

* [run ci]

* chore: add rimraf in @packages/runner to use in prebuild command to clear out dist directory to get windows compat [run ci]

* don't pass -rf flags into rimraf as it is inherit with the command

---------

Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com>
2023-07-31 14:19:11 -04:00
Bill Glesias 2e092add12 perf: no longer pause every single request through CDP and only pause requests needed for AUT document [run ci] (#26623) 2023-07-21 13:38:35 -04:00
Mike Plummer 91cbc6741c chore: Update Vite to 4.3.0 (#26553)
Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com>
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
2023-04-27 15:09:31 -05:00
Emily Rohrbough f49e25322c chore: list rimraf dev-dependency once in repo (#26257) 2023-03-28 20:49:09 -05:00
Bill Glesias 59c1175065 chore: improve types for server automation cookie client (#25836)
* chore: improve types for automation cookies

* [run ci]
2023-02-20 14:52:38 -05:00
Bill Glesias ab60ed4079 fix: duplicate and expired cookies (#25761)
* chore: add regression tests for duplicate cookies and bad expiry times

* avoid prepending domain with dot for cookies that are set with the server side jar. This is to avoid the cookie being duplicated if it is set or overridden in a different context (request that can actually set the cookie or via document.domain)

* feat: use cookie.toString() in the cookie patch to more accurately set cookies on the document, which should include other properties besides key=value

* fix: add logic to handle expired cookies in the document.cookie patch, as well as in CDP

* chore: build binary for cookie fixes for users to test

* chore: change name of fixture to something more accurate

* chore: comment why we are using the toughCookie toString method in the patch

* [run ci]

* chore: add changelog entry

* [run ci]

* fix: revert back to key=value when getting document.cookie as those are the only values are displayed (oversight on my end)

* [run ci]

* chore: make compatible with cypress.require

* fix: add tests for hostOnly/non hostOnly cookies to make sure property gets sent up to automation client correctly. No longer need custom cookie prop to determine destination

* [run ci]

* fix: stale unit test

* chore: adjust comments

* [run ci]

* fix: bad domain logic

* [run ci]

* chore: remove irrelevant comment

* [run ci]

* fix: adjust cookie login text to spec hostOnly cookie within the cookie patch. This should yield the same behavior as we are bound to same origin within the spec bridge

* [run ci]

* [run ci]

* fix: allow for cookies on request of same key to take precedence over cookies in the jar, regardless of how many hierachy cookies exist in the jar

* chore: fix cookie misc tests for cy.origin (dont run cy.origin)

* [run ci]

* chore: skip misc cookie tests in webkit as headless behavior doesn't clear cookies between tests correctly

* Revert "fix: allow for cookies on request of same key to take precedence over cookies in the jar, regardless of how many hierachy cookies exist in the jar"

This reverts commit 17de1883ab.

* [run ci]

* chore: split changelog entry into two parts

* chore: update logic to remove else statement and add comments

* [run ci]

* chore: readd windows snapshot branch in workflows

* [run ci]

* chore: fix workflows from bad merge

* [run ci]

* Revert "chore: split changelog entry into two parts"

This reverts commit 4352ef5f3e.

* [run ci]
2023-02-16 09:34:03 -05:00
Kukhyeon Heo af0da61b8c chore: Migrate AssertionsOptions menu to Vue. (#24286)
* React to vue

* Goodbye dom.

* Use event modifier.

* Remove leading underscore in names

* Use modifier.

* Add flip, shift options.

* Use createPopper instead of floating-ui.

* Remove unnecessary dependencies.

* addAssertion to event.

* setPopperElement to event.

* Strong types.

* clarify test.

Co-authored-by: Blue F <blue@cypress.io>
2022-12-24 07:28:41 +10:00
Zach Bloomquist e02f6bf905 feat: add resourceType support to cy.intercept() on req/routeMatcher (#25075)
Co-authored-by: Bill Glesias <bglesias@gmail.com>
2022-12-14 17:40:53 +00:00
Jordan ed90b14d4f refactor: move linting to each lib to enable caching (#24424) 2022-11-17 17:31:19 +10:00
Chris Breiding bf2fc3a848 feat: Add domain option to cookie commands (#24471) 2022-11-04 14:32:59 -04:00
Matt Henkes 208efbfb4e fix: Use post message instead of web sockets for spec bridges. (#24243)
* fix: spec bridges no-longer create their own spec bridge but instead use post message to communicate with the primary instance.

* fix test errors

* fix tests, ignore change to cookie

* Move patch code into injection

* Code cleanup

* Fix most failing tests

* Enable patching for both spec bridges and the primary cypress instance.

* clean up

* Updates from self PR review

* Remove before each limiting spec bridges.

* rename attach function

* whoops, better call the function with the correct parameters

* Apply suggestions from code review

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

* Update packages/driver/src/cross-origin/communicator.ts

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

* Apply suggestions from code review

* Apply suggestions from code review

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

* updated test name

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Co-authored-by: Bill Glesias <bglesias@gmail.com>
2022-10-19 13:17:52 -05:00
Chris Breiding f9272bbd22 fix: Improve document.cookie patch (#23643) 2022-10-18 17:38:56 -04:00
Kukhyeon Heo 0bb705c185 chore: Migrate react Highlight component to Vue (#23973)
* add test.

* Add Highlight vue component + remove react component.

* Remove floating-ui dependency.

* fix test failure

Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
2022-10-11 14:41:54 -04:00
Bill Glesias 695dd275bc feat: same origin spec bridges (#23885)
* chore: enforce strict origin spec bridges

chore: refactor spec bridges to strictly enforce same origin

fix: wrap fullCrossOrigin injection around feature flag inside buffered response

* fix: do NOT set the initial cypress cookie inside the spec bridge as it is sending unecessary cookies

* chore: simplify the finding cypress in the injection code

* chore: change order in which callback fn is declared

* chore: add spec bridge performance issue to validation tests
2022-10-04 18:26:04 -04:00
Emily Rohrbough 63b1a9560d chore: delete ui-components package (#23950)
* chore: delete ui-components package

* add dependency to frontend-shared that was previously provided by ui-components

* whoops

* fix deps
2022-09-27 10:19:10 +10:00
Kukhyeon Heo 17556de482 chore: migrate runner/dom.js to app part 1 (#23792)
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2022-09-23 11:49:50 -04:00
Emily Rohrbough 344ee2145e Merge branch 'develop' into cache-sessions-server 2022-09-15 13:08:47 -05:00
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
Emily Rohrbough 81f24cb2ea and this was removed / unused 2022-09-14 15:15:11 -05:00
Emily Rohrbough 821150517d Merge branch 'develop' into cache-sessions-server
# Conflicts:
#	packages/app/src/runner/event-manager.ts
#	packages/runner/src/studio/studio-recorder.js
#	packages/types/src/driver.ts
2022-09-14 11:49:59 -05:00
Rachel 406eb069a6 fix: issue-7715 (#23575)
Co-authored-by: Chris Breiding <chrisbreiding@gmail.com>
2022-09-09 11:36:19 -07: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
Emily Rohrbough 192ae6ce75 no ci 2022-08-29 16:16:18 -05:00
Kukhyeon Heo 2d119ad46a chore: Intregrate runner packages. (#23028)
* chore: Intregrate runner packages.

* Remove unnecessary Studio react files.

* Remove unnecessary gif

* runner-shared to runner-ct.

* fix path.

* fix package.json

* Remove scss files from runner-ct

* Remove runner-ct

* Remove runner-shared and runner-ct comments.

* Feedback

* chore: reduce parallelism for reporter-componen-tests

* chore: reduce paralelleism

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
2022-08-11 14:07:10 +10:00
Bill Glesias 5ff15046e2 feat: add experimentalModifyObstructiveThirdPartyCode flag for regex rewriter (#22568) 2022-07-22 08:30:20 -06:00
Chris Breiding 5573fe50b0 fix: Make cross-origin document.cookie work (#22594) 2022-06-30 14:03:21 -04:00
Bill Glesias e18819d6a0 chore: remove old runIsolated in the runner, as well as clean up old runner related dependencies (#21638) 2022-06-06 11:16:15 -04:00
Zachary Williams e4873649c1 Merge remote-tracking branch 'origin/develop' into zachw/merge-develop-10.0 2022-05-24 10:30:14 -05:00
Matt Schile 53030b79f6 feat: (origin) handle waiting for aliased intercepts (#21579) 2022-05-24 09:02:01 -06:00
Zach Bloomquist 8043405688 Merge remote-tracking branch 'origin/develop' into 10.0-release 2022-05-19 09:56:39 -04:00
Bill Glesias 045ad04cbd fix: electron slowness within cy origin (#21445)
* fix iframe performance issues in electron

* reduce 1000ms to 300ms for cross:origin:release:html

* reduce shouldWithTimeout from 3000ms to 250ms

* Update system-tests/projects/e2e/cypress/e2e/spec_bridge.cy.ts

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

* add some regression tests around screenshot size when taking screenshots within cy.origin

* move screenshot e2e tests from system-tests into the driver

* move spec bridge system test into driver test

* add additional comments to spec bridge iframe scss for caution

* resolve snapshots directory correctly in open vs run mode

* revert this commit to see if assets are being tampered with or just missing in CI

* fix check:screenshot:size to always point to correct screenshot path

* remove isCypressRunMode from cypress config as internal flag as we no longer need it

* add check:screenshot:size to task.cy.js registered plugin assertion

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2022-05-17 12:03:45 -04:00
Kukhyeon Heo 38bd1bb048 chore: improve pkg/driver types (#21197)
Co-authored-by: Zach Bloomquist <git@chary.us>
Co-authored-by: Blue F <blue@cypress.io>
2022-05-13 18:57:12 +00:00
Zachary Williams 0f786ab893 fix: ct testing support for node 17+ (#21430) 2022-05-13 11:01:30 -05:00
Emily Rohrbough 599e0c859a fix(sessions): refactor flows, fix grouping bugs and align validation fail text (#21379)
* chore(sessions): break out sessions manager code

* manager manages registered sessions

* some unit tests

* add more tests and some slight clean up

* .

* fix run mode issue.

* bind correctly for spies

* remove types. not sure on the return values.

* fix tests

* check in dump

* add some command tests

* more driver tests and fix session config error

* Fix parsing error argument

* test for failed validation error messges

* wait for diff pr

* update ui tests

* add more ui tests

* align with 10.0 test setup

* clean up

* will add later

* fix

* fix tests

* baseline for session flow tests

* test for logs...lots here....

* update log attrs to be able to collect session logs for tests

* refactor flows, fix grouping bugs and align validation fail text

* update UI test these changes fixed.

* fix test failures observed in run mode

* reduce flake in log updates
2022-05-11 08:11:24 -05:00
Bill Glesias 04dc2e3130 Merge branch '10.0-release' of github.com:cypress-io/cypress into md-10.0-merge 2022-05-06 10:07:06 -04:00
Emily Rohrbough dbbad318aa chore(sessions): add additional tests (#21338) 2022-05-05 18:21:15 -05:00
Zach Bloomquist c336d7da5c chore: remove unused parts of design-system, move SCSS to runner-ct (#21345) 2022-05-05 23:02:43 +00:00
Bill Glesias 373ed05298 Merge branch 'develop' into md-10.0-merge 2022-05-02 12:26:58 -04:00
Bill Glesias 7e79860466 Merge branch '10.0-release' of github.com:cypress-io/cypress into md-10.0-merge 2022-04-29 10:41:47 -04:00
Bill Glesias bbd9e7f1b2 Merge branch 'develop' into md-10.0-merge 2022-04-29 10:39:54 -04:00
Bill Glesias bc01e44338 chore: rename multi-domain to origin paradigm (#21231) 2022-04-28 15:19:40 -04:00
Emily Rohrbough 1232b07d4f feat(Unification): Update Command Group UI (#20465) 2022-04-27 10:23:39 -05:00
Chris Breiding 3e6d6bfe15 chore: Updates based on PR feedback (#21137)
* add generic to cy.origin type

* fix log type, update/add comments

* fix comment indentation

* specific generic

* move RemoteState to internal types

* add on links to experimental flag descriptions

* chore: reduce nesting by flipping condition

* fix test title

* simplify failing log

* rename variable

* delete error property

* fix types

* fix type

* remove unnecessary todo

* update wait test

* jquery -> this

* update comment

* remove vestigial autoRun

* use finally

* re-throw non-security errors

* move back getting index

* add new state types

* remove unnecessary export

* startsWith -> includes

* it -> them

* update system test

* remove use of promise constructor

* Revert "remove use of promise constructor"

This reverts commit 35ccc28b6f.

* log errors from Page.getFrameTree

* test if anything breaks when removing optional chaining operator

* remove vestigial file

* handle queue ending in cross-origin driver

* fix coordinates spec

* improve chrome/firefox check in extension

* improve secure cookie regex

* use production mode for cross-origin driver bundle

* adding remoteStates.getPrimary

* catch and ignore queue errors

* remove optional chaining in postMessage handler

* removed unnecessary async

* update frame tree on cri client reconnect

* fix formatting

* renaming remoteStates variable

* prevent requests from being paused if experimentalSessionAndOrigin flag is off

Co-authored-by: Matt Schile <mschile@cypress.io>
2022-04-22 14:58:02 -05:00
Bill Glesias a1101e6562 feat: support snapshots and console props within multi-domain (#20949)
* Empty commit to get a new percy nonce

* Implement snapshots and consoleprops within multi origin

further progress with getters

cleaned up log/snapshot serialization

attempt to pass and hydrate value state of serialized dom elements

temp commit traversal dom

by some stretch of a miracle this is working...

still somehow working

after massive performance issues with full tree serialization, fix here is to just attach values to inputs for reifying on primary

now we are cookin

test WIP

tests WIP

working multi-domain actions snapshots tests

added more tests to verify snapshots

add tests and refactor certain tests to make simpler

added misc snapshot tests

add navigation snapshot placeholder

add network request snapshot tests

add shadow querying snapshot tests

update test names

added snapshot querying spec

added screenshot snapshot test

add spies,clocks, and stubs tests

implement snapshot tests for traversal commands

rename local storeage snapshot tests to fit convention

add viewport snapshot tests

rename snapshot traversal to fit naming convention

add snapshot waiting tests

added window snapshot tests

implement navigation snapshot tests now that sinon proxy issues internal to log are now fixed

refactor multi-domain snapshot tests to leverage utility method over redefining in each spec

* fix lint types issues on serializationKeys

* rename switchToDomain to origin (might help with failing tests... ya know?)

* rename snapshot files to fit origin paradigm and fix misname on primaryDomainCommunicator

* fix .tick() snapshot/consoleProps test (figure out the deal with consoleProps sometimes being a function)

* rename multiDomainCommunicator to origin primaryDomainCommunicator

* don't invoke functions with arguments (we need to be more explicit about the functions we are invoking

* opt for my explicit serialization behavior with functions, never attempt to serialize bluebird promises

* move serialization to folder and change name to index

* refactor log serialization to own file, clean up code and add comments to what is going on in this 'here be dragons' code

* make sure to serialize functions for snapshots

* fix pause snapshot test for multi origin

* refactor postprocess snapshot into own method to handle in final state snapshot processing for cross origin

* update snapshot comments to be more accurate

* fix renamings within tests

* fix path in log.ts serialization

* revert about:blank changes in aut-iframe which was breaking session

* move all log/snapshot serialization magic invokations into the communicator

* update typos and fix namings of preprocess and reify

* further name changes

* fix snapshot generator to always reify snapshot (<body>) over attempting to match in the DOM

* unskip test that was fixed with explicit function serialization for logs

* fix flaky screenshot test that was screensize dependent

* rename a few items in the log serialization file

* clean up snapshot style reification to be more straightforward and remove redundancies

* refactor snapshots code to be more readable

* update reifyDomElement docs to actually explain what hte method does

* fix typos within the log serialization file pertaining to comments

* use Cypress._ over lodash import to reduce spec bundle size

* remove snapshots test folder and migrate tests into commands directory with #consoleProps context blocks for each

* change removeSrcAttributeFromAUTIframe name to removeSrcAttribute as it is implied on the AUT

* update log consoleProps comment to better reflect cross origin nature

* remove skipped consoleProps tests that do not have a command log to test against

* add createSnapshot to internal types (might need more specifics on this)

* refactor multi-domain consoleProp tests to use shouldWithTimeout custom command to avoid setTimeouts on command queue event to make test implementation cleaner

* simplify DOM hydration for input based elements

* update preprocessedHTMLElement type

* clean up some documentation and remove TS ignores. added getStyles to internal-types.

* add comment to aut-iframe on src attr removal for posterity

* reverse snapshot ternary for readability

* add shouldWithTimeout into spec-types and refactor out of internal-types

* add getAll type to cypress spec-types

* compare originPolicy of top and AUT instead of just origin to make snapshots work in subdomains

* add comment to _storeOriginalState for future developers and to add clarity

* add some basic log serialization tests that show full pre/reification of log, as well as state hydration for innerHTML. break out object/array methods from log like serialization into own methods

* update variables to metasyntactic

* add renderProps assertion for cy.request

* apply suggestions from code review to clean up log serializer

* make snapshot serialization more generic and typesafe

* work around firefox 93 issues by unsetting the document in cy state as the document is in a cross origin context in the primary, which means accessing any elements will not work

* clean up code and implement suggestions in code review

* remove crossOriginLog in favor of nullish coalescing if visible on the log is not set

* if get is null, return null for whole snapshot

Co-authored-by: Ryan Manuel <ryanm@cypress.io>
Co-authored-by: Matt Henkes <mjhenkes@gmail.com>
2022-04-22 10:30:40 -04:00
Matt Schile f819be315a Merge branch 'develop' into feature-multidomain 2022-04-21 09:53:49 -06:00