green-microphone-25998
09/09/2021, 2:35 AMrich-businessperson-57314
09/09/2021, 8:03 AMnarrow-beach-37684
09/11/2021, 6:08 PMnarrow-beach-37684
09/11/2021, 6:09 PMbulky-sundown-74498
09/11/2021, 7:45 PMnarrow-beach-37684
09/11/2021, 9:08 PMnarrow-beach-37684
09/11/2021, 9:16 PMbulky-sundown-74498
09/11/2021, 9:17 PMbrief-kite-35331
09/13/2021, 10:58 PMfancy-printer-64240
09/14/2021, 8:03 AMts
function userFactory() {
if (Cypress.env('environment') === 'dev') {
return { ... }:
} else if (Cypress.env('environment') === 'staging') {
return { ... }
}
This should probably go inside cypress
folder since it's using Cypress features. Usually I put these factories inside the cypress/fixtures
folder even if I don't use them with the cy.fixture
commandbrief-kite-35331
09/14/2021, 9:28 AMfancy-printer-64240
09/14/2021, 10:56 AMts
function userFactory() {
if (Cypress.env('environment') === 'dev') {
return makeFakeUser({ ... }):
} else if (Cypress.env('environment') === 'staging') {
return makeFakeUser({ ... });
}
}
You can have one function that creates a test data object with overwrites and another function that calls the function with different values based on the envbrief-kite-35331
09/15/2021, 10:27 PMcypress
--fixtures
----dev
users.json
----stage
users.json
Each user.json file contains data for both apps in the following format:
{
"cats": {
user1: {
name: 'Marijana',
age: 18
},
user2: {
name: 'John',
age: 45
}
},
"dogs": {
user1: {
name: 'Laura',
age: 18
},
user2: {
name: 'Kevin',
age: 45
},
user3: {
name: 'I don't exist for cats app',
age: 66
}
}
}
I am trying to convert that structure to use the principle described in the article (so basically Typescript factory instead of those fixture files).
And I can't come to an idea how to do this nicely. 🙃
Do you have some thoughts on how can this be achieved?kind-minister-59159
09/16/2021, 4:25 PMuser
09/20/2021, 6:44 AMimportant-river-75795
09/20/2021, 7:04 AMuser
09/20/2021, 7:07 AMimportant-river-75795
09/20/2021, 7:09 AMimportant-river-75795
09/20/2021, 7:09 AMuser
09/20/2021, 7:10 AMbumpy-belgium-34184
09/23/2021, 7:00 PMsilly-tailor-98571
09/24/2021, 1:40 PMDEBUG=cypress:webpack:stats
. I am running this example repo (https://github.com/cypress-io/cypress/tree/master/npm/webpack-preprocessor/examples/use-babelrc). If I upgrade to webpack@5 in that repo I no longer see stats logged in the console.wonderful-match-15836
09/25/2021, 3:46 PM@cypress/vue
package is used for component testing, so it depends on your goals. You can learn about that here: https://www.cypress.io/blog/2021/04/06/getting-start-with-cypress-component-testing-vue-2-3/
If you are just doing E2E tests, you don't need it.
Without seeing your errors, I would guess you maybe have run into this problem: The current stable Vue CLI installs a pretty old version of Cypress (version 3, and we are now on 8.4!) so you may need to update Cypress if you installed it by choosing the option provided by Vue CLI.
There are one or two other potential sources of errors with a fresh Vue CLI scaffolded app, let me know what you are seeing if upgrading Cypress did not get you all the way there.rhythmic-dress-50185
09/25/2021, 4:14 PMrhythmic-dress-50185
09/25/2021, 5:02 PMdescribe('My First Test', () => {
it('Visits the app root url', () => {
cy.visit('/')
cy.contains('h1', 'Welcome to Your Vue.js App')
})
})
It works great when ran in the UI, but when ran with npx cypress run --headless
, the pass fails with a "404 not found" on the /
path.
I'm running in headless because eventually I would like to run this in CI/CD, and I assume (maybe wrongly) that this is how that will happen, so I just wanted to see that work.wonderful-match-15836
09/25/2021, 5:21 PMnice-soccer-53564
09/27/2021, 6:01 PMuncaught exception
and the page doesn't load. However, when I do this manually everything works fine.
Is this a bug with cypress or am I missing some configuration?
I've created a stackoverflow post with details: https://stackoverflow.com/questions/69350833/issue-with-cypress-js-and-uncaught-exceptions
Please kindly help!!important-river-75795
09/27/2021, 8:17 PM