config.yml:
frontend-test:
<<: *defaults
docker:
- image: cypress/base:8
- image: circleci/node:10
working_directory: ~/repo
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: npm ci
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: npm run test:cypress
Package.json:
{
"cypress:run": "cypress run",
"start": "webpack-dev-server --config ./webpack.config.js --mode development",
"test:cypress": "start-server-and-test start http://localhost:8080 cypress",
"cypress": "cypress run",
}
cypress:json:
{
"baseUrl": "http://localhost:8080/",
"fixturesFolder": "cypress/fixtures",
"integrationFolder": "cypress/integration",
"pluginsFile": "cypress/plugins",
"screenshotsFolder": "cypress/screenshots",
"supportFile": "cypress/support",
"videosFolder": "cypress/videos"
}
webpack.config.js:
module.exports = {
entry: "./public/js/app.js"
}
它说:
CypressError: cy.visit() failed trying to load:
http://localhost:8080/login
The response we received from your web server was:
> 404: Not Found
前端是vuejs,因此登录页面是login.vue,正在加载vue-router
这4天来我一直在尝试,不知道怎么了,请帮忙