cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.41k stars 3.14k forks source link

Error occured at every run "Expected DataContext to already have been set via setCtx. " and the enw changes does not be saved on Cypress #29637

Open Eyatester opened 3 weeks ago

Eyatester commented 3 weeks ago

Current behavior

When running my code this error appears : also when we add changes on the code they are not saved

GET /chrome-variations/seed?osname=win&channel=stable&milestone=125 - - ms - -
Error:
      Expected DataContext to already have been set via setCtx. If this is a
      testing context, make sure you are calling "setCtx" in a before hook,
      otherwise check the application flow.
    at c (<embedded>:4419:89919)
    at Object.u (<embedded>:4649:291801)
    at Object.<anonymous> (<embedded>:4669:29094)
    at Object.tryCatcher (C:\Users\DELL\AppData\Local\Cypress\Cache\12.8.1\Cypress\resources\app\node_modules\bluebird\js\release\util.js:16:23)
    at Object.execute (C:\Users\DELL\AppData\Local\Cypress\Cache\12.8.1\Cypress\resources\app\node_modules\bluebird\js\release\method.js:15:34)
    at C.close (<embedded>:4721:423879)

Desired behavior

how to fix this error and changes should be saved

Test code to reproduce

GET /chrome-variations/seed?osname=win&channel=stable&milestone=125 - - ms - -
Error:
      Expected DataContext to already have been set via setCtx. If this is a
      testing context, make sure you are calling "setCtx" in a before hook,
      otherwise check the application flow.
    at c (<embedded>:4419:89919)
    at Object.u (<embedded>:4649:291801)
    at Object.<anonymous> (<embedded>:4669:29094)
    at Object.tryCatcher (C:\Users\DELL\AppData\Local\Cypress\Cache\12.8.1\Cypress\resources\app\node_modules\bluebird\js\release\util.js:16:23)
    at Object.execute (C:\Users\DELL\AppData\Local\Cypress\Cache\12.8.1\Cypress\resources\app\node_modules\bluebird\js\release\method.js:15:34)
    at C.close (<embedded>:4721:423879)

Cypress Version

12.8.1

Node version

20.13.1

Operating System

windows 64

Debug Logs

No response

Other

No response

jennifer-shehane commented 3 weeks ago

@Eyatester Could you update to the latest version of Cypress and let us know if this error still occurs. This issue may already be fixed.