static SampleControlUITestBase() { // Start the app only once, so the tests runs don't restart it // and gain some time for the tests. AppInitializer.ColdStartApp(); }
public void Keyboard_Textbox_InsideScrollViewer_Validation() { Run("Uno.UI.Samples.Content.UITests.TextBoxControl.Input_Test_InsideScrollerViewer_Automated"); _app.WaitForElement(_app.Marked("MultilineTextBox")); var normalTextBox = _app.Marked("NormalTextBox"); var filledTextBox = _app.Marked("FilledTextBox"); var placeholderTextTextBox = _app.Marked("PlaceholderTextTextBox"); var disabledTextBox = _app.Marked("DisabledTextBox"); var multilineTextBox = _app.Marked("MultilineTextBox"); var numberTextBox = _app.Marked("NumberTextBox"); // Assert initial state Assert.AreEqual(string.Empty, normalTextBox.GetDependencyPropertyValue("Text")?.ToString()); Assert.AreEqual("Text", filledTextBox.GetDependencyPropertyValue("Text")?.ToString()); Assert.AreEqual(string.Empty, placeholderTextTextBox.GetDependencyPropertyValue("Text")?.ToString()); Assert.AreEqual(string.Empty, disabledTextBox.GetDependencyPropertyValue("Text")?.ToString()); Assert.AreEqual(string.Empty, multilineTextBox.GetDependencyPropertyValue("Text")?.ToString()); Assert.AreEqual(string.Empty, numberTextBox.GetDependencyPropertyValue("Text")?.ToString()); { // Setting focus on normalTextBox _app.FastTap(normalTextBox); _app.Wait(1); TakeScreenshot("0 - Focus on normalTextBox ", ignoreInSnapshotCompare: true); // Removing focus on normalTextBox _app.TapCoordinates(0f, 0f); _app.Wait(1); TakeScreenshot("0 - Remove Focus on normalTextBox", ignoreInSnapshotCompare: AppInitializer.GetLocalPlatform() == Platform.Android /*Keyboard predicted text can change*/); } { // Setting focus on normalTextBox _app.FastTap(filledTextBox); _app.Wait(1); TakeScreenshot("1 - Focus on filledTextBox", ignoreInSnapshotCompare: true); // Removing focus on normalTextBox _app.TapCoordinates(0f, 0f); _app.Wait(1); TakeScreenshot("1 - Remove Focus on filledTextBox", ignoreInSnapshotCompare: AppInitializer.GetLocalPlatform() == Platform.Android /*Keyboard predicted text can change*/); } { // Setting focus on placeholderTextTextBox _app.FastTap(placeholderTextTextBox); _app.Wait(1); TakeScreenshot("2 - Focus on placeholderTextTextBox", ignoreInSnapshotCompare: true); // Removing focus on placeholderTextTextBox _app.TapCoordinates(0f, 0f); _app.Wait(1); TakeScreenshot("2 - Remove Focus on placeholderTextTextBox"); } { // Setting focus on disabledTextBox _app.FastTap(disabledTextBox); _app.Wait(1); TakeScreenshot("3 - Focus on disabledTextBox", ignoreInSnapshotCompare: true); // Removing focus on disabledTextBox _app.TapCoordinates(0f, 0f); _app.Wait(1); TakeScreenshot("3 - Remove Focus on disabledTextBox"); } { // Setting focus on multilineTextBox _app.FastTap(multilineTextBox); _app.Wait(1); TakeScreenshot("4 - Focus on multilineTextBox", ignoreInSnapshotCompare: true); // Removing focus on multilineTextBox _app.TapCoordinates(0f, 0f); _app.Wait(1); TakeScreenshot("4 - Remove Focus on multilineTextBox"); } { // Setting focus on numberTextBox _app.FastTap(numberTextBox); _app.Wait(1); TakeScreenshot("5 - Focus on numberTextBox", ignoreInSnapshotCompare: true); // Removing focus on numberTextBox _app.TapCoordinates(0f, 0f); _app.Wait(1); TakeScreenshot("5 - Remove Focus on numberTextBox"); } }
protected static bool GetIsTouchInteraction() { var currentPlatform = AppInitializer.GetLocalPlatform(); return(currentPlatform == Platform.Android || currentPlatform == Platform.iOS); }