diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/EntryShouldApplyCursorPositionCorrectly.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/EntryShouldApplyCursorPositionCorrectly.png deleted file mode 100644 index a7fc92f483a6..000000000000 Binary files a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/EntryShouldApplyCursorPositionCorrectly.png and /dev/null differ diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue19109.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue19109.cs index ab5712a14189..cf8977a1eb9e 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue19109.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue19109.cs @@ -30,14 +30,29 @@ public Issue19109() HorizontalOptions = LayoutOptions.Center }; + var rangeLabel = new Label + { + AutomationId = "RangeLabel", + Text = "Range not set yet", + HorizontalOptions = LayoutOptions.Center + }; + button.Clicked += (sender, e) => { entry.Focus(); + + #if IOS + if (entry.Handler?.PlatformView is UIKit.UITextField textField && textField.SelectedTextRange != null) + { + rangeLabel.Text = $"Start={textField.GetOffsetFromPosition(textField.BeginningOfDocument, textField.SelectedTextRange.Start)}, " + + $"End={textField.GetOffsetFromPosition(textField.BeginningOfDocument, textField.SelectedTextRange.End)}"; + } + #endif }; Content = new StackLayout { - Children = { entry, button, label }, + Children = { entry, button, label, rangeLabel }, Padding = new Thickness(20), Spacing = 10 }; diff --git a/src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/EntryShouldApplyCursorPositionCorrectly.png b/src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/EntryShouldApplyCursorPositionCorrectly.png deleted file mode 100644 index e69648fb494a..000000000000 Binary files a/src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/EntryShouldApplyCursorPositionCorrectly.png and /dev/null differ diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19109.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19109.cs index 73bfdbc0036a..f50f1d8c122e 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19109.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19109.cs @@ -1,3 +1,4 @@ +#if IOS using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -17,7 +18,9 @@ public void EntryShouldApplyCursorPositionCorrectly() App.WaitForElement("EntryControl"); App.WaitForElement("FocusButton"); App.Tap("FocusButton"); - VerifyScreenshot(); + var rangeText = App.WaitForElement("RangeLabel").GetText(); + Assert.That(rangeText, Is.EqualTo("Start=5, End=5"), "Cursor position not applied correctly"); } } } +#endif diff --git a/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/EntryShouldApplyCursorPositionCorrectly.png b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/EntryShouldApplyCursorPositionCorrectly.png deleted file mode 100644 index aa906baf04d1..000000000000 Binary files a/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/EntryShouldApplyCursorPositionCorrectly.png and /dev/null differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/EntryShouldApplyCursorPositionCorrectly.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/EntryShouldApplyCursorPositionCorrectly.png deleted file mode 100644 index 1bcdb30c1579..000000000000 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/EntryShouldApplyCursorPositionCorrectly.png and /dev/null differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/RadioButtonUpdateValueInsideBorderYes.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/RadioButtonUpdateValueInsideBorderYes.png index ad68d6d05cdd..a262847a7f77 100644 Binary files a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/RadioButtonUpdateValueInsideBorderYes.png and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/RadioButtonUpdateValueInsideBorderYes.png differ