示例#1
0
        public void CommandTest()
        {
            RunningApp.Tap(ToggleCommandId);
            RunningApp.EnterText(EntryCommandParameter, "parameter");
            ShowFlyout();

            // API 19 workaround
            var commandResult = RunningApp.QueryUntilPresent(() =>
            {
                ShowFlyout();
                if (RunningApp.WaitForElement(CommandResultId)[0].ReadText() == "parameter")
                {
                    return(RunningApp.WaitForElement(CommandResultId));
                }

                return(null);
            })?.FirstOrDefault()?.ReadText();

            Assert.AreEqual("parameter", commandResult);
            RunningApp.EnterText(EntryCommandParameter, "canexecutetest");
            RunningApp.Tap(ToggleCommandCanExecuteId);

            commandResult = RunningApp.QueryUntilPresent(() =>
            {
                if (RunningApp.WaitForElement(CommandResultId)[0].ReadText() == "parameter")
                {
                    return(RunningApp.WaitForElement(CommandResultId));
                }

                return(null);
            })?.FirstOrDefault()?.ReadText();

            Assert.AreEqual("parameter", commandResult);
        }
示例#2
0
 public void Issue31333FocusEntryInListViewCell()
 {
     RunningApp.Tap(q => q.Marked("Focus Entry in ListView"));
     RunningApp.EnterText("Entry in ListView Success");
     WaitForTextQuery("Entry in ListView Success");
     RunningApp.Tap(q => q.Marked("Focus Entry in ListView"));
 }
示例#3
0
 public void TestFocusIsOnTheEndAfterSettingText()
 {
     RunningApp.Tap(c => c.Marked("userNameEditorEmptyString"));
     RunningApp.EnterText("1");
     PressEnter();
     Assert.Greater(RunningApp.Query(c => c.Marked("focused1")).Length, 0);
 }
示例#4
0
 public void Issue31333FocusEditorInTableViewCell()
 {
     RunningApp.Tap(q => q.Marked("Focus Editor in Table"));
     RunningApp.EnterText("Editor in TableView Success");
     WaitForTextQuery("Editor in TableView Success");
     RunningApp.Tap(q => q.Marked("Focus Editor in Table"));
 }
示例#5
0
        public void Theory(Type type, string value)
        {
            try { Convert.ChangeType(value, type); } catch { return; }

            Console.WriteLine($"TEST CASE: type={type.FullName}, value={value}");

            RunningApp.ClearText(Id.ValueEntry);

            var input  = string.Empty;
            var output = string.Empty;

            foreach (var c in value)
            {
                input += c;
                RunningApp.EnterText(Id.ValueEntry, $"{c}");

                if (TryParse(type, input, ref output))
                {
                    input = output;
                }

                if (string.IsNullOrEmpty(output))
                {
                    continue;
                }

                RunningApp.WaitForElement(q => q.Marked($"value: {output}"));
            }

            if (!Equals(Convert.ChangeType(value, type), Convert.ChangeType(output, type)))
            {
                throw new Exception($"Value '{value}' entered as '{output}'.");
            }
        }
示例#6
0
 public void Bugzilla35736Test()
 {
     RunningApp.WaitForElement(q => q.Marked("Bugzilla35736Editor"));
     RunningApp.EnterText(q => q.Marked("Bugzilla35736Editor"), "Testig");
     RunningApp.Tap(q => q.Marked("Bugzilla35736Button"));
     Assert.AreEqual("Testing", RunningApp.Query(q => q.Marked("Bugzilla35736Label"))[0].Text);
 }
示例#7
0
        public void CommandWorksWhenItsTheOnlyThingSet()
        {
            RunningApp.Tap(PushPageId);
            RunningApp.Tap(ToggleCommandId);
            RunningApp.EnterText(EntryCommandParameter, "parameter");

            // API 19 workaround
            var commandResult = RunningApp.QueryUntilPresent(() =>
            {
#if __ANDROID__
                TapBackArrow();
#else
                RunningApp.Tap("Page 0");
#endif

                if (RunningApp.WaitForElement(CommandResultId)[0].ReadText() == "parameter")
                {
                    return(RunningApp.WaitForElement(CommandResultId));
                }

                return(null);
            })?.FirstOrDefault()?.ReadText();

            Assert.AreEqual(commandResult, "parameter");
        }
示例#8
0
        public void SearchHandlerSizesCorrectly()
        {
            RunningApp.WaitForElement("SearchHandler");
            RunningApp.EnterText("SearchHandler", "Hello");
            var contentSize = RunningApp.WaitForElement("searchresult")[0].Rect;

            Assert.Less(contentSize.Height, 100);
        }
示例#9
0
 public void Bugzilla51825Test()
 {
     RunningApp.WaitForElement(q => q.Marked("Bugzilla51825SearchBar"));
     RunningApp.EnterText(q => q.Marked("Bugzilla51825SearchBar"), "Hello");
     RunningApp.WaitForElement(q => q.Text("Hello"));
     RunningApp.Tap("Bugzilla51825Button");
     RunningApp.WaitForElement(q => q.Text("Test"));
 }
示例#10
0
        public async Task ControlCanBeFocusedByUnfocusedEvent()
        {
            RunningApp.WaitForElement(TheEntry);
            await Task.Delay(4000);

            RunningApp.EnterText(Success);             // Should be typing into the Entry at this point
            RunningApp.WaitForElement(Success);
        }
示例#11
0
 public void Issue31333FocusEditorInTableViewCell()
 {
     RunningApp.Tap(q => q.Marked("Focus Editor in Table"));
     RunningApp.Screenshot("Editor control in TableView cell is focused");
     RunningApp.EnterText("Editor in TableView Success");
     Assert.True(RunningApp.Query(query => query.Text("Editor in TableView Success")).Length > 0);
     RunningApp.Screenshot("Editor in TableView Success");
 }
示例#12
0
        public void TestFocusIsOnTheEndAfterSettingText()
        {
            RunningApp.WaitForElement("userNameEditorEmptyString");
            RunningApp.Tap(c => c.Marked("userNameEditorEmptyString"));
            RunningApp.EnterText("1");
            PressEnter();
            var q = RunningApp.Query(c => c.Marked("userNameEditorEmptyString"));

            Assert.AreEqual("focused1", q[0].Text);
        }
示例#13
0
 public void Bugzilla29453Test()
 {
     RunningApp.Screenshot("I am at Issue Bugzilla29453");
     RunningApp.WaitForElement(q => q.Marked("Page 1"));
     RunningApp.Tap(q => q.Marked("btnGotoPage2"));
     RunningApp.Tap(q => q.Marked("entryText"));
     RunningApp.EnterText("XF");
     RunningApp.PressEnter();
     RunningApp.WaitForElement(q => q.Marked("Page 1"));
 }
        public void Bugzilla51825Test()
        {
            RunningApp.WaitForElement(q => q.Marked("Bugzilla51825SearchBar"));
            RunningApp.EnterText(q => q.Marked("Bugzilla51825SearchBar"), "Hello");
            var entry = RunningApp.Query(q => q.Marked("Bugzilla51825Label"))[0];

            Assert.AreEqual("Hello", entry.Text);
            RunningApp.Tap("Bugzilla51825Button");
            entry = RunningApp.Query(q => q.Marked("Bugzilla51825Label"))[0];
            Assert.AreEqual("Test", entry.Text);
        }
        public void CommandWorksWhenItsTheOnlyThingSet()
        {
            RunningApp.Tap(PushPageId);
            RunningApp.Tap(ToggleCommandId);
            RunningApp.EnterText(EntryCommandParameter, "parameter");
            TapBackArrow();

            var commandResult = RunningApp.WaitForElement(CommandResultId)[0].ReadText();

            Assert.AreEqual(commandResult, "parameter");
        }
示例#16
0
        public void InsanelyWideHorizontalSpacingShouldNotCrash()
        {
            RunningApp.WaitForElement("entryUpdate_Spacing");
            RunningApp.Tap("entryUpdate_Spacing");
            RunningApp.ClearText();
            RunningApp.EnterText("0,500");
            RunningApp.Tap("btnUpdate_Spacing");

            // If it hasn't crashed, we should still be able to find this
            RunningApp.WaitForElement("entryUpdate_Spacing");
        }
示例#17
0
		public void Execute()
		{
			RunningApp.EnterText("batch", string.Join("", _buttons));
			RunningApp.DismissKeyboard();
			RunningApp.Tap(Ids.Batch);

			foreach (var result in _result)
				RunningApp.WaitForElement(q => q.Marked($"{result}"));

			_buttons.Clear();
			_result.Clear();
		}
示例#18
0
        public string DateString(String format, String date)
        {
            RunningApp.ClearText("dateFormatString");
            RunningApp.EnterText("dateFormatString", format);
            RunningApp.PressEnter();
            RunningApp.ClearText("settingDate");
            RunningApp.EnterText("settingDate", date);
            RunningApp.PressEnter();
            var text = RunningApp.ReadDatePicker("dateCalendarOptions");

            return(text);
        }
示例#19
0
        public void Theory(Type type, string[] values)
        {
            RunningApp.ClearText(Ids.TypeEntry);
            RunningApp.EnterText(Ids.TypeEntry, type.FullName);
            RunningApp.Tap(Ids.BindButton);
            RunningApp.WaitForElement(q => q.Marked($"type: {type.FullName}"));

            foreach (var value in values)
            {
                Theory(type, value);
            }
        }
示例#20
0
        public string TimeString(String format, String time)
        {
            RunningApp.ClearText("timeFormatString");
            RunningApp.EnterText("timeFormatString", format);
            RunningApp.PressEnter();
            RunningApp.ClearText("settingTime");
            RunningApp.EnterText("settingTime", time);
            RunningApp.PressEnter();
            var text = RunningApp.ReadTimePicker("timeClockOptions");

            return(text);
        }
示例#21
0
        public void UnfocusingPasswordDoesNotHang()
        {
            RunningApp.WaitForElement(Entry);
            RunningApp.WaitForElement(Password);

            RunningApp.EnterText(Entry, "test");
            RunningApp.DismissKeyboard();
            RunningApp.EnterText(Password, "test");

            RunningApp.Tap(Entry);
            RunningApp.DismissKeyboard();
            RunningApp.WaitForElement(Success);
        }
示例#22
0
        public void HeaderDoesNotBreakIndexes()
        {
            RunningApp.WaitForElement("entryInsert");
            RunningApp.Tap("entryInsert");
            RunningApp.ClearText();
            RunningApp.EnterText("1");
            RunningApp.Tap("Insert");

            // If the bug is still present, then there will be
            // two "Item: 0" items instead of the newly inserted item
            // Or the header will have disappeared
            RunningApp.WaitForElement("Inserted");
            RunningApp.WaitForElement("This is the header");
        }
示例#23
0
        public void SwappingEmptyViews()
        {
            RunningApp.WaitForElement("FilterItems");
            RunningApp.Tap("FilterItems");
            RunningApp.EnterText("abcdef");

            // Default empty view
            RunningApp.WaitForElement("Nothing to see here.");

            RunningApp.Tap("ToggleEmptyView");

            // Other empty view
            RunningApp.WaitForElement("No results matched your filter.");
        }
示例#24
0
        public void VerifyEditorTextChangeEventsAreFiring()
        {
            RunningApp.WaitForElement("EditorAutomationId");
            RunningApp.EnterText("EditorAutomationId", "Test 1");

            Assert.AreEqual("Test 1", RunningApp.WaitForElement("EditorAutomationId")[0].ReadText());
            Assert.AreEqual("Test 1", RunningApp.WaitForElement("EntryAutomationId")[0].ReadText());

            RunningApp.ClearText("EntryAutomationId");
            RunningApp.EnterText("EntryAutomationId", "Test 2");

            Assert.AreEqual("Test 2", RunningApp.WaitForElement("EditorAutomationId")[0].ReadText());
            Assert.AreEqual("Test 2", RunningApp.WaitForElement("EntryAutomationId")[0].ReadText());
        }
