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

Support cypress ^10.0.0 #34

Closed
Pashozator opened this issue Dec 11, 2022 · 3 comments · Fixed by #35
Closed

Support cypress ^10.0.0 #34

Pashozator opened this issue Dec 11, 2022 · 3 comments · Fixed by #35

Comments

@Pashozator
Copy link
Contributor

In cypress 10.0.0 cypress.json file is no longer supported.

Using a cypress.json configuration file is no longer supported. Replace this configuration file with a cypress.config.js, cypress.config.ts, cypress.config.cjs or cypress.config.mjs file. This change provides better flexibility and extensibility of configuration. An error will be thrown if both a cypress.json file and cypress.config.{cjs,js,mjs,ts} file are found. Addressed in #18221, #18300, #20554, and #20643.

We should use cypress env to provide mailHogUrl.

@Pashozator Pashozator changed the title Handle cypress ^10.0.0 Support cypress ^10.0.0 Dec 11, 2022
@juancarlosjr97
Copy link

Workaround while this is gets merged

Add to the cypress.config.ts

import { defineConfig } from "cypress";

export default defineConfig({
  projectId: "****",
  e2e: {
    // Workaround until https://github.com/SMenigat/cypress-mailhog/issues/34 gets merged and the configuration of cypress-mailhog moves as an environmental variable
    // @ts-ignore
    mailHogUrl: "http://localhost:8025/",
    setupNodeEvents() {},
  },
  component: {
    devServer: {
      framework: "next",
      bundler: "webpack",
    },
  },
});

@SMenigat
Copy link
Owner

SMenigat commented Jan 3, 2023

Hi @juancarlosjr97 ,

thanks for your participation and using this package.
You would not need to hack this in via the e2e config with @ts-ignore by using the default env config.

Something like this should work:

export default defineConfig({
 // ...
 env: {
   mailHogUrl: "http://localhost:8025/",
 },
 // ...
});

Configuring the mailHogUrl via ENV variables was always the preferred way of doing it, it was just never documented. Additionally old cypress versions didnt have feature for "default env values" yet, so using the config for defining a default for localhost was the actual workaround.

@Pashozator was so kind to adjust the documentation accordingly here in #35 which we soon should be able to merge.

@juancarlosjr97
Copy link

Thank you @SMenigat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants