When invoking a method from a component, the test passes locally but fails in Github Actions #26242
Unanswered
simon-chen-1
asked this question in
CI setup
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm setting up e2e tests in Continuous Integration for my Angular & NestJS app and I ran into an issue. When a user clicks a button, it invokes the getSummary method. This getSummary method calls the summarize method from a service with 2 arguments: user and the evaluated result of another method, getNodes (which returns an array of strings).
The goal of the test is to see if the summary gets updated after invoking this getSummary method. When I run it locally, it passes. However, when I run it in Github Actions, it fails and indicates that the summary is undefined.
I decided to pass in a dummy array in place of the getNodes method (so it ended up looking like this:
this.request.summarize(this.user, ['one', 'two', 'three'])
...) and then the test started passing on Github Actions. So this makes me think that invoking the getNodes method is taking too long when running it in Github Actions. The getNodes method itself also invokes another method - getNodesToSend. This method will recursively call itself depending on certain situations. The fact that it recursively calls itself makes me think that Cypress doesn't wait for all of these recursive calls to complete.What have I tried:
Is there a way to get Cypress to wait for the getSummary call to complete before making the assertion?
I'm currently using Cypress version 12.6.0 and version Angular version 14.0.0
Beta Was this translation helpful? Give feedback.
All reactions