-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Cypress Component Testing with BDD #649
Comments
This would be really helpful as you can then write the component test steps alongside the components then for the integration tests use the exact same steps which you have designed and tested on the components! |
Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far. Read more about the transfer of ownership here. The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so. |
how i can use the "cypress-cucumber-preprocessor" with open-ct? |
I imagine it would be pretty straight forward. Have you tried? |
yes... i get configuration errors and would like and example to help me set it up. |
Lmao, you don’t get to make that kind of request. What have you tried so far? |
cucumber works fine for the integration tests. but not the component tests. what configuration settings should i use? i have tired any combination of cypress.json settings i thought would help. |
I'm blocked from trying ut component testing myself, ref. cypress-io/cypress#19337, but what you essentially have to do is create your own |
@iko-danielo-zen Refer to https://docs.cypress.io/guides/references/migration-guide#3-Update-plugins-file-to-use-dev-server-start for getting component tests to work with webpack. The suggested change (from the link provided) from const webpackPreprocessor = require('@cypress/webpack-preprocessor')
const webpackConfig = require('../webpack.config.js')
module.exports = (on, config) => {
on('file:preprocessor', webpackPreprocessor(options))
} to const { startDevServer } = require('@cypress/webpack-dev-server')
const webpackConfig = require('../webpack.config.js')
module.exports = (on, config) => {
// You must use the dev-server:start event instead of the file:preprocessor event
on('dev-server:start', (options) => {
return startDevServer({ options, webpackConfig })
})
} got me closer to working component tests. I was able to get component tests |
@LewisCollum i am getting this error when I make this change. |
Current behaviour
Cypress has a relatively new way of testing components in isolation:
https://docs.cypress.io/guides/component-testing/introduction#Install
The setup for this is somewhat convoluted and requires
webpack-dev-server
(and other dependencies) to be installed. I think that as a result of this, the way that the tests are run (usingcypress open-ct
), is incompatible with this plugin.In my particular case i see the following error:
Desired behaviour
In case I have missed something, it would be great to document how to use this plugin when doing component testing if its possible.
The text was updated successfully, but these errors were encountered: