Comments (5)
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.
@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.
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.
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.
It worked for me without any changes by just running the auto migrate tool that comes with cypress 10
from cypress.
Related Issues (20)
- Using factories by morph name proposal
- Caching problems with `config:clear` in cypress/support/index.js
- Problems with Passport command `passport:install` does not exist HOT 2
- There are no commands defined in the "cypress" namespace. HOT 3
- Laravel route "login" does not exist. HOT 6
- Typescript support HOT 2
- Global installation of Cypress HOT 3
- Issue with artisan route HOT 3
- Environment variables undefined in tests HOT 1
- Receiving error: http://localhost:8000/cypress/artisan - 419: Unknown Status Code HOT 2
- Class "App\User" not found HOT 2
- PUT requests do not work HOT 1
- laravel 9 - problem with CSRF TOKEN HOT 3
- Timeout when running `cy.refreshDatabase()` HOT 2
- Calling Login() a second time does not work HOT 1
- The wildcard for routes RegExp fails on optional parameters HOT 1
- Improve safety of environment check HOT 2
- AWS mock or stub functions
- Feature Request: Modify values using config
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress.