I set up a NuxtJS project with Cypress. In my tests, I go to one of the pages of my application, for example the home page (/)
describe('Index page', function () {
it('should show index page of app', function () {
cy.visit('/')
cy.get('h1.title').contains('frontend')
})
})
So I need to launch my development server to be able to build my Nuxt application (Vue) and then launch my e2e tests.
The problem is that when I launch it (which is quite long, at least 15 seconds), it doesn't give me control, the process remains active so I can't launch my yarn command to run the tests.
"scripts": {
"dev": "nuxt-ts",
"build": "nuxt-ts build",
"start": "nuxt-ts start",
"generate": "nuxt-ts generate",
"lint:js": "eslint --ext .js,.vue --ignore-path .gitignore .",
"lint:style": "stylelint **/*.{vue,css} --ignore-path .gitignore",
"lint": "yarn lint:js && yarn lint:style",
"test": "jest",
"e2e": "cypress open",
"e2e:slient": "yarn run dev & cypress run"
},
As a result, I really don't know how to launch my tests once the server is properly launched.
Thank you.