I have a multiple specs files in Cypress and each one imports a file named "helper.cy". helper.cy contains a Cypress.Commands.overwriteQuery overwriting the "contains" query.
When I try to run all the spec files together (there are 8), the contains overwrite calls itself 8 times. Presumably this is because the way that Cypress merges the spec files together, it ends up importing helper.cy 8 times.
Has anyone else experienced this and does anyone know of a workaround?
Generally helper files are classed as "Support" files and are placed in (or imported into) the index or root file of the folder
cypress/support. By default that file iscypress/support/e2e.jsbut you can configure it to be another file incypress.config.js.See this page of the documentation Writing and Organizing Tests