fix: Add method to locate Import Content dialog and refactor related code#555
Merged
Roopan-Microsoft merged 3 commits intodevfrom Apr 21, 2026
Merged
fix: Add method to locate Import Content dialog and refactor related code#555Roopan-Microsoft merged 3 commits intodevfrom
Roopan-Microsoft merged 3 commits intodevfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the HomePageV2 E2E page object to locate the “Import Content” modal more robustly across Fluent UI versions by centralizing dialog lookup logic and updating call sites.
Changes:
- Added
_get_import_dialog()helper to find the “Import Content” dialog via eitherrole="dialog"orrole="alertdialog". - Updated multiple workflows to use
_get_import_dialog()instead of directly queryingalertdialog. - Enhanced failure logging in
select_schema_for_file()when a target file row isn’t found.
Comments suppressed due to low confidence (1)
tests/e2e-test/pages/HomePageV2.py:193
- select_schema_for_file() calls file_labels.count() immediately and iterates inner_text() without waiting for the uploaded file rows/labels to render. Because locator.count() doesn’t wait, a slow UI render can yield count==0 and trigger the 'file not found' path even though the file appears moments later. Add an explicit wait (e.g., expect(file_labels.first).to_be_visible()/to_have_count(>0) with a timeout) before counting/iterating.
# Get all schema comboboxes and file labels in the import dialog
schema_dropdowns = dialog.get_by_placeholder("Select Schema")
file_labels = dialog.locator("strong")
# Find the index of this file among all listed files
count = file_labels.count()
target_index = -1
for i in range(count):
label_text = file_labels.nth(i).inner_text().strip()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…and error reporting
Roopan-Microsoft
approved these changes
Apr 21, 2026
Ayaz-Microsoft
added a commit
that referenced
this pull request
Apr 21, 2026
Regenerated uv.lock files for ContentProcessor and ContentProcessorAPI to align with pydantic 2.13.3 after new commits landed on dev. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Purpose
This pull request refactors the way the "Import Content" dialog is located in the
HomePageV2.pyend-to-end test page object. The main improvement is the introduction of a new helper method that robustly finds the dialog regardless of whether it uses thedialogoralertdialogrole, addressing compatibility with different versions of Fluent UI. All dialog lookups throughout the file are updated to use this new method, improving maintainability and reliability of the tests.Dialog lookup improvements:
_get_import_dialoghelper method to locate the "Import Content" dialog by checking bothdialogandalertdialogroles, ensuring compatibility with different Fluent UI versions.get_by_role("alertdialog", name="Import Content")(and similar patterns) with the new_get_import_dialogmethod across the file, standardizing dialog access and reducing code duplication. [1] [2] [3] [4] [5] [6]Test robustness and logging:
select_schema_for_fileby logging the dialog content when a file is not found, aiding test debugging.select_schema_for_file, making the test less flaky due to asynchronous UI updates.Other dialog-related adjustments:
validate_import_without_collectionto use a combined selector for bothdialogandalertdialogroles, increasing flexibility.Does this introduce a breaking change?
Golden Path Validation
Deployment Validation