Skip to content
2 changes: 1 addition & 1 deletion src/Controls/tests/UITests/Tests/BorderUITests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void BordersWithVariousShapes()
{
App.WaitForElement("TargetView");
App.EnterText("TargetView", "BordersWithVariousShapes");
App.Click("GoButton");
App.Tap("GoButton");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Until now, we only had the Click method that made tap on mobile and click on desktop on the indicated element. After adding Tap, the tests are updated because now we have a direct replacement for what we had in Xamarin.UITest https://learn.microsoft.com/en-us/dotnet/api/xamarin.uitest.android.androidapp.tap?view=xamarin-uitest-sdk.


App.WaitForElement("WaitForStubControl");

Expand Down
4 changes: 2 additions & 2 deletions src/Controls/tests/UITests/Tests/CarouselViewUITests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ public void CarouselViewGoToNextCurrentItem()
CheckLabelValue("lblPosition", index);
CheckLabelValue("lblCurrentItem", index);

App.Click("btnNext");
App.Tap("btnNext");
CheckLabelValue("lblPosition", nextIndex);
CheckLabelValue("lblCurrentItem", nextIndex);
CheckLabelValue("lblSelected", nextIndex);
App.Click("btnPrev");
App.Tap("btnPrev");
}
}

Expand Down
20 changes: 10 additions & 10 deletions src/Controls/tests/UITests/Tests/DragAndDropUITests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void DragEvents()
{
App.WaitForElement("TargetView");
App.EnterText("TargetView", "DragAndDropEvents");
App.Click("GoButton");
App.Tap("GoButton");

App.WaitForElement("LabelDragElement");
App.DragAndDrop("LabelDragElement", "DragTarget");
Expand All @@ -57,10 +57,10 @@ public void DragAndDropBetweenLayouts()
{
App.WaitForElement("TargetView");
App.EnterText("TargetView", "DragAndDropBetweenLayouts");
App.Click("GoButton");
App.Tap("GoButton");

App.WaitForElement("ResetButton");
App.Click("ResetButton");
App.Tap("ResetButton");

App.WaitForElement("Red");
App.WaitForElement("Green");
Expand All @@ -87,7 +87,7 @@ public void PlatformDragEventArgs()
{
App.WaitForElement("TargetView");
App.EnterText("TargetView", "DragAndDropEventArgs");
App.Click("GoButton");
App.Tap("GoButton");

App.WaitForElement("LabelDragElement");
App.DragAndDrop("LabelDragElement", "DragTarget");
Expand Down Expand Up @@ -172,9 +172,9 @@ public void DragStartEventCoordinates()
{
App.WaitForElement("TargetView");
App.EnterText("TargetView", "DragAndDropBetweenLayouts");
App.Click("GoButton");
App.Tap("GoButton");

App.Click("ResetButton");
App.Tap("ResetButton");

App.WaitForElement("Blue");
App.WaitForElement("Green");
Expand Down Expand Up @@ -206,9 +206,9 @@ public void DragEventCoordinates()
{
App.WaitForElement("TargetView");
App.EnterText("TargetView", "DragAndDropBetweenLayouts");
App.Click("GoButton");
App.Tap("GoButton");

App.Click("ResetButton");
App.Tap("ResetButton");

App.WaitForElement("Blue");
App.WaitForElement("Green");
Expand Down Expand Up @@ -245,9 +245,9 @@ public void DropEventCoordinates()
{
App.WaitForElement("TargetView");
App.EnterText("TargetView", "DragAndDropBetweenLayouts");
App.Click("GoButton");
App.Tap("GoButton");

App.Click("ResetButton");
App.Tap("ResetButton");

App.WaitForElement("Blue");
App.WaitForElement("Green");
Expand Down
10 changes: 5 additions & 5 deletions src/Controls/tests/UITests/Tests/GestureRecognizerUITests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public void PointerGestureTest()

App.WaitForElement("TargetView");
App.EnterText("TargetView", "PointerGestureRecognizerEvents");
App.Click("GoButton");
App.Tap("GoButton");

App.WaitForElement("primaryLabel");
// using Tap in place of moving mouse for now
App.Click("primaryLabel");
App.Click("secondaryLabel");
App.Tap("primaryLabel");
App.Tap("secondaryLabel");

var secondaryLabelText = App.FindElement("secondaryLabel").GetText();
Assert.IsNotEmpty(secondaryLabelText);
Expand All @@ -51,10 +51,10 @@ public void DoubleTap()
{
App.WaitForElement("TargetView");
App.EnterText("TargetView", "DoubleTapGallery");
App.Click("GoButton");
App.Tap("GoButton");

App.WaitForElement("DoubleTapSurface");
App.DoubleClick("DoubleTapSurface");
App.DoubleTap("DoubleTapSurface");

var result = App.FindElement("DoubleTapResults").GetText();
Assert.AreEqual("Success", result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public GroupListViewHeaderIndexOutOfRange(TestDevice device) : base(device)
public void GroupListViewHeaderIndexOutOfRangeTest()
{
App.WaitForElement(ButtonId);
App.Click(ButtonId);
App.Tap(ButtonId);
App.WaitForElement(ButtonId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public void HideSoftInputOnTappedPageTest(string control, bool hideOnTapped)
App.DismissKeyboard();

if (hideOnTapped)
App.Click("HideSoftInputOnTappedTrue");
App.Tap("HideSoftInputOnTappedTrue");
else
App.Click("HideSoftInputOnTappedFalse");
App.Tap("HideSoftInputOnTappedFalse");

App.Click(control);
App.Tap(control);

Assert.True(App.IsKeyboardShown());

App.Click("EmptySpace");
App.Tap("EmptySpace");
Assert.AreEqual(!hideOnTapped, App.IsKeyboardShown());
}
finally
Expand All @@ -60,19 +60,19 @@ public void TogglingHideSoftInputOnTapped()
if (App.IsKeyboardShown())
App.DismissKeyboard();

App.Click("HideSoftInputOnTappedFalse");
App.Tap("HideSoftInputOnTappedFalse");

// Switch between enabling/disabling feature
for (int i = 0; i < 2; i++)
{
App.Click("HideKeyboardWhenTappingPage");
App.Tap("HideKeyboardWhenTappingPage");
Assert.True(App.IsKeyboardShown());
App.Click("EmptySpace");
App.Tap("EmptySpace");
Assert.AreEqual(false, App.IsKeyboardShown());

App.Click("DontHideKeyboardWhenTappingPage");
App.Tap("DontHideKeyboardWhenTappingPage");
Assert.True(App.IsKeyboardShown());
App.Click("EmptySpace");
App.Tap("EmptySpace");
Assert.AreEqual(true, App.IsKeyboardShown());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public IsInvokeRequiredRaceCondition(TestDevice device) : base(device)
public void ApplicationDispatcherIsInvokeRequiredRaceConditionCausesCrash()
{
App.WaitForElement("crashButton");
App.Click("crashButton");
App.Tap("crashButton");
App.WaitForElement("successLabel");
}
}
4 changes: 2 additions & 2 deletions src/Controls/tests/UITests/Tests/Issues/Issue10947.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public void CollectionViewHeaderShouldNotScroll()
var footerEntry = App.WaitForElement(FooterEntry);
var footerLocation = headerEntry.GetRect();

App.Click(HeaderEntry);
App.Tap(HeaderEntry);

var newHeaderEntry = App.WaitForElement(HeaderEntry);
var newHeaderLocation = headerEntry.GetRect();
Assert.AreEqual(headerLocation, newHeaderLocation);

App.Click(FooterEntry);
App.Tap(FooterEntry);

var newFooterEntry = App.WaitForElement(FooterEntry);
var newFooterLocation = headerEntry.GetRect();
Expand Down
4 changes: 2 additions & 2 deletions src/Controls/tests/UITests/Tests/Issues/Issue11501.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public void MakingFragmentRelatedChangesWhileAppIsBackgroundedFails(string scena
try
{
App.WaitForElement(scenario);
App.Click(scenario);
App.Tap(scenario);
App.WaitForElement("BackgroundMe");
App.BackgroundApp();
App.WaitForNoElement("BackgroundMe");
App.ForegroundApp();
App.WaitForElement("Restore");
App.Click("Restore");
App.Tap("Restore");
}
catch
{
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/tests/UITests/Tests/Issues/Issue12211.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void WhenChangingBoxViewOpacityThenValueIsCorrectlySet()

string? ChangeOpacityAndGetCurrentStatus()
{
App.Click(buttonId);
App.Tap(buttonId);

return GetCurrentOpacityStatus();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Controls/tests/UITests/Tests/Issues/Issue14257.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public Issue14257(TestDevice device) : base(device) { }
public void ResizeScrollViewAndTapButtonTest()
{
// Tapping the Resize button will change the height of the ScrollView content
App.Click("Resize");
App.Tap("Resize");

// Scroll down to the Test button. When the bug is present, the button cannot be tapped.
App.ScrollTo("Test");

App.WaitForElement("Test");
App.Click("Test");
App.Tap("Test");

// If we can successfully tap the button, the Success label will be displayed
Assert.IsTrue(App.WaitForTextToBePresentInElement("Result", "Success"));
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/tests/UITests/Tests/Issues/Issue15357.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task WhenTapButtonThenListViewsChangesVisibility()

string? TapButtonAndGetStatus()
{
App.Click(buttonId);
App.Tap(buttonId);

return GetStatus();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/tests/UITests/Tests/Issues/Issue15826.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task WhenTapButtonThenListViewsChangesVisibility()

string? TapButtonAndGetStatus()
{
App.Click(buttonId);
App.Tap(buttonId);

return GetStatus();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/tests/UITests/Tests/Issues/Issue16320.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void Issue16320Test()
TestDevice.Android
});

App.Click("Add");
App.Tap("Add");

Assert.NotNull(App.WaitForElement("item: 1"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/tests/UITests/Tests/Issues/Issue16386.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void HittingEnterKeySendsDone()
TestDevice.Windows,
});

App.Click("HardwareEnterKeyEntry");
App.Tap("HardwareEnterKeyEntry");
App.SendKeys(66);
App.WaitForElement("Success");
}
Expand Down
4 changes: 2 additions & 2 deletions src/Controls/tests/UITests/Tests/Issues/Issue16561.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ static void TapTwice(AppiumApp app, PointF point1, PointF point2)
{
// Windows will throw an error if we try to execute Taps with a TouchAction
// or if we try to use ExecuteScript, so we'll just use TapCoordinates instead
app.Click(point1.X, point1.Y);
app.Click(point2.X, point2.Y);
App.Tap(point1.X, point1.Y);
App.Tap(point2.X, point2.Y);
}
else if (driver is IOSDriver)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/tests/UITests/Tests/Issues/Issue17400.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void Issue17400Test()
"Is a Windows issue; see https://github.com/dotnet/maui/issues/17400");

App.WaitForElement("UpdateBtn");
App.Click("UpdateBtn");
App.Tap("UpdateBtn");

App.WaitForElement("WaitForStubControl");
VerifyScreenshot();
Expand Down
8 changes: 4 additions & 4 deletions src/Controls/tests/UITests/Tests/Issues/Issue17453.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ public void EntryClearButtonWorksEntryDoesntClearWhenNotClickingOnClear()
App.EnterText("RtlEntry", "Simple Text");

// Set focus
App.Click(rtlEntryRect.X, rtlEntryRect.Y);
App.Tap(rtlEntryRect.X, rtlEntryRect.Y);

// Tap on the entry but not on the clear button
App.Click(rtlEntryRect.CenterX(), rtlEntryRect.CenterY());
App.Tap(rtlEntryRect.CenterX(), rtlEntryRect.CenterY());

rtlEntryText = App.FindElement("RtlEntry").GetText();

Expand Down Expand Up @@ -63,11 +63,11 @@ public void EntryClearButtonWorks()
var rtlEntryRect = App.FindElement("RtlEntry").GetRect();

// Set focus
App.Click(rtlEntryRect.X, rtlEntryRect.Y);
App.Tap(rtlEntryRect.X, rtlEntryRect.Y);

// Tap Clear Button
var margin = 30;
App.Click(rtlEntryRect.X + margin, rtlEntryRect.Y + margin);
App.Tap(rtlEntryRect.X + margin, rtlEntryRect.Y + margin);

rtlEntryText = App.FindElement("RtlEntry").GetText();

Expand Down
2 changes: 1 addition & 1 deletion src/Controls/tests/UITests/Tests/Issues/Issue17694.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void Issue17694Test()
App.WaitForElement("Spin");

// 1. Click button
App.Click("Spin");
App.Tap("Spin");

VerifyScreenshot();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Controls/tests/UITests/Tests/Issues/Issue18617.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ public void CommandCanExecuteDisableButton()
App.WaitForElement("WaitForStubControl");

// 1. Press the 'On' button.
App.Click("OnButton");
App.Tap("OnButton");

// 2. The test fails if the 'On' button is still enabled or the 'Off' button is not enabled.
var status1 = App.FindElement("StatusLabel").GetText();
Assert.AreEqual("OnButton disabled OffButton enabled", status1);

// 3.Press the 'Off' button.
App.Click("OffButton");
App.Tap("OffButton");

// 4. The test fails if the 'Off' button is still enabled or the 'On' button is not enabled.
var status2 = App.FindElement("StatusLabel").GetText();
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/tests/UITests/Tests/Issues/Issue18675.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public async Task EditorIsReadOnlyPreventModify()
App.WaitForElement("WaitForStubControl");

// 1.The test fails if the placeholder text in the editor below is missing.
App.Click("IsReadOnlyEditor");
App.Tap("IsReadOnlyEditor");

// Delay for the Editor underline on Android to return from
// the selected state to normal state.
Expand Down
4 changes: 2 additions & 2 deletions src/Controls/tests/UITests/Tests/Issues/Issue18740.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public void Issue18740Test(string view)
{
// Navigate to the specific View test
App.WaitForElement("WaitForStubControl");
App.Click($"{view}Button");
App.Tap($"{view}Button");

// 1.Make sure keyboard starts out closed.
App.WaitForElement("WaitForStubControl");
App.DismissKeyboard();

// 2. Focus the Entry.
App.EnterText($"Test{view}", "test");
App.Click($"Test{view}");
App.Tap($"Test{view}");

// 3. Verify that the virtual keyboard appears.
Assert.IsTrue(App.IsKeyboardShown());
Expand Down
4 changes: 2 additions & 2 deletions src/Controls/tests/UITests/Tests/Issues/Issue18754.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public void Issue18754Test()
App.WaitForElement("WaitForStubControl");

// 1. Attempt to enter any text into the editor below.
App.Click("ReadOnlyEditor");
App.Tap("ReadOnlyEditor");

// 2. The test fails if the editor displays the input.
Assert.IsFalse(App.IsKeyboardShown());

// 3. Attempt to edit the text in the editor below.
App.Click("FilledReadOnlyEditor");
App.Tap("FilledReadOnlyEditor");

// 4. The test fails if the editor displays the input.
Assert.IsFalse(App.IsKeyboardShown());
Expand Down
Loading