示例#25
0
        public void CommandTest()
        {
            RunningApp.Tap(ToggleCommandId);
            RunningApp.EnterText(EntryCommandParameter, "parameter");
            ShowFlyout();

            var commandResult = RunningApp.WaitForElement(CommandResultId)[0].ReadText();

            Assert.AreEqual(commandResult, "parameter");
            RunningApp.EnterText(EntryCommandParameter, "canexecutetest");
            RunningApp.Tap(ToggleCommandCanExecuteId);

            commandResult = RunningApp.WaitForElement(CommandResultId)[0].ReadText();
            Assert.AreEqual(commandResult, "parameter");
        }
示例#26
0
        public void TestCursorPositionAndSelection()
        {
            RunningApp.WaitForElement("CursorTextEntry");

            RunningApp.ClearText("CursorStart");
            RunningApp.EnterText("CursorStart", "2");
            RunningApp.ClearText("SelectionLength");
            RunningApp.EnterText("SelectionLength", "3");
            RunningApp.DismissKeyboard();
            RunningApp.Tap("Update");
            RunningApp.Screenshot("Text selection from char 2 length 3.");

            RunningApp.Tap("CursorTextEntry");
            Assert.AreEqual("0", RunningApp.WaitForElement("SelectionLength")[0].ReadText());
        }
示例#27
0
        public void InvalidScrollToIndexShouldNotCrash()
        {
            RunningApp.WaitForElement("GroupIndexEntry");
            RunningApp.Tap("GroupIndexEntry");
            RunningApp.ClearText();
            RunningApp.EnterText("55");

            RunningApp.Tap("ItemIndexEntry");
            RunningApp.ClearText();
            RunningApp.EnterText("1");

            RunningApp.Tap("GoButton");

            // Should scroll enough to display this item
            RunningApp.WaitForElement("Avengers");
        }
示例#28
0
        public void CanScrollToGroupAndItemIndex()
        {
            RunningApp.WaitForElement("GroupIndexEntry");
            RunningApp.Tap("GroupIndexEntry");
            RunningApp.ClearText();
            RunningApp.EnterText("5");

            RunningApp.Tap("ItemIndexEntry");
            RunningApp.ClearText();
            RunningApp.EnterText("1");

            RunningApp.Tap("GoButton");

            // Should scroll enough to display this item
            RunningApp.WaitForElement("Squirrel Girl");
        }
示例#29
0
        public void CanScrollToGroupAndItem()
        {
            RunningApp.WaitForElement("GroupNameEntry");
            RunningApp.Tap("GroupNameEntry");
            RunningApp.ClearText();
            RunningApp.EnterText("Heroes for Hire");

            RunningApp.Tap("ItemNameEntry");
            RunningApp.ClearText();
            RunningApp.EnterText("Misty Knight");

            RunningApp.Tap("GoItemButton");

            // Should scroll enough to display this item
            RunningApp.WaitForElement("Luke Cage");
        }
示例#30
0
        public void PaddingWithoutSafeArea()
        {
            RunningApp.EnterText(q => q.Raw($"* marked:'{PaddingEntry}'"), "0");
            RunningApp.Tap(PaddingTest);
            var zeroPadding = RunningApp.WaitForElement(PaddingLabel);

            Assert.AreEqual(1, zeroPadding.Length);
            RunningApp.Tap(Reset);

            RunningApp.EnterText(PaddingEntry, "100");
            RunningApp.Tap(PaddingTest);
            var somePadding = RunningApp.WaitForElement(PaddingLabel);

            Assert.AreEqual(1, somePadding.Length);

            Assert.Greater(somePadding[0].Rect.Y, zeroPadding[0].Rect.Y);
        }