feat(ensemble_test_runner): enhance app inspection with `--inspect-ui… - #2375
Open
sharjeelyunus wants to merge 29 commits into
Open
sharjeelyunus wants to merge 29 commits into
sharjeelyunus wants to merge 29 commits into
Conversation
…` and add `maxNumberOfTimes` timer configuration - Introduced `--inspect-ui` flag for live UI observation, allowing users to print UI elements and capture screenshots. - Updated README and documentation to reflect new inspection capabilities. - Added `maxNumberOfTimes` configuration to limit timer executions in YAML tests, preventing excessive polling during tests. - Enhanced step vocabulary with additional supported roles for UI elements. - Various improvements to test execution and error handling in the test runner.
…hanced error diagnostics - Added `FailureObserverArtifact` to capture UI state during test failures, including screenshots and UI element details. - Integrated failure observer capture into the test runner, allowing for better diagnostics in the HTML report. - Updated screenshot handling to include observer data when available, improving the context of failures. - Enhanced the HTML report to display observer information, providing insights into UI state at the time of failure. - Refactored related components to support the new observer functionality, ensuring compatibility with existing test workflows.
…ing adjustments - Reformatted code in `application_test_entry.dart`, `element_semantics.dart`, `smart_observe_elements_test.dart`, and `suggested_locator_test.dart` for better readability. - Adjusted line breaks and indentation in various sections to enhance clarity and maintainability of the codebase.
…th overlays in HTML reports - Updated `FailureObserverArtifact` to include overlays for UI elements during test failures, improving the context in HTML reports. - Modified screenshot handling to draw overlays on the existing failure frame instead of capturing a second screenshot. - Enhanced the HTML report to display observer metadata, including element overlays, providing better diagnostics for UI state at the time of failure. - Refactored related components to support the new overlay functionality, ensuring compatibility with existing test workflows.
…nhanced UI diagnostics - Introduced `StepObserverArtifact` to capture UI state during test steps, including overlays for better context in HTML reports. - Updated screenshot handling to support capturing step observers, ensuring accurate representation of UI elements during tests. - Refactored related components to integrate step observers into the test runner, enhancing the diagnostic capabilities of the HTML report. - Improved handling of observer metadata, allowing for better insights into UI state at the time of each step.
…r improved readability - Consolidated case statements for `ElementVisibleAssertion`, `ElementExistsAssertion`, and `ElementEnabledAssertion` by removing unnecessary line breaks, enhancing code clarity. - Adjusted test case formatting in `session_observe_test.dart` for better alignment and readability.
…d UI diagnostics - Introduced `captureStepReportArtifacts` to atomically capture screenshots and Observer overlays, ensuring they are paired correctly during test execution. - Added `StepReportCapturePolicy` and `StepScreenshotOptions` to manage screenshot timing and quality, enhancing the diagnostic capabilities of the test runner. - Updated various components to utilize the new report capture functionality, improving the accuracy of UI state representation in test reports. - Enhanced handling of mid-wait scenarios to allow Observer captures while the queue is busy, ensuring overlays match the correct screenshots. - Added tests for the new report capture functionality to ensure reliability and correctness.
…es and enhance test coverage - Updated element type inference to correctly classify 'checkbox' alongside 'switch' and 'toggle'. - Introduced a new test case to ensure that a keyed Checkbox within a tappable FlexRow is accurately observed as a 'checkbox' without inheriting the row's card type. - Enhanced the logic for resolving observed widget types to improve accuracy in UI diagnostics.
…p display - Updated HTML report rendering to include compact styles for observer highlights and chips, improving UI clarity. - Introduced logic to determine compactness based on dimensions, ensuring better layout for small controls. - Refactored `renderObserverChips` function to handle compact display and text formatting, enhancing readability in the report. - Adjusted CSS styles for compact observer chips to prevent overlap with row titles, improving user experience.
…d linting - Included `flutter_lints` version 2.0.3 in the dev_dependencies of the pubspec.yaml file to enhance code quality and maintainability through better linting practices.
…HTML reports - Implemented `fitScreenshotFrames` function to scale modal phone screenshots dynamically, ensuring they fit within available space while maintaining aspect ratio. - Refactored layout logic to improve the arrangement of screenshot chips, enhancing visual clarity and preventing overlap. - Adjusted CSS styles for screenshot overlays and modal components to improve responsiveness and user experience across different screen sizes. - Added media queries for better adaptability on smaller devices, ensuring optimal display of screenshots and controls.
… enhanced UI flexibility - Added new element types "card", "image", "svg", "gif", and "lottie" to the ensemble tests schema, expanding the range of UI components that can be utilized in tests. - This enhancement allows for more diverse UI representations and improves the testing capabilities of the framework.
…iagnostics in live binding scenarios - Introduced a new private getter `_isLiveBinding` to determine if the current binding is `LiveTestWidgetsFlutterBinding`, allowing for more accurate handling of transient navigation diagnostics. - Updated `_drainTransientFlutterDiagnostics` and `_tap` methods to conditionally handle transient navigation errors based on the binding type, ensuring that unit tests can surface issues immediately under `FakeAsync`. - Refactored `_liveDelay` to utilize `tester.binding.delayed` for better compatibility with live binding scenarios. - Adjusted test expectations in `flutter_error_fail_fast_test.dart` to accommodate the changes in error handling logic.
…ement trees and tooltips - Updated HTML report generation to include a nested element tree structure, improving the representation of UI components in test reports. - Introduced a toolbar with a "Copy JSON" button for easier data extraction from the observer. - Enhanced tooltip functionality for observer hints, providing contextual information on UI elements during tests. - Refactored related CSS styles to support the new layout and improve visual clarity in the reports. - Added tests to ensure the correct rendering of the observer tree and tooltip interactions.
…on handling - Refactored the `describeElement` function to improve the logic for determining the enabled state of UI elements, particularly for icon buttons and nested actionable controls. - Introduced a new function `isNestedActionableElement` to identify nested interactive elements under tappable cards or rows, ensuring accurate observation of UI components. - Updated the observed element tree logic to include nested actions, enhancing the accuracy of UI diagnostics in test reports. - Added tests to verify the correct behavior of nested actionable elements and their representation in the observer tree.
…e unused logic - Modified observer box handling to include the step target, improving visibility and interaction in the report. - Updated toolbar labels for clarity, changing "Observation highlights" to "Elements", "Observation labels" to "Labels", and "Action highlights" to "Target". - Removed unused action candidate logic and related functions to streamline the report generation process. - Adjusted tests to reflect the updated HTML structure and labels, ensuring consistency in the reporting functionality.
…nel and improved interactions - Introduced a side panel for the observer in the HTML report, allowing for better visibility of observer data alongside screenshots. - Updated the screenshot overlay preferences to include a tree view by default when observer data is present. - Enhanced the observer rendering logic to support hover interactions, improving user experience when navigating through observer elements. - Refactored CSS styles to accommodate the new layout and ensure responsive design across different screen sizes. - Adjusted tests to validate the new observer side panel and its interactions, ensuring consistency in reporting functionality.
…nteraction handling - Enhanced the logic for generating element locators, prioritizing labels and roles for unkeyed buttons and ensuring accurate representation in diagnostics. - Updated the handling of semantics labels for buttons and icons, allowing for better interaction feedback in test reports. - Introduced new tests to validate the behavior of unkeyed caption buttons and the treatment of decorative images without selectors. - Refactored the `describeElement` function to improve the identification of actionable elements based on their properties. - Adjusted CSS styles for observer elements to ensure consistent display and interaction across different UI components.
…ng for nested UI components - Enhanced the logic for handling nested elements under cards and toasts, ensuring that titles are not borrowed from child text. - Updated the `describeElement` function to better manage the semantics of icons and text within nested structures. - Introduced new utility functions to identify nested content and visual card containers, improving the accuracy of the observed element tree. - Added tests to validate the behavior of nested captions and the reporting of visual cards, ensuring correct representation in the observer tree. - Refactored existing tests to reflect changes in element handling and improve overall test coverage.
…on handling for UI elements - Improved the logic for generating suggested locators, ensuring accurate representation for tappable cards and icons. - Updated the handling of nested elements, allowing for better interaction feedback and reporting in diagnostics. - Introduced new tests to validate the behavior of unkeyed cards and icons, ensuring correct locator suggestions based on their interactable state. - Refactored existing functions to enhance the identification of actionable elements and their properties within the observed element tree. - Enhanced the overall test coverage for UI interactions and locator suggestions, ensuring robustness in the framework.
…ons and reporting - Introduced a modal overlay for displaying detailed information about observer elements, including navigation buttons for previous and next elements. - Implemented functions to manage observer element selection, navigation, and detail rendering, improving user interaction with the observer tree. - Updated CSS styles to support the new modal layout and enhance visual clarity for observer details. - Adjusted tests to validate the new observer element detail functionality and ensure accurate reporting of element properties.
…s schema - Introduced "toast" as a new element type in the ensemble tests schema, enhancing the flexibility and representation of UI components in tests.
…ling for nested UI components - Enhanced the logic for managing nested elements, ensuring accurate representation of accessibility labels and roles for buttons and cards. - Updated functions to prevent duplicate locator suggestions for nested elements, particularly in cases involving show-password functionality and icon buttons. - Introduced new utility functions to improve the identification of actionable elements and their properties within the observed element tree. - Added tests to validate the behavior of nested elements and their interaction handling, ensuring robustness in the framework.
…decorative glyphs - Updated the element semantics to prevent decorative bullet and password mask glyphs from being observed as text targets. - Introduced a new utility function, `isDecorativeGlyphCaption`, to identify and filter out non-informative text elements. - Enhanced locator candidate generation to skip suggestions for text that consists solely of decorative glyphs. - Added tests to ensure that decorative bullet glyphs do not clutter the observed elements and are not suggested as valid text targets.
- Updated the logic for inferring generic tap target types to improve handling of authoring IDs that encode shapes, specifically for "card" and "toast" elements. - Introduced a new utility function, `_authoringIdEncodesShape`, to accurately determine if an ID contains a specified token as a segment, enhancing the robustness of element identification. - Improved comments for clarity on the purpose of the changes and the expected behavior of the new utility function.
… handling - Added support for displaying hints in the HTML test report for input elements, improving accessibility and user guidance. - Updated the `StepScreenshotOptions` to refine the handling of before-action screenshots, ensuring required taps maintain visibility while optional taps utilize a contrast gate. - Enhanced the logic for managing nested elements, ensuring accurate representation of accessibility roles and preventing redundant locator suggestions for non-interactable icons. - Introduced tests to validate the new hint reporting functionality and the refined behavior of screenshot options, ensuring robustness in the framework.
…m handling - Updated the logic for identifying nested content within ExtenderItem-style entries to prevent duplicate "Edit name" buttons from appearing as root siblings. - Introduced new utility functions to accurately determine if an element is a grouping card ancestor or resembles an undecorated list entry. - Enhanced locator generation to prioritize scoped selectors for buttons within ExtenderItem entries, improving accessibility and interaction accuracy. - Added tests to validate the new behavior of ExtenderItem entries, ensuring correct nesting and unique locator suggestions for "Edit name" buttons.
- Introduced a new schema definition for element bounds, specifying properties such as left, top, width, and height with validation rules. - Updated the test authoring documentation to include examples of using logical-pixel bounds as a target field for actions. - Refactored extended step handlers to utilize the new bounds and locator schema, improving the accuracy of element targeting in assertions. - Enhanced the assertion engine to support new bounds-related checks, ensuring robust validation of UI elements during tests. - Improved the diagnostic UI snapshot functionality to capture and report element bounds, aiding in debugging and test reporting.
…on handling - Added support for the 'profiles' key in YAML test configurations, allowing for more flexible test setups. - Expanded the assertion engine to include new step types: 'expectValue' and 'expectSemanticsLabel', improving the accuracy of UI element validations. - Updated the logic for handling element bounds and visibility, ensuring that offscreen elements with geometry can be targeted effectively. - Enhanced tests to validate the new functionality, ensuring robust coverage for the updated features.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…
and addmaxNumberOfTimes` timer configuration--inspect-uiflag for live UI observation, allowing users to print UI elements and capture screenshots.maxNumberOfTimesconfiguration to limit timer executions in YAML tests, preventing excessive polling during tests.