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

Research Cypress Alternatives for testing #8129

Closed
3 tasks
Abhishek-kumar09 opened this issue Jul 10, 2023 · 16 comments
Closed
3 tasks

Research Cypress Alternatives for testing #8129

Abhishek-kumar09 opened this issue Jul 10, 2023 · 16 comments
Labels
area/tests Testing / quality assurance help wanted Extra attention is needed issue/design required Functional architecture issue/remind Issue progress check issue/stale Issue has not had any activity for an extended period of time kind/proposal Proposal request for project

Comments

@Abhishek-kumar09
Copy link
Member

Abhishek-kumar09 commented Jul 10, 2023

Current Behavior

We test our UI e2e with cypress today, but there are few jerks with the subscriptions and graphQL, also we use the same framework in Meshery-extensions as well.

Your suggestions to new framework would be helpful.

Frameworks to research:

Expected Behavior

Screenshots/Logs

Environment

  • Host OS: Mac Linux Windows
  • Platform: Docker or Kubernetes
  • Meshery Server Version: stable-v
  • Meshery Client Version: stable-v

Contributor Guides and Handbook

@Abhishek-kumar09 Abhishek-kumar09 added the kind/question Further information is requested label Jul 10, 2023
@leecalcote leecalcote added area/tests Testing / quality assurance cypress issue/design required Functional architecture labels Jul 11, 2023
@github-actions
Copy link

This issue has been labeled with 'design-required'. Note that prior to commencing on implementation, a design specification needs to be created and reviewed for approval. See Creating a Functional Specification to create a design spec.


        Be sure to join the community, if you haven't yet and please leave a ⭐ star on the project 😄

@leecalcote leecalcote added kind/proposal Proposal request for project and removed kind/question Further information is requested labels Jul 11, 2023
@vaibhav135
Copy link
Member

vaibhav135 commented Jul 12, 2023

@Abhishek-kumar09 Well I am only aware about playwright, cypress (which we are already using) and puppeteer (as of now). Let's start with playwright POC first - specifically showcasing the tests for graphql subscriptions. Then we can move with others.

@MarioArriaga92
Copy link
Contributor

@vaibhav135 @Abhishek-kumar09 @leecalcote https://www.linkedin.com/advice/1/how-do-you-test-graphql-subscriptions-live-updates

Can we define a basic set of test scenarios we'd like to test? That way we can produce similar test suites from each alternative (including current framework - cypress) and evaluate accordingly.

@MarioArriaga92
Copy link
Contributor

@Abhishek-kumar09 @leecalcote @vaibhav135 I did found a library called laika that extends cypress so it can easily intercept (and optionally, mock or modify) each GraphQL subscription operation subscribed to by the application under test:
https://zendesk.github.io/laika/docs/usage-in-cypress

@MarioArriaga92
Copy link
Contributor

MarioArriaga92 commented Jul 12, 2023

@Abhishek-kumar09 @leecalcote @vaibhav135 I did found a library called laika that extends cypress so it can easily intercept (and optionally, mock or modify) each GraphQL subscription operation subscribed to by the application under test: https://zendesk.github.io/laika/docs/usage-in-cypress

Its an OSS tool by Zendesk: https://github.com/zendesk/laika
mocking is optional but the related post explains how the developer experience gets like when utilizing this tool: https://zendesk.engineering/mock-graphql-operations-with-laika-the-only-apollo-client-mocking-tool-youll-need-c116e1f62128#f6ec

@Abhishek-kumar09
Copy link
Member Author

Thanks for the research items @MarioArriaga92, looking at it.

@vaibhav135
Copy link
Member

vaibhav135 commented Jul 13, 2023

@MarioArriaga92 Thanks for the useful links.

Btw I would like to mention that although I myself don't have much experience with cypress. But it seems that It has some problem when it comes to running in ci/cd pipeline.
One example that I found is this issue that is opened now for nearly two years and a lot of people still are facing the issue (including me few days back). Although I was able to solve it in my case in this PR. But not so for other people check here. Although I know cypress has a big community but this still makes me question the reliability of it for our usage.
With playwright although it's still new, but you can be assured that a big entity (Microsoft in this case) is backing it up. And you might not face these little issue (just my speculation).
At the end I would just say that both are good and we can achieve the same result (maybe) with both of them. So it's just boils down to the ease of use, robustness and DX. I guess maybe we should write more tests in cypress to find out if it really fulfills our needs.

Btw @leecalcote and @Abhishek-kumar09 I would like to know about your experience with cypress.

@MarioArriaga92
Copy link
Contributor

@MarioArriaga92 Thanks for the useful links.

Btw I would like to mention that although I myself don't have much experience with cypress. But it seems that It has some problem when it comes to running in ci/cd pipeline. One example that I found is this issue that is opened now for nearly two years and a lot of people still are facing the issue (including me few days back). Although I was able to solve it in my case in this PR. But not so for other people check here. Although I know cypress has a big community but this still makes me question the reliability of it for our usage. With playwright although it's still new, but you can be assured that a big entity (Microsoft in this case) is backing it up. And you might not face these little issue (just my speculation). At the end I would just say that both are good and we can achieve the same result (maybe) with both of them. So it's just boils down to the ease of use, robustness and DX. I guess maybe we should write more tests in cypress to find out if it really fulfills our needs.

Btw @leecalcote and @Abhishek-kumar09 I would like to know about your experience with cypress.

@vaibhav135 good points, on the issue you mention ("Error: ESOCKETTIMEDOUT" during cy.visit command) is something very generic that can happen in different circumstances where the application under test built with an apparent "success" but is somehow unable to serve the page like in this case where an angular app was served with the "watch" flag causing the app to be re-built during test initialization and page visit timed out.

@MarioArriaga92
Copy link
Contributor

@vaibhav135 #7740 is a great example, pay close attention to this comment where a common solution to most issues that result in an ESOCKETTIMEDOUT error (based on cypress-io/cypress issue 7062 reply by jennifer-shehane, responseTimeout can be increased as if page takes longer than the 30 second default timeout to load, like when next.js builds a page the first time it is visited as in Meshery UI, such error would be thrown)

@MarioArriaga92
Copy link
Contributor

@vaibhav135 #7740 is a great example, pay close attention to this comment where a common solution to most issues that result in an ESOCKETTIMEDOUT error (based on cypress-io/cypress issue 7062 reply by jennifer-shehane, responseTimeout can be increased as if page takes longer than the 30 second default timeout to load, like when next.js builds a page the first time it is visited as in Meshery UI, such error would be thrown)

Why does this kind of problem happen mostly in CI environments? There could be a bug in cypress itself with certain setups and conditions but based on experience working with Cypress and Github Workflows in Meshery its mostly due to any of the following circumstances:

  • problems that are not noticed in a prod/dev build during build time until the app is started and an end user would attempt to visit - either resulting in a page taking longer than expected to load or not load at all.
  • Having our app test runs be against dev builds not optimized or with suboptimal configurations for their Server-Side Rendering features (Like Next.js's SSR where page HTML is generated on each request)

Is a 30 second load time acceptable? I'd say no but its not a measurement in fair conditions as CI machines usually have low amount of resources, have commodity hardware and/or could have shared resources across multiple runs/agent processes) so a separate setup and/or tool(s) can/should be used to evaluate performance. There are combinations like Cypress + Lighthouse or Cypress + browser's native Performance API to benchmark apps from an end-to-end / user perspective but that'd be a separate topic hehe.

@MarioArriaga92 MarioArriaga92 added the help wanted Extra attention is needed label Jul 18, 2023
@Yashsharma1911 Yashsharma1911 added the issue/remind Issue progress check label Aug 17, 2023
@github-actions
Copy link

Checking in... it has been awhile since we've heard from you on this issue. Are you still working on it? Please let us know and please don't hesitate to contact a MeshMate or any other community member for assistance.


        Be sure to join the community, if you haven't yet and please leave a ⭐ star on the project 😄

@stale
Copy link

stale bot commented Sep 27, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the issue/stale Issue has not had any activity for an extended period of time label Sep 27, 2023
@stale
Copy link

stale bot commented Oct 7, 2023

This issue is being automatically closed due to inactivity. However, you may choose to reopen this issue.

@stale stale bot closed this as completed Oct 7, 2023
@stale stale bot removed the issue/stale Issue has not had any activity for an extended period of time label Feb 22, 2024
Copy link

stale bot commented Apr 12, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the issue/stale Issue has not had any activity for an extended period of time label Apr 12, 2024
Copy link

stale bot commented May 6, 2024

This issue is being automatically closed due to inactivity. However, you may choose to reopen this issue.

@stale stale bot closed this as completed May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tests Testing / quality assurance help wanted Extra attention is needed issue/design required Functional architecture issue/remind Issue progress check issue/stale Issue has not had any activity for an extended period of time kind/proposal Proposal request for project
Projects
None yet
Development

No branches or pull requests

5 participants