famous-application-51504
05/28/2021, 6:05 PMfamous-application-51504
05/28/2021, 6:07 PMfamous-application-51504
05/28/2021, 6:07 PMfamous-application-51504
05/28/2021, 6:07 PMbulky-sundown-74498
05/28/2021, 8:46 PMbulky-sundown-74498
05/28/2021, 8:48 PMplugin.js
file
https://github.com/wallslide/cypress-nuxt-vuetify/blob/master/cypress/plugins/index.js
Since you are not using the vue cli, you do not have a @vue/cli-service
meaning that you cannot require a webpack config from therebulky-sundown-74498
05/28/2021, 8:49 PMbulky-sundown-74498
05/28/2021, 8:53 PMcypress/support
folder, I create a cy.mount
command that wraps the vuetify theme setup.
If you have trouble adapt, don't hesitate to ping me here 😉famous-application-51504
05/28/2021, 9:33 PMsalmon-oyster-49557
06/28/2021, 7:08 AMplugins/index.js
is not being used because the default folders and files are recreated when I run npx cypress open-ct
. The individual "pluginsFile": ...
I've set in cypress.json
are not used.
What is the recommended way to have both e2e and CT plugin files configured in cypress.json
?
This is what I have now:
{
"e2e": {
"pluginsFile": "cypress/e2e/plugins/index.js"
},
"component": {
"pluginsFile": "cypress/ct/plugins/index.js",
"viewportWidth": 375,
"viewportHeight": 667,
"componentFolder": "src/components",
"testFiles": "**/*.spec.{ts,js}"
}
}
salmon-oyster-49557
06/28/2021, 7:10 AMcypress
folder (before npx cypress open-ct
recreates)salmon-oyster-49557
06/28/2021, 7:14 AMcypress
folder after npx cypress open-ct
recreates (ct
and e2e
folders folded so it's easier to see)bulky-sundown-74498
06/28/2021, 2:22 PMsalmon-oyster-49557
06/28/2021, 3:51 PMcypress.json
is in the root of the repo - I can create a reproduction from https://ionicframework.com/vue by starting a new app:
npm install -g @ionic/cli
ionic start --type=vue
And then adding component testing. Repo that reproduces the issue: https://github.com/codeluggage/ionic-5-vue-3-cypress-ct-and-e2e-combined
Ionic-Vue has e2e working out-of-the-box. It's the split between an e2e and a CT plugins file that I don't know how to set up.
There are no component tests added here, it's a completely basic reproduction case.
If you clone that reproduction repo, npm i
and then run npx cypress open-ct
, you'll see cypress/fixtures
and cypress/support
are created even though cypress.json
specifies the "pluginsFile"
.
All this said, getting Ionic-Vue to work with CT is a whole separate challenge 😄bulky-sundown-74498
06/28/2021, 4:02 PMpluginsFile
is not being used? I see the support and fixture being created, but not the supportFile.
I will create a PR to your repo with a very simple (not useful) CT test.
@User did we add ionic to our list of ready made examples?salmon-oyster-49557
06/28/2021, 4:04 PMcypress/e2e
and cypress/ct
- but the new folders are created in cypress/
.
Are you saying that setting a pluginsFile
is not enough, and I also need to set more directory locations? I.e. it doesn't infer from the location of the pluginsFile
where all the directories live?bulky-sundown-74498
06/28/2021, 4:12 PMcypress.json
, pluginsFile
and supportFile
You can also configure a fixturesFolder
to store all the dummy data that you might want to use to display your components in a better shape than empty.
You can configure pluginsFile
, supportFile
and ficturesFolder
in your cypress.json
If you don't set them to false, and the files don't exist in their standard location, Cypress will assume that you do not know about them yet. It will create some nice simple examples for each of them.salmon-oyster-49557
06/28/2021, 4:13 PMbulky-sundown-74498
06/28/2021, 4:14 PMbulky-sundown-74498
06/28/2021, 4:14 PMbulky-sundown-74498
06/28/2021, 4:17 PMbulky-sundown-74498
06/28/2021, 4:18 PMsalmon-oyster-49557
06/28/2021, 4:18 PMpluginsFile
and support
folder locations mixed up, my main issue has been getting Ionic styles to appear for component tests. As Cypress was set up in the Ionic-Vue starter template, and it seemed to be out of date, I didn't expect things to work perfectly for the new 7+ Cypress yet 🙂bulky-sundown-74498
06/28/2021, 4:19 PMbulky-sundown-74498
06/28/2021, 4:19 PMbulky-sundown-74498
06/28/2021, 4:19 PMsupportFile
bulky-sundown-74498
06/28/2021, 4:19 PMmain.js
salmon-oyster-49557
06/28/2021, 4:19 PM- "@cypress/vue": "^2.2.3",
+ "@cypress/vue": "^3.0.0",
Interesting - I had the right versions in my private repo. Must not have installed right when I set up the repro-repo 🤔bulky-sundown-74498
06/28/2021, 4:20 PMsalmon-oyster-49557
06/28/2021, 4:21 PM/cypress/ct/support/index.js
and couldn't get it to show up, but then realized the issue with the location of support/
.
After that however, I have still not been able to show styles for a stand-alone Vue 3 component in Ionic. A full page for e2e, yes. A single component with CT, no.