[Testing] Extension for finding any element & test-7167 fix#26657
Merged
Conversation
Contributor
|
Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
Author
|
Hi, @anandhan-rajagopal the recently enabled test7167 seems to be failing. What do you think about this change? |
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
There was a problem hiding this comment.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (3)
src/TestUtils/src/UITest.Appium/HelperExtensions.cs:664
- [nitpick] The parameter
markedis ambiguous. It should be renamed toelementsfor clarity.
public static IUIElement WaitForAnyElement(this IApp app, string[] marked, string timeoutMessage = "Timed out waiting for element...", TimeSpan? timeout = null, TimeSpan? retryFrequency = null, TimeSpan? postTimeout = null)
src/TestUtils/src/UITest.Appium/HelperExtensions.cs:666
- [nitpick] The variable
resultis ambiguous. It should be renamed toqueryResultfor clarity.
IUIElement result() => FindAnyElement(app, marked);
src/TestUtils/src/UITest.Appium/HelperExtensions.cs:2124
- The error message should be more descriptive. Suggestion:
throw new InvalidOperationException($"None of the specified elements were found: {string.Join(", ", elements)}");
throw new InvalidOperationException($"Did not find any elements in the list: {string.Join(", ", elements)}");
rmarinho
approved these changes
Dec 16, 2024
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Scrolling through a list and waiting for a specific element can fail unpredictably due to varying screen sizes and swipe behavior. Instead, I recommend verifying that the list renders correctly after scrolling by checking for the presence of any new element in the array, rather than relying on a specific one.
This PR fixes the failing 7167 test