meinaart / cypress-plugin-snapshots

Plugin for snapshot tests in Cypress.io
MIT License
498 stars 117 forks source link

(bug) `Config cannot be found.` when importing cypress-plugin-snapshots/command #112

Closed CyrilKrylatov closed 4 years ago

CyrilKrylatov commented 4 years ago

Describe the bug Hello everyone,

The import 'cypress-plugin-snapshots/commands' part in support/index.js as described here seems to not work as it's not importing the commands.

To Reproduce Steps to reproduce the behavior:

  1. Go to my cypress/ folder
  2. yarn add -D cypress-plugin-snapshots
  3. open ./support/index.js, put import 'cypress-plugin-snapshots/commands' in there
  4. launch cypress with the gui part
  5. see the following error:

    Config cannot be found.

    This error originated from your test code, not from Cypress.

    When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Expected behavior To not have this error

Screenshots ss_ 1497 ss_ 1499

Desktop (please complete the following information):

Additional context Thank you for your answers and thank you for this plugin!

meinaart commented 4 years ago

Is fixed in latest version.

CyrilKrylatov commented 4 years ago

Thank you for your quick reply!

I updated cypress-plugin-snapshots to its last version (1.4.3) and now I have the following error with the same configuration as above:

cypress_runner.js:171559 Error:    CypressError: `cy.task('cypress-plugin-snapshot:getFile')` failed with the following error:

The 'task' event has not been registered in the plugins file. You must register it before using cy.task()

Fix this in your plugins file here:
false

https://on.cypress.io/api/task

Because this error occurred during a `before all` hook we are skipping all of the remaining tests.

Did I miss something?

Thank you!