question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect Configuration error with testIsolation setting when experimentalSessionAndOrigin is true

See original GitHub issue

Current behavior

If you have a config like this:

const { defineConfig } = require("cypress");

module.exports = defineConfig({
  e2e: {
    experimentalSessionAndOrigin: true,
    testIsolation: "off",
  }
});

Then running Cypress works just fine.

*However, if you make ANY change to the config, then you’ll get an error:

Your configFile at <path>cypress.config.js set an invalid value:

Expected e2e.testIsolation to be not set unless the experimentalSessionAndOrigin flag is turned on.

Instead the value was: “off”

Error
    at C:\Users\myuser\AppData\Local\Cypress\Cache\10.11.0\Cypress\resources\app\packages\data-context\src\data\ProjectConfigManager.js:272:41
    at C:\Users\myuser\AppData\Local\Cypress\Cache\10.11.0\Cypress\resources\app\packages\config\src\browser.js:121:24
    at C:\Users\myuser\AppData\Local\Cypress\Cache\10.11.0\Cypress\resources\app\node_modules\lodash\lodash.js:4967:15
    at baseForOwn (C:\Users\myuser\AppData\Local\Cypress\Cache\10.11.0\Cypress\resources\app\node_modules\lodash\lodash.js:3032:24)
    at C:\Users\myuser\AppData\Local\Cypress\Cache\10.11.0\Cypress\resources\app\node_modules\lodash\lodash.js:4936:18
    at Function.forEach (C:\Users\myuser\AppData\Local\Cypress\Cache\10.11.0\Cypress\resources\app\node_modules\lodash\lodash.js:9410:14)
    at validate (C:\Users\myuser\AppData\Local\Cypress\Cache\10.11.0\Cypress\resources\app\packages\config\src\browser.js:111:29)
    at ProjectConfigManager.validateConfigFile (C:\Users\myuser\AppData\Local\Cypress\Cache\10.11.0\Cypress\resources\app\packages\data-context\src\data\ProjectConfigManager.js:268:31)
    at ProjectConfigManager.initializeConfig (C:\Users\myuser\AppData\Local\Cypress\Cache\10.11.0\Cypress\resources\app\packages\data-context\src\data\ProjectConfigManager.js:82:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at ProjectLifecycleManager.refreshLifecycle (C:\Users\myuser\AppData\Local\Cypress\Cache\10.11.0\Cypress\resources\app\packages\data-context\src\data\ProjectLifecycleManager.js:271:9)

You have to restart Cypress for it to work again.

Desired behavior

The error is incorrect as experimentalSessionAndOrigin is true. So it just shouldn’t error.

Test code to reproduce

const { defineConfig } = require("cypress");

module.exports = defineConfig({
  e2e: {
    experimentalSessionAndOrigin: true,
    testIsolation: "off",
  }
});

Cypress Version

10.11.0

Node version

16.15.0

Operating System

WIndows 11 22H2 22621.674

Debug Logs

No response

Other

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:6
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
mjhenkescommented, Nov 10, 2022

Released in 11.0.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v11.0.1, please open a new issue.

2reactions
moloboxcommented, Nov 8, 2022

Damn, I knew it wasn’t me 😸

Read more comments on GitHub >

github_iconTop Results From Across the Web

Experiments | Cypress Documentation
Configuration ; experimentalSourceRewriting, false, Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML ...
Read more >
All specs disappear in Cypress after ... - Stack Overflow
session(), I first have to implement this script: e2e: { experimentalSessionAndOrigin: true, },. But, as soon, as I add that to ...
Read more >
8 common mistakes in Cypress (and how to avoid them)
But what about the cases when our tests fail because the page is too slow? ... true attribute in your cypress.config.js .
Read more >
package.json - rouch/Cypress - NotABug.org
Cypress - Fast, easy and reliable testing for anything that runs in a browser.
Read more >
Cypress 9.6.0: Now easily test multi-domain workflows with cy ...
Users can check out the new capability after upgrading to Cypress 9.6.0 by setting the new experimentalSessionAndOrigin configuration option to true.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found