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 #27403

Merged
merged 10 commits into from
Feb 17, 2025

Conversation

NafeelaNazhir
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

  • Bugzilla42832
  • Bugzilla44338
  • Bugzilla45027
  • Bugzilla46363
  • Bugzilla46363_2
  • Issue1455
  • Issue2289
  • Issue2794

@NafeelaNazhir NafeelaNazhir added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 28, 2025
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jan 28, 2025
Copy link
Contributor

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

@NafeelaNazhir NafeelaNazhir added the area-testing Unit tests, device tests label Jan 28, 2025
@NafeelaNazhir NafeelaNazhir marked this pull request as ready for review January 28, 2025 14:56
@Copilot Copilot bot review requested due to automatic review settings January 28, 2025 14:56
@NafeelaNazhir NafeelaNazhir requested a review from a team as a code owner January 28, 2025 14:56
/// </summary>
/// <param name="app">Represents the main gateway to interact with an app.</param>
/// <param name="element">The element on which to perform the context action.</param>
public static void ActivateContextMenu(this IApp app, string element)
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM. Here in this PR #26204 we have actions with the same, although using internal commands from each native driver. That is, in Android a long press is done etc.
Although the result is the same, in case something changes by updating Appium and something becomes deprecated, I think it is better to have a class per platform and to use each driver directly.

}
else
{
app.TapCoordinates(150, 150);
Copy link
Contributor

Choose a reason for hiding this comment

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

Better on the center of the screen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsuarezruiz , As mentioned in the last comment, we will wait for the specified PR to be merged, then we will rebase and enable these test cases.

@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Jan 29, 2025

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Let's push to merge #26204 and then, just rebase and use it in the added tests.

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho merged commit 1342dbd into dotnet:main Feb 17, 2025
123 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.

None yet

3 participants