Updates
- Based on comments and further tests I now suspect that the problem has somewhat to do with access restriction on the path, not the path itself. It's however not clear to me what actually is the cause, as there is no clear hints of it.
- I now use another project for my evaluation, without access control, and it works. So the problem seems to be related to access control.
- I leave the question as is, for future reference.
I am following this Cypress Quickstart: Vue guide to try out the new component testing for Vue. I already have "e2e" Cypress test working, and it's seemingly some basePath or other configuration/path issues, specifically with component test, I am dealing with now.
Problem
The browser does not carry out the test, waiting forever, saying in the dev tools console:
http://localhost:8080/__cypress/iframes/C:/work/swisscom/prixx/WebGui/Web/cypress/components/PersonEdit.cy.js....404 Not Found
I get the following error in the VS Code terminal:
GET /__cypress/iframes/C:/work/swisscom/prixx/WebGui/Web/cypress/components/PersonEdit.cy.js 404 49.560 ms - 105
Setup
Here's my cypress.config.ts
import { defineConfig } from 'cypress';
export default defineConfig({
...
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config);
},
baseUrl: 'http://localhost:2623/'
},
component: {
devServer: {
framework: 'vue',
bundler: 'webpack'
}
}
});
It's Vue2, Webpack, Cypress v10.6.0, using Google Chrome.
- I start the Cypress controlled Browser from the Cypress App (Google Chrome points at http://localhost:8080/__/#/specs)
- When clicking the test, the address bar in the browser now shows "http://localhost:8080/__/#/specs/runner?file=cypress/components/PersonEdit.cy.js" which looks reasonable
What I have tried/found
- The test file exists a the given absolute location. However, I consider the use of this absolute path a telltale sign of my problem.
- I have a baseUrl configured for e2e, but I can not find a way to configure one for component testing
- The config, when inspected with the controlled browser shows the following:
From http://localhost:8080/__/#/settings, "Resolved Configuration":
//...
arch: 'x64',
baseUrl: null,
//...
Somehow, the controlled browser translates the relative path to an absolute path. Why is that?
Question
How can I fix/configure the path for fetching my Cypress Component Test spec?