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

[Testing] Enabling ContextMenu UITests from Xamarin.UITests to Appium - 2 #27405

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

nivetha-nagalingam
Copy link
Contributor

Description of Change
This PR focuses on re-enabling and updating following tests from the Xamarin.UITest framework to be compatible with Appium. The tests, previously commented out, are reviewed, and modified to ensure they are functional with the Appium framework.

Additionally introduced the ActivateContextMenu and DismissContextMenu methods in the HelperExtensions.cs file, aimed at improving the cross-platform testing approach by centralizing platform-specific logic into helper methods. The following changes have been made:

ActivateContextMenu:

A unified method to trigger platform-specific context actions on an element, simplifying context menu interactions across different platforms.

  • Android: Performs a long press gesture on the element.
  • Windows: Simulates a right-click (touch-and-hold) on the element.
  • iOS: Executes a swipe from right to left on the element.
  • Catalyst: Executes a scroll from right to left on the element.

DismissContextMenu:

A single method to dismiss the context menu, eliminating the need for platform-specific code in test cases.

  • Android: Taps the back arrow to dismiss the menu.
  • Other platforms: Taps at coordinates (150, 150) to dismiss the menu.

TestCases

  • Bugzilla31330
  • Bugzilla57317
  • Bugzilla58833
  • Bugzilla58875
  • Bugzilla59580
  • Issue3653
  • Issue1658
  • Issue2414
  • Issue6258
  • Github1331
  • Issue4314

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jan 28, 2025
Copy link
Contributor

Hey there @nivetha-nagalingam! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@nivetha-nagalingam nivetha-nagalingam added area-testing Unit tests, device tests partner/syncfusion Issues / PR's with Syncfusion collaboration labels Jan 28, 2025
@nivetha-nagalingam nivetha-nagalingam changed the title [Testing] Enabling ContextMenu UITests from Xamarin.UITests to Appium [Testing] Enabling ContextMenu UITests from Xamarin.UITests to Appium - 2 Jan 28, 2025
@nivetha-nagalingam nivetha-nagalingam marked this pull request as ready for review January 28, 2025 16:25
@Copilot Copilot bot review requested due to automatic review settings January 28, 2025 16:25
@nivetha-nagalingam nivetha-nagalingam requested a review from a team as a code owner January 28, 2025 16:25
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

// }
[Test]
[Category(UITestCategories.ActivityIndicator)]
public void ContextActionsIconImageSource()
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is failing on Android:

   at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2361
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2376
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, IQuery query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 699
   at UITest.Appium.HelperExtensions.TapBackArrow(IApp app, IQuery query) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 1983
   at UITest.Appium.HelperExtensions.TapBackArrow(IApp app, String customBackButtonIdentifier) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 1973
   at UITest.Appium.HelperExtensions.DismissContextMenu(IApp app) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2333
   at Microsoft.Maui.TestCases.Tests.Issues.Issue1658.ContextActionsIconImageSource() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue1658.cs:line 24
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants