question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular Component Testing Not Working "Cannot GET /__cypress/src/index.html"

See original GitHub issue

Current behavior

When I try and run a component test with Angular I am getting this on the test runner “Cannot GET /__cypress/src/index.html”: image

Along with this in the console: image

Desired behavior

It should just load the Dashboard Component and nothing else atm.

Test code to reproduce

This is the spec file contents:

import { DashboardComponent } from "src/app/home/components/dashboard.component"

describe('ComponentName.cy.ts', () => {
  it('Test', () => {
     cy.mount(DashboardComponent)
  })
})

Cypress Version

10.6.0

Node version

v16.14.0

Operating System

Win10

Debug Logs

No response

Other

Cypress is installed inside the ClientApp folder of our Angular application Angular versions: image

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:6
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
vrknethacommented, Aug 19, 2022

I do get the same issue when mounting a component.

image

import {SelectComponent} from './select.component';
import {SelectModule} from './select.module';

describe('Data plane setup component', () => {
  it('mount', () => {
    cy.mount(SelectComponent, {
      imports: [SelectModule]
    })
  })
})

Cypress Version: 10.6 Angular

"@angular/cli": "~13.2.5",
"@angular/compiler-cli": "13.3.2",
2reactions
bahmutovcommented, Aug 17, 2022

Same when trying to write a component test in this repo https://gitlab.com/winni/angular-sudoku - throws types errors and 404

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component testing error loading spec - Cannot GET ...
I believe I've followed all the steps given in the docs, but I'm getting an error when loading the spec. Cannot GET /__cypress/src/index.html....
Read more >
Component Testing: Nextjs - Cannot GET /__cypress/src/ ...
Getting this message - Cannot GET /__cypress/src/index.html when trying run button.cy.jsx component Testing. What need to do?
Read more >
Getting Started with Angular Component Testing - YouTube
We are excited to announce that in Cypress version 10.5 we've added support for Component Testing in Angular ! Cypress Component Testing ......
Read more >
Component Testing Config
Component Testing Config. When you launch Cypress for the first time in a project, the app will automatically guide you through setup and...
Read more >
Component testing scenarios
For a use case in which TestBed.inject() does not work, see the Override component providers section that explains when and why you must...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found