Giter Site home page Giter Site logo

Cypress 10 support about cypress HOT 5 CLOSED

laracasts avatar laracasts commented on May 21, 2024 2
Cypress 10 support

from cypress.

Comments (5)

curtisblackwell avatar curtisblackwell commented on May 21, 2024 3

This may be more appropriate for the Mix repo, but is less compelling outside of a specific context like this one.

Cypress added support for component tests, which are integration tests that allow you to mount a component and interact with it as someone would in the browser without the need for a Laravel route.

I find component tests far easier to work with than Jest unit tests and would like to use the feature in Laravel apps I'm using Mix with. However, as far as I can tell, there's no simple way to feed the Mix-generated Webpack config into Cypress (as instructed in the Cypress docs and) shown below:

module.exports = {
  component: {
    devServer: {
      framework: 'vue',
      bundler: 'webpack',
      // optionally pass in webpack config — not so optional with a Mix setup
      webpackConfig: require('./webpack.config'),
    },
  },
}

It would be nice if this package, as part of adding support for Cypress 10, also played nicely with Cypress's component testing. I imagine that would mean adding a section in the docs that shows how to pass in the Webpack config from Mix. Or maybe even a stub?

I'm happy to contribute, I'd just want to know this is something maintainers (is it just @JeffreyWay?) would want to add support for and some help with/guidance in getting the Webpack config out of Mix.

from cypress.

JeffreyWay avatar JeffreyWay commented on May 21, 2024 3

@curtisblackwell Yeah, this is probably a better question for the Mix repo.

@emargareten Cypress 10 support has now been added. Upgrade to v3.

from cypress.

troccoli avatar troccoli commented on May 21, 2024 1

Since the plugins directory is not supported anymore, I had to put the tasks in cypress.config.js

const {defineConfig} = require("cypress");
const fs = require("fs");

module.exports = defineConfig({
    e2e: {
        baseUrl: 'http://localhost',
        setupNodeEvents(on, config) {
            on('task', {
                activateCypressEnvFile() {
                    if (fs.existsSync('.env.cypress')) {
                        fs.renameSync('.env', '.env.backup');
                        fs.renameSync('.env.cypress', '.env');
                    }

                    return null;
                },

                activateLocalEnvFile() {
                    if (fs.existsSync('.env.backup')) {
                        fs.renameSync('.env', '.env.cypress');
                        fs.renameSync('.env.backup', '.env');
                    }

                    return null;
                },
            })
        },
    },
});

I'm sure there are other things to change, but this is a start.

from cypress.

dillingham avatar dillingham commented on May 21, 2024

Working so far by

  • adding the env swap plugin as mentioned above
  • moving package stub files into /cypress/support and importing them within /cypress/support/e2e.js

from cypress.

ValCanBuild avatar ValCanBuild commented on May 21, 2024

It worked for me without any changes by just running the auto migrate tool that comes with cypress 10

from cypress.

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.