Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add documentation for experimentalOriginDependencies #4897

Merged
merged 4 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions content/api/commands/origin.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,18 +408,28 @@ packages and other files.

<Alert type="warning">

Using `import()` and `require()` within the callback requires version 5.15.0 or
greater of the
Using `import()` and `require()` within the callback requires requires enabling
mschile marked this conversation as resolved.
Show resolved Hide resolved
the [`experimentalOriginDependencies`](/guides/references/experiments) flag in
the Cypress configuration and using version 5.15.0 or greater of the
mschile marked this conversation as resolved.
Show resolved Hide resolved
[`@cypress/webpack-preprocessor`](https://github.com/cypress-io/cypress/tree/master/npm/webpack-preprocessor).
This is included in Cypress by default, but if your project installs its own
version of `@cypress/webpack-preprocessor` that is set up in your Cypress
config, make sure it is version 5.15.0 or greater.
The `@cypress/webpack-preprocessor` is included in Cypress by default, but if
your project installs its own version in the Cypress configuration, make sure it
is version 5.15.0 or greater.
mschile marked this conversation as resolved.
Show resolved Hide resolved

If using an older version of the webpack or a different preprocessor, you'll see
an error that includes the following text:

_Using require() or import() to include dependencies requires using the latest
version of @cypress/webpack-preprocessor._
_Using `require()` or `import()` to include dependencies requires enabling the
`experimentalOriginDependencies` flag and using the latest version of
`@cypress/webpack-preprocessor`._
AtofStryker marked this conversation as resolved.
Show resolved Hide resolved

</Alert>

<Alert type="warning">

Using `require()` or `import()` within the callback from a `node_modules` plugin
is not currently supported. We anticipate to add support with issue
mschile marked this conversation as resolved.
Show resolved Hide resolved
[#24976](https://github.com/cypress-io/cypress/issues/24976).

</Alert>

Expand Down
11 changes: 6 additions & 5 deletions content/guides/references/experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ creating `e2e` and `component` objects inside your Cypress configuration.
These experiments are available to be specified inside the `e2e` configuration
object:

| Option | Default | Description |
| ------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| `experimentalStudio` | `false` | Generate and save commands directly to your test suite by interacting with your app as an end user would. |
| `experimentalRunAllSpecs` | `false` | Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially. |
| Option | Default | Description |
| -------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| `experimentalStudio` | `false` | Generate and save commands directly to your test suite by interacting with your app as an end user would. |
| `experimentalRunAllSpecs` | `false` | Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially. |
| `experimentalOriginDependencies` | `false` | Enables support for `require`/`import` within `cy.origin`. |

### Component Testing

Expand All @@ -57,7 +58,7 @@ configuration object:

| Version | Changes |
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [12.0.0](/guides/references/changelog#12-0-0) | Removed `experimentalSessionAndOrigin` and made it the default behavior. |
| [12.0.0](/guides/references/changelog#12-0-0) | Removed `experimentalSessionAndOrigin` and made it the default behavior. Added `experimentalOriginDependencies`. |
| [11.2.0](/guides/references/changelog#11-2-0) | Added `experimentalRunAllSpecs`. |
| [10.8.0](/guides/references/changelog#10-8-0) | Added `experimentalWebKitSupport`. |
| [10.6.0](/guides/references/changelog#10-6-0) | Added support for `experimentalSingleTabRunMode`. |
Expand Down