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

#5322 - Refactor IDT import and save tests for optimized execution #5381

Conversation

split-ends
Copy link
Collaborator

Overview

This pull request refines and optimizes the test suite for IDT import and saving by clearing the canvas after each test without reloading the page in accordance with this task.

Key changes

  • Optimized tests to decrease execution time.
  • Reworked selectClearCanvasTool to automatically close all interfering popups before clicking the «Clear Canvas» button, making it faster to write tests with this approach in the future.
  • Added resetZoomLevelToDefault and chooseTab functions to encapsulate its logic.
  • Implemented markResetToDefaultState and processResetToDefaultState - these allow for broader and more flexible resetting of the test environment post-execution.

How the feature works? / How did you fix the issue?

The modifications have resulted in a reduction in the maximum execution time on a single worker — down to approximately 70 seconds (on my PC) from the previous ~170 seconds using the older page reload method. For tests where it is still necessary to reload the page, clear comments have been added to explain the rationale.

Reset Logic Enhancements

The logic for resetting states to default has been moved to afterEach so that if a test fails, clearing is performed in any case:

  • All active popups (combo boxes, various forms/windows) are closed using the Escape key until the «Clear Canvas» button can be clicked.
  • Based on predefined annotations for specific tests, appropriate actions are performed to return the system to its default state, minimizing interference with subsequent tests.

In the future, this will allow tests to be quickly translated by clearing the canvas without reloading the page by extending resetStateTypes.

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"
  • reviewers are notified about the pull request

- Convert test cases to decrease execution time.
- Rewrite selectClearCanvasTool to close all popups before clicking 'Clear Canvas'.
- Introduce resetZoomLevelToDefault and chooseTab functions for better test control.
- Implement markResetToDefaultState and processResetToDefaultState to extend test reset capabilities.
Copy link
Collaborator

@AlexeyGirin AlexeyGirin left a comment

Choose a reason for hiding this comment

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

Approved

@AlexeyGirin AlexeyGirin merged commit 507cd2a into master Aug 29, 2024
5 checks passed
@AlexeyGirin AlexeyGirin deleted the 5322-autotests-convert-idt-loading-saving-tests-to-clear-convas-execution branch August 29, 2024 13:02
rrodionov91 pushed a commit that referenced this pull request Sep 1, 2024
…5381)

* Refactor IDT import and save tests for optimized execution

- Convert test cases to decrease execution time.
- Rewrite selectClearCanvasTool to close all popups before clicking 'Clear Canvas'.
- Introduce resetZoomLevelToDefault and chooseTab functions for better test control.
- Implement markResetToDefaultState and processResetToDefaultState to extend test reset capabilities.

* Fix destructuring pattern in afterEach hook

---------

Co-authored-by: Svetlana Demid <[email protected]>
Guch1g0v pushed a commit that referenced this pull request Oct 17, 2024
…5381)

* Refactor IDT import and save tests for optimized execution

- Convert test cases to decrease execution time.
- Rewrite selectClearCanvasTool to close all popups before clicking 'Clear Canvas'.
- Introduce resetZoomLevelToDefault and chooseTab functions for better test control.
- Implement markResetToDefaultState and processResetToDefaultState to extend test reset capabilities.

* Fix destructuring pattern in afterEach hook

---------

Co-authored-by: Svetlana Demid <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autotests: Convert IDT loading saving tests to clear convas execution
2 participants