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 waits from Helpers + Flaky fixes #29856

Merged
merged 36 commits into from
Jan 5, 2024

Conversation

Aishwarya-U-R
Copy link
Contributor

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

Description

  • This PR removes static waits from below helpers & added dynamic checks as needed:
    - apiPage.CreateApi(), apiPage.CreateAndFillGraphqlApi()
    - app/client/cypress/support/Pages/AppSettings/ThemeSettings.ts
    - cy.CreateNewAppInNewWorkspace() - replaced static wait with dynamic check
    - dataSources.NavigateToDSCreateNew() - removed wait, updated logic
    - agHelper.VerifyEvaluatedValue()
  • Flaky fix below specs:
    - /Git/GitSync/GitSyncedApps_spec.js (fixed testcase # 2 - 4th onwards is failing due to childbranch/master change - to be checked further)
    - /Git/GitDiscardChange/DiscardChanges_spec.js (EditorNavigation.NavigateToDatasource(), Sidebar.navigate())
    - /BugTests/ApiBugs_Spec.ts (3rd case)
    - /Dropdown/Dropdown_onOptionChange_spec.js (3rd case)
    - /ServerSide/ApiTests/API_Search_spec.js (3rd case)
  • Removed extra Refresh call from before hook in /BugTests/ApiBugs_Spec.ts

Type of change

  • Script update (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

  • Bug Fixes

    • Improved the reliability of API creation processes.
    • Enhanced the user experience in theme settings by removing unnecessary delays.
    • Streamlined navigation in the data source creation workflow.
  • Refactor

    • Optimized test automation scripts for better performance and maintainability.
    • Updated element interaction methods to increase test robustness.
    • Refined logic for selecting and asserting UI components within test cases.
  • Chores

    • Adjusted test suite configurations to include new test cases and exclude a specific test file.
    • Removed redundant page refresh steps to improve test execution speed.
  • Tests

    • Added new assertions to validate the evaluated values in test scenarios.
    • Simplified data source and query creation in widget test cases for clarity.

Copy link
Contributor

coderabbitai bot commented Dec 26, 2023

Walkthrough

Walkthrough

The updates across various Cypress support and test files reflect a concerted effort to enhance test reliability and maintainability. Key changes include the removal of direct cy.get calls in favor of custom assertion methods, the elimination of hardcoded sleep/wait commands, and adjustments to element access modifiers. These refinements aim to reduce flakiness and improve the clarity of the test suite. The removal of unnecessary page refreshes and imports, along with the inclusion of new logic for handling API names, indicate a cleaner and more efficient testing codebase.

Changes

File Path Change Summary
.../ApiPage.ts
.../ThemeSettings.ts
.../DataSources.ts
Enhanced robustness in CreateApi methods; shifted to custom visibility assertions; removed and added element declarations. Changed member visibility; simplified method logic.
.../Sidebar.ts
.../EditorNavigation.ts
.../AggregateHelper.ts
Modified button click logic to use alias and separate assertions. Altered element selection logic to use alias for attribute check. Included new method call post-update; modified method to use custom element retrieval.
.../Git/GitSyncedApps_spec.js
.../limited-tests.txt
.../WorkspaceCommands.js
Updated test descriptions; refactored method calls; removed import. Adjusted test file inclusion/exclusion logic. Replaced wait/sleep commands with custom assertion functions.
.../BugTests/ApiBugs_Spec.ts
.../Widgets/Dropdown/..._onOptionChange_spec.js
Removed page refresh; added new assertion for evaluated value check. Removed unused imports; refactored test case to utilize simplified methods.
.../ServerSide/ApiTests/API_Search_spec.js Refactored test case logic and control flow.

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 your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit's AI:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid.
    • @coderabbitai read the files in the src/scheduler package and generate README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@Aishwarya-U-R Aishwarya-U-R changed the title test: Cypress | Replace static with Dynamic checks test: Cypress | Replace static waits from Helpers Dec 26, 2023
@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 26, 2023
Copy link

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

Copy link

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

Copy link

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

  1. cypress/e2e/Regression/ClientSide/ActionExecution/Error_handling_spec.ts

  2. cypress/e2e/Regression/ClientSide/ActionExecution/uiToCode_spec.ts
  3. cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC1_spec.ts
  4. cypress/e2e/Regression/ClientSide/Binding/API_with_List_Widget_spec.js
  5. cypress/e2e/Regression/ClientSide/Binding/Button_with_API_spec.js
  6. cypress/e2e/Regression/ClientSide/Binding/JSObjectToListWidget_Spec.ts
  7. cypress/e2e/Regression/ClientSide/Binding/TableTextPagination_spec.js
  8. cypress/e2e/Regression/ClientSide/Binding/TableV2TextPagination_spec.js
  9. cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Derived_Column_spec.js
  10. cypress/e2e/Regression/ClientSide/Binding/TableV2_Widget_API_Pagination_spec.js
  11. cypress/e2e/Regression/ClientSide/Binding/Table_Api_spec.js
  12. cypress/e2e/Regression/ClientSide/Binding/Table_Widget_API_Derived_Column_spec.js
  13. cypress/e2e/Regression/ClientSide/Binding/Table_Widget_API_Pagination_spec.js
  14. cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts
  15. cypress/e2e/Regression/ClientSide/BugTests/Binding_Bug28731_Spec.ts
  16. cypress/e2e/Regression/ClientSide/BugTests/CatchBlock_Spec.ts
  17. cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26941_Spec.ts
  18. cypress/e2e/Regression/ClientSide/BugTests/DS_Bug28985_spec.ts
  19. cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js
  20. cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js
  21. cypress/e2e/Regression/ClientSide/JSObject/JSObjectMutation_spec.ts
  22. cypress/e2e/Regression/ClientSide/Linting/AsyncFunctionsBoundInSyncFields_Spec.ts
  23. cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts
  24. cypress/e2e/Regression/ClientSide/Linting/EntityPropertiesLint_spec.ts
  25. cypress/e2e/Regression/ClientSide/Linting/ErrorReporting_spec.ts
  26. cypress/e2e/Regression/ClientSide/OneClickBinding/PropertyControl_spec.ts
  27. cypress/e2e/Regression/ClientSide/OtherUIFeatures/EntityBottomBar_spec.ts
  28. cypress/e2e/Regression/ClientSide/PeekOverlay/PeekOverlay_Spec.ts
  29. cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts
  30. cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts
  31. cypress/e2e/Regression/ClientSide/Templates/ForkTemplateToGitConnectedApp.js
  32. cypress/e2e/Regression/ClientSide/Widgets/Button/Button2_spec.ts
  33. cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifier_spec.ts
  34. cypress/e2e/Regression/ClientSide/Widgets/ListV2/DefaultSelectItem_spec.ts
  35. cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio2_spec.ts
  36. cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Derived_Column_Data_validation_spec.js
  37. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Derived_Column_Data_validation_spec.js
  38. cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts
  39. cypress/e2e/Regression/ServerSide/ApiTests/API_All_Verb_spec.js
  40. cypress/e2e/Regression/ServerSide/ApiTests/API_Search_spec.js
  41. cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts
  42. cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts
  43. cypress/e2e/Sanity/Datasources/DatasourceForm_spec.js
  44. cypress/e2e/Sanity/Datasources/RestApiDatasource_spec.js
  45. cypress/e2e/Smoke/GenerateCRUD/Generate_Crud_New_Page_spec.ts
To know the list of identified flaky tests - Refer here

Copy link

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

  1. cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts

  2. cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js
  3. cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js
  4. cypress/e2e/Regression/ClientSide/Templates/ForkTemplateToGitConnectedApp.js
  5. cypress/e2e/Regression/ClientSide/Widgets/Audio/AudioRecorder1_spec.ts
  6. cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts
To know the list of identified flaky tests - Refer here

Copy link

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

Copy link

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

  1. cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts

  2. cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js
  3. cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js
  4. cypress/e2e/Regression/ClientSide/Templates/ForkTemplateToGitConnectedApp.js
  5. cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts
To know the list of identified flaky tests - Refer here

Copy link

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

  1. cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js

  2. cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js
  3. cypress/e2e/Regression/ClientSide/Templates/ForkTemplateToGitConnectedApp.js
  4. cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_2_spec.js
  5. cypress/e2e/Regression/ServerSide/ApiTests/API_Search_spec.js
  6. cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts
To know the list of identified flaky tests - Refer here

@Aishwarya-U-R
Copy link
Contributor Author

/ci-test-limit

Copy link

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

Copy link

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

Copy link

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

  1. cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js

To know the list of identified flaky tests - Refer here

Copy link

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

  1. cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts

  2. cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js
  3. cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js
  4. cypress/e2e/Regression/ClientSide/Templates/ForkTemplateToGitConnectedApp.js
  5. cypress/e2e/Regression/ServerSide/ApiTests/API_Search_spec.js
  6. cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts
To know the list of identified flaky tests - Refer here

@Aishwarya-U-R
Copy link
Contributor Author

/ci-test-limit

Copy link

github-actions bot commented Jan 4, 2024

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

Copy link

github-actions bot commented Jan 4, 2024

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

Copy link

github-actions bot commented Jan 4, 2024

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

  1. cypress/e2e/Regression/ClientSide/BugTests/ApiBug6732_Spec.ts

  2. cypress/e2e/Regression/ClientSide/BugTests/InputTruncateCheck_Spec.ts
  3. cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts
  4. cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts
  5. cypress/e2e/Regression/ClientSide/Linting/ErrorReporting_spec.ts
  6. cypress/e2e/Regression/ClientSide/Refactoring/Refactoring_spec.ts
  7. cypress/e2e/Regression/ClientSide/Templates/ForkTemplateToGitConnectedApp.js
  8. cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js
  9. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_tabledata_schema_spec.js
  10. cypress/e2e/Regression/ServerSide/ApiTests/API_EvaluatedValue_spec.ts
  11. cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts
  12. cypress/e2e/Regression/ServerSide/ApiTests/API_Search_spec.js
  13. cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts
To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Jan 4, 2024

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

  1. cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts

  2. cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js
To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Jan 4, 2024

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

Copy link

github-actions bot commented Jan 4, 2024

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

  1. cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js

  2. cypress/e2e/Regression/ServerSide/ApiTests/API_Search_spec.js
To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Jan 4, 2024

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

@Aishwarya-U-R Aishwarya-U-R changed the title test: Cypress | Replace static waits from Helpers test: Cypress | Replace static waits from Helpers + Flaky fixes Jan 4, 2024
Copy link

github-actions bot commented Jan 4, 2024

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

  1. cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_tabledata_schema_spec.js

  2. cypress/e2e/Regression/ServerSide/ApiTests/API_TestExecuteWithDynamicBindingInUrl_spec.ts
To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Jan 4, 2024

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

Copy link

github-actions bot commented Jan 4, 2024

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

  1. cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker3_spec.ts

To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Jan 4, 2024

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

Copy link

github-actions bot commented Jan 4, 2024

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

Copy link

github-actions bot commented Jan 4, 2024

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

@Aishwarya-U-R Aishwarya-U-R merged commit 01b31b3 into release Jan 5, 2024
13 checks passed
@Aishwarya-U-R Aishwarya-U-R deleted the test/dynamicwaitremove branch January 5, 2024 06:12
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.

3 participants