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

Angular component test reload after code change doesn't work anymore #25477

Open
JETiCODEV opened this issue Jan 17, 2023 · 11 comments
Open

Angular component test reload after code change doesn't work anymore #25477

JETiCODEV opened this issue Jan 17, 2023 · 11 comments
Labels
browser: firefox CT Issue related to component testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.

Comments

@JETiCODEV
Copy link

Current behavior

We are planning to use the Cypress Angular component testing in a large scale project, but first we started to create a test application to figure out how everything works. Most of the stuff looks ok except for the fact that when making code changes and waiting for Cypress to rerun the test doesn't fully work.

The component defined in the test file doesn't render anymore, it does when doing a full page reload of the Cypress browser through for example F5.

Desired behavior

Cypress renders the component correctly after making changes to the test.

Test code to reproduce

Attached is the example project which we have created:
cypress.zip

Cypress Version

12.3.0

Node version

16.16.0

Operating System

Windows 11

Debug Logs

No response

Other

No response

@marktnoonan
Copy link
Contributor

marktnoonan commented Jan 18, 2023

This is likely related to #25438 which I'm investigating today.

@JETiCODEV I have a few questions for you if you don't mind:

  • Is this 100% consistent - all team members, all machines, all the time?
  • Does the test update properly if you use the internal "rerun" button in Cypress or do you have to reload the page? Attaching image of the reload button.
  • Do you open cypress and then choose a testing type in the UI, then open the browser through Cypress, or do you use CLI flags to go directly to component testing, like npx cypress --component --browser chrome? I can only ever reproduce this effect when I am using the flags. But I suspect it's possible without them too.

For us, we tested your example project and had no problem with live reloading, so it is nothing in your project's setup or configuration.
Screen Shot 2023-01-18 at 10 14 45 AM

@JETiCODEV
Copy link
Author

Hi @marktnoonan,

First of all thanks for the response !

I haven't asked another person to run the test, will do it tomorrow, also will try it in a different machine myself. The tests are started by executing the npx cypress open command.

Today I did another test run and saw that it actually executed Firefox, so I switched to Edge and there it works without any issue. Also tried it on my Macbook and there it also works without any issue. It seems to be that the problem is actually related to Firefox, this is the output of the screen:
image

Clicking on the "rerun" button results in the same output.

@marktnoonan
Copy link
Contributor

Thanks so much for the info @JETiCODEV ... no at all what I expected. Which version of firefox are you testing in?

@JETiCODEV
Copy link
Author

Sorry for answering so late, but have been very busy. In the meantime I was able to start writing some component tests in Angular. Was mainly testing against Edge and from time to time also had the same issue where Cypress suddenly doesn't render the component anymore, after doing a full reload F5 it just works again.

With Firefox it seems to be a different story, have tested in on version v91 and v109 and with these version the reload doesn't work.

@ZachJW34 ZachJW34 assigned warrensplayer and unassigned ZachJW34 Jan 31, 2023
@warrensplayer
Copy link
Contributor

@JETiCODEV I have picked up the issue to work. I am able to reproduce your issue in Firefox with your supplied sample project. Do you have any updates since your last comment? I will get back to you as soon as possible with my findings.

@JETiCODEV
Copy link
Author

Hi @warrensplayer, I haven't been using it with Firefox currently, what I can tell is that we also get the same issue with Edge.

In this case a reload from the Cypress UI fixes it, it also just happens after a couple of iterations. When fully restarting Cypress it then works again for a couple of iterations.

@marktnoonan
Copy link
Contributor

I'm going to route this now @warrensplayer since it's reproducible, if your investigation turned up any other information you can add it here.

@lmiller1990 lmiller1990 added browser: firefox CT Issue related to component testing and removed ct-core labels Mar 8, 2023
@nagash77 nagash77 added Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. and removed routed-to-ct labels Apr 19, 2023
@kryshac
Copy link

kryshac commented Jun 14, 2023

I have the same behavior in firefox, after changing a file, the component is no longer mounted
Peek 2023-06-14 16-46

@cg-roling
Copy link

Chrome 116 and Electron 106 produce the same issue here.
Cypress 12.17.4

Once I modify a file and it attempts to reload, I need to refresh the browser to get it to run again. The internal refresh button doesn't work.

No CLI flags, navigating via the UI.

@sureMOISE
Copy link

Any update? Same issue while working on angular components. After file changes, test auto reload are not working until browser page refresh,

@jordanpowell88
Copy link
Collaborator

jordanpowell88 commented Jan 31, 2024

@sureMOISE do you have an example repo? I've never encountered this behavior before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser: firefox CT Issue related to component testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.
Projects
None yet
Development

No branches or pull requests

10 participants