-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat(cypress): support Cypress 10 #259
Conversation
79fb98e
to
d23d2b3
Compare
Hey there, what's missing on this one to promote it to ready for review? Can you list here any blockers? |
The Dialog would be one. Vite module resolution via path alias is the major one. |
I experimented with Vitest and Cypress v10 component testing in one repo. I have it working with a shared |
No wonders the setup doesn't work, you haven't updated the dependencies accordingly 😅 It may also be that the existing dependencies are interfering with the new ones, as if I got it right dev-server packages are now exposed by the main Cypress binary |
19e0245
to
9dc9c43
Compare
+1 |
I've manually added the Cypress 10 in my project so I assume you might find useful problems I encountered and solved. First, I tried cloning the hinogi:feature/cypress-10 and then point the I'm using Quasar 2.7.7 with TypeScript and ESLint.
import { devServer as webpackDevServer } from '@cypress/webpack-dev-server'
import { quasarWebpackConfig } from 'test/cypress/quasar-dev-server' // this a location of the file I copied from this pull request, replace with your path
import DevServerConfig = Cypress.DevServerConfig
const devServer = async (devServerOptions: DevServerConfig) => webpackDevServer({
...devServerOptions,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
webpackConfig: await quasarWebpackConfig(),
framework: 'vue'
})
Cypress.Commands.add('mount', (component, options: MountingOptions<unknown> = {}) => {
options.global = options.global || {}
options.global.stubs = options.global.stubs || {}
options.global.components = options.global.components || {}
options.global.plugins = options.global.plugins || []
options.global.mocks = options.global.mocks || {}
options.global.plugins.unshift([Quasar, { plugins: { Notify, Dialog, Cookies } }]) // replace with the plugins you need
options.global.plugins.push(i18n) // if you need i18n add import { i18n } from 'src/boot/i18n' on top of the file
return mount(component, options)
})
"resolutions": {
"html-webpack-plugin": "^5.5.0"
}, Here are some issues that are just annoying but you don't need to workaround them:
Hope you can find this insightful. Footnotes |
Thanks for the detailed report! I'll try to apply/investigate other problems you mentioned 👍🏻 |
I was browsing Cypress changelog and noticed interesting bugfix in 10.5.0. I've updated to 10.6.0 and noticed a couple of problems are gone. Please see my initial post, crossed out things that got fixed by that bugfix and added one more problem (annoying problem, not show stopper) |
I guess you have to look out for the cypress dev server version that is used with the cypress version since there are some big difference in the new dev server implementation, I tried that at the beginning like the root attribute and such. |
0bcd362
to
7536ca2
Compare
Webpack is now working correctly, Vite apparently hit 404 on all loaded components, I'm investigating why |
8b91e42
to
bbe1247
Compare
oh i forgot about vite totally |
Unluckily I can't wrap up the work once more 🥲 @hinogi @covik this seems a promising path if you want to investigate: cypress-io/cypress#22505 |
Explanation of the Vite problem: cypress-io/cypress#22505 (comment) |
Co-authored-by: Yusuf Kandemir <yusuf.kandemir@outlook.com.tr>
great find, how did you uncover it? |
What kind of change does this PR introduce? (check at least one)
If you are adding a new test runner, have you...? (check all)
/packages/base/runners.json
?/README.md
?baseline.spec.vue
?Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
dev
branch and not themaster
branchfix: #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
Closes #255