Skip to content
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

Serve static assets #9736

Closed
bahmutov opened this issue Dec 27, 2017 · 3 comments
Closed

Serve static assets #9736

bahmutov opened this issue Dec 27, 2017 · 3 comments
Labels
npm: @cypress/vue @cypress/vue package issues

Comments

@bahmutov
Copy link
Contributor

Sometimes there are static assets included from the components, like images. <img src="./assets/logo.png"> - the webpack dev server serves these, or can build it into a folder, but Cypress does not handle these files.

See code at bahmutov/vue-cli-and-cypress#1

@bahmutov
Copy link
Contributor Author

screen shot 2017-12-27 at 12 27 58 am

@bahmutov
Copy link
Contributor Author

bahmutov commented Dec 27, 2017

Partial work around

  • build static resources using npm run build using webpack. Usually puts all results into a folder, for example dist
  • in the file cypress.json tell Cypress to serve this folder
{
  "fileServerFolder": "dist"
}
  • pass base tag with options. Note: requires Vue to be an URL.
const options = {
  base: '/',
  vue: 'https://unpkg.com/vue/dist/vue.js'
}
beforeEach(mountVue(/* my Vue code */, options))

screen shot 2017-12-27 at 1 48 58 pm

bahmutov referenced this issue in cypress-io/cypress-vue-unit-test Dec 27, 2017
bahmutov referenced this issue in cypress-io/cypress-vue-unit-test Dec 27, 2017
@elevatebart elevatebart transferred this issue from cypress-io/cypress-vue-unit-test Dec 11, 2020
@elevatebart elevatebart added the npm: @cypress/vue @cypress/vue package issues label Dec 11, 2020
@lmiller1990
Copy link
Contributor

Fixed in 7.0:

image

Repo: https://github.com/lmiller1990/vue-cypress-template

@cypress-io cypress-io locked as resolved and limited conversation to collaborators May 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
npm: @cypress/vue @cypress/vue package issues
Projects
None yet
Development

No branches or pull requests

3 participants