Giter Site home page Giter Site logo

Comments (4)

cs-balazs avatar cs-balazs commented on May 16, 2024 4

I think currently the issue is that synpress is not loading the cypress index.js, since I can also not define commands there, therefor plugins defined there are also not taken into consideration, my workaround is to use a forked version of synpress currently and modify the synpress index.js to my needs

Thanks for the response! I ended up doing the following as a workaround:
Plugins file (cypress/plugins/index.js in my case):

import synpressPlugins from "@synthetixio/synpress/plugins"

module.exports = (on, config) => {
  synpressPlugins(on, config)
}

Support file (cypress/support/index.js in my case):

import "./commands"
import "@synthetixio/synpress/support"

I'm passing this option to synpress run: --config supportFile='cypress/support/index.js',pluginsFile='cypress/plugins/index.js'.
Commands defined in cypress/support/commands.js do get loaded this way. I'm guessing plugins like cypress-file-upload also work, but couldn't test it yet.

from synpress.

maxhoheiser avatar maxhoheiser commented on May 16, 2024

I think currently the issue is that synpress is not loading the cypress index.js, since I can also not define commands there, therefor plugins defined there are also not taken into consideration, my workaround is to use a forked version of synpress currently and modify the synpress index.js to my needs

from synpress.

maxhoheiser avatar maxhoheiser commented on May 16, 2024

Nice workaround!
I tried something similar too, but instead of directly passing it into the synpress run, I specified the supportFile in my synpress.json configuration file like so:

{
...
  "supportFile": "support/index.js"
}

And I pass the config file to the synpress run like so: synpress run -cf synpress.js - but that is not working 🤔

from synpress.

cs-balazs avatar cs-balazs commented on May 16, 2024

That's how I also tried originally. For some reason this way the commands only seemed to load with synpress open.
I just tried cypress-file-upload with the workaround I posted, and it also works, however, I also needed to pass fixturesFolder='cypress/fixtures' in my synpress run command, as that one also seems to be ignored when defined in the config file.

The whole command looks like this:
synpress run --configFile cypress.json --config supportFile='cypress/support/index.js',pluginsFile='cypress/plugins/index.js',fixturesFolder='cypress/fixtures' -b chromium

Closing the issue, since my original problem has been resolved.

from synpress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.