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

test: Cypress | Replace static with Dynamic waits - Part 1 #29405

Merged
merged 40 commits into from
Dec 11, 2023

Conversation

Aishwarya-U-R
Copy link
Contributor

@Aishwarya-U-R Aishwarya-U-R commented Dec 6, 2023

Description

  • Removed hard waits from below specs:
    • Apps/CurrencyInputIssue_Spec.js
    • ClientSide/Widgets/Modal/Modal_spec.ts (Fix & unskip)
    • /Binding/TableV2_Widget_API_Pagination_spec.js
  • Unskip - ApiTests/API_Unique_name_spec.js
  • Flaky fix - TableV2_Widget_API_Pagination_spec.js
  • Flaky fix - /ServerSide/QueryPane/S3_1_spec.js
  • Removed empty ReusableHelper.ts
  • Improved agHelper.GetElement() to include the assertion for element presence/absence
  • Modified helpers/function calls to fit the above syntax of GetElement()
  • Improved WaitUntilEleAppear(), WaitUntilEleDisappear() to use timeout from cypress config

Type of change

  • Script fix (non-breaking change which fixes an issue)

Testing

How Has This Been Tested?

  • Cypress CI runs

Checklist:

QA activity:

  • Added Test Plan Approved label after Cypress tests were reviewed

Summary by CodeRabbit

Summary by CodeRabbit

  • Tests

    • Enhanced end-to-end test stability by replacing static waits with dynamic element-based synchronization.
    • Skipped certain test suites to streamline the testing process.
    • Improved test assertions and control flow for more reliable verification of UI components.
  • Chores

    • Updated test helper methods to support new verification strategies.
    • Cleaned up unnecessary imports and inheritance in test support classes.
  • Documentation

    • Adjusted test case descriptions to reflect the new synchronization methods used.
  • Bug Fixes

    • Fixed issues with test synchronization that could lead to flaky test results.

Copy link
Contributor

coderabbitai bot commented Dec 6, 2023

Walkthrough

Walkthrough

The changes across the codebase reflect a shift towards more dynamic and reliable testing practices in Cypress tests. Static sleeps have been replaced with dynamic waits, ensuring elements are present or absent before proceeding. This improves test stability and performance. Additionally, there's a move towards more direct and granular imports, removal of unused references, and updates to control flow logic. Some test suites have been skipped, indicating a possible deprioritization or refactoring of tests.

Changes

File Path Change Summary
.../CurrencyInputIssue_Spec.js,
.../Modal_spec.ts,
.../ListWidgetParseError.ts,
.../Radio2_spec.ts,
.../Widget_property_navigation_spec.ts
Removed static sleep/wait calls; introduced dynamic element-based waits; updated assertions and control flow.
.../AggregateHelper.ts,
.../AssertHelper.ts,
.../HomePage.ts,
.../Table.ts,
.../Registry.ts
Updated helper classes with new methods and logic; removed unused imports and inheritance; commented out static sleep.
.../RTL_support.ts,
.../DSCrudAndBindings_Spec.ts,
.../TableV2_Widget_API_Pagination_spec.js,
.../ForkTemplateToGitConnectedApp.js
Adjusted element verification logic; skipped certain test suites; updated import names and toast message handling.
limited-tests.txt Updated the list of limited tests, indicating changes in test execution priorities.
.../S3_1_spec.js,
.../Library_spec.ts
Modified data source creation logic in tests; shifted from global object access to direct named imports for better clarity and maintenance.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@github-actions github-actions bot added skip-changelog Adding this label to a PR prevents it from being listed in the changelog Tests Test issues labels Dec 6, 2023
Copy link

github-actions bot commented Dec 7, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7125754736.
Workflow: ci-test-limited.
PR: 29405.

Copy link

github-actions bot commented Dec 7, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7125754736.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts

  2. cypress/e2e/Regression/Apps/CurrencyInputIssue_Spec.js
  3. cypress/e2e/Regression/ClientSide/Binding/SelectWidget_Spec.ts
  4. cypress/e2e/Regression/ClientSide/Binding/TableTextPagination_spec.js
  5. cypress/e2e/Regression/ClientSide/Binding/TableV2TextPagination_spec.js
  6. cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Derived_Column_spec.js
  7. cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js
  8. cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts
  9. cypress/e2e/Regression/ClientSide/BugTests/Bug9334_Spec.ts
  10. cypress/e2e/Regression/ClientSide/BugTests/Moment_Spec.ts
  11. cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts
  12. cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js
  13. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/SuggestedWidgets_spec.js
  14. cypress/e2e/Regression/ClientSide/OneClickBinding/JSONFormWidget/ConnectToWidget_spec.ts
  15. cypress/e2e/Regression/ClientSide/OneClickBinding/JSONFormWidget/mongoDb_spec.ts
  16. cypress/e2e/Regression/ClientSide/OneClickBinding/JSONFormWidget/postgres_spec.ts
  17. cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_CSV_spec.js
  18. cypress/e2e/Regression/ClientSide/Widgets/List/ListWidgetParseError.ts
  19. cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicServerSideData_spec.js
  20. cypress/e2e/Regression/ClientSide/Widgets/Multiselect/RTL_support.ts
  21. cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio2_spec.ts
  22. cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableBugs_Spec.ts
  23. cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_1_Spec.ts
  24. cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_2_Spec.ts
  25. cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_1_Spec.ts
  26. cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_2_Spec.ts
  27. cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_2_spec.js
  28. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts
  29. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts
  30. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts
  31. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts
  32. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts
  33. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_1_spec.js
  34. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Url_Column_spec.ts
  35. cypress/e2e/Regression/ClientSide/Widgets/TableV2/server_side_filtering_spec_1.ts
  36. cypress/e2e/Regression/ServerSide/Datasources/Firestore_Basic_Spec.ts
  37. cypress/e2e/Regression/ServerSide/GenerateCRUD/MongoURI_Spec.ts
  38. cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts
  39. cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts
  40. cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts
  41. cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres1_Spec.ts
  42. cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts
  43. cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts
  44. cypress/e2e/Regression/ServerSide/MySQL_Datatypes/Basic_Spec.ts
  45. cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad1_Spec.ts
  46. cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts
  47. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Array_Spec.ts
  48. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Binary_Spec.ts
  49. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/BooleanEnum_Spec.ts
  50. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Character_Spec.ts
  51. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/DateTime_Spec.ts
  52. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Json_Spec.ts
  53. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Numeric_Spec.ts
  54. cypress/e2e/Regression/ServerSide/Postgres_DataTypes/UUID_Spec.ts
  55. cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts
  56. cypress/e2e/Regression/ServerSide/QueryPane/MySQL_Spec.ts
  57. cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js
  58. cypress/e2e/Regression/ServerSide/QueryPane/S3_2_spec.ts
To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Dec 7, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7126880941.
Workflow: ci-test-limited.
PR: 29405.

Copy link

github-actions bot commented Dec 7, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7126880941.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/Apps/CurrencyInputIssue_Spec.js

  2. cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js
  3. cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts
  4. cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts
  5. cypress/e2e/Regression/ClientSide/Widgets/List/ListWidgetParseError.ts
  6. cypress/e2e/Regression/ClientSide/Widgets/Multiselect/RTL_support.ts
  7. cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio2_spec.ts
  8. cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js
To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Dec 7, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7128165776.
Workflow: ci-test-limited.
PR: 29405.

Copy link

github-actions bot commented Dec 7, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7128165776.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:


To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Dec 7, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7128211615.
Workflow: ci-test-limited.
PR: 29405.

Copy link

github-actions bot commented Dec 7, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7128211615.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/Apps/CurrencyInputIssue_Spec.js

  2. cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js
  3. cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts
  4. cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio2_spec.ts
  5. cypress/e2e/Regression/ServerSide/ApiTests/API_Styles_spec.js
  6. cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js
To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Dec 8, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7138297992.
Workflow: ci-test-limited.
PR: 29405.

Copy link

github-actions bot commented Dec 9, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7152038485.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

Copy link

github-actions bot commented Dec 9, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7152107498.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@Aishwarya-U-R
Copy link
Contributor Author

/ci-test-limit

Copy link

github-actions bot commented Dec 9, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7152444808.
Workflow: ci-test-limited.
PR: 29405.

@Aishwarya-U-R
Copy link
Contributor Author

/ci-test-limit

Copy link

github-actions bot commented Dec 9, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7152454023.
Workflow: ci-test-limited.
PR: 29405.

Copy link

github-actions bot commented Dec 9, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7152444808.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

Copy link

github-actions bot commented Dec 9, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7152454023.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

Copy link

github-actions bot commented Dec 9, 2023

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7152738931.
Workflow: ci-test-limited.
PR: 29405.

Copy link

github-actions bot commented Dec 9, 2023

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7152738931.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/Widgets/Chart/Chart_Widget_Loading_spec.js

To know the list of identified flaky tests - Refer here

Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7162726394.
Workflow: ci-test-limited.
PR: 29405.

Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7162726394.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts

To know the list of identified flaky tests - Refer here

Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7163410746.
Workflow: ci-test-limited.
PR: 29405.

Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7163410746.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

Copy link
Contributor

@sarojsarab sarojsarab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aishwarya-U-R Aishwarya-U-R merged commit fe3863e into release Dec 11, 2023
@Aishwarya-U-R Aishwarya-U-R deleted the test/dynamicwaitremove branch December 11, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Adding this label to a PR prevents it from being listed in the changelog Tests Test issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants