Пример #1
0
        public void Enter()
        {
            var textBox = window.Get <TextBox>("textBox");

            textBox.Focus();
            AttachedKeyboard attachedKeyboard = window.Keyboard;

            attachedKeyboard.Enter("a");
            Assert.AreEqual("a", textBox.Text);
        }
Пример #2
0
        /// <summary>
        /// Navigating the menu by sending ALT and a number of keys
        /// </summary>
        /// <param name="keys">The combination of keys to send
        /// M is maintenance
        /// v is Service
        /// R is service routines these 3 brings you to the service routine menu, the last selects the test
        /// F is filter test
        /// N is noise test
        /// M is mirror/gain adjustment
        /// D is delay adjustment</param>
        private void SendKeysToMenu(string[] keys)
        {
            AttachedKeyboard keyboard = MainWindow.Keyboard;

            keyboard.PressSpecialKey(KeyboardInput.SpecialKeys.ALT);
            foreach (var key in keys)
            {
                keyboard.Enter(key);
            }
        }
        public void Enter()
        {
            SelectInputControls();
            var textBox = MainWindow.Get <TextBox>("TextBox");

            textBox.Focus();
            AttachedKeyboard attachedKeyboard = MainWindow.Keyboard;

            attachedKeyboard.Enter("a");
            Assert.Equal("a", textBox.Text);
        }
Пример #4
0
        public void CopyTest()
        {
            AttachedKeyboard attachedKeyboard = Window.Keyboard;

            textBox.Text = "userText";
            attachedKeyboard.HoldKey(KeyboardInput.SpecialKeys.CONTROL);
            attachedKeyboard.Enter("ac");
            attachedKeyboard.LeaveKey(KeyboardInput.SpecialKeys.CONTROL);
            Thread.Sleep(100);

            //check the text is the same as that on the clipboard
            string clipbrdText = Clipboard.GetText();

            Assert.AreEqual(textBox.Text, clipbrdText, "Text on clipboard does not match expected");
        }
Пример #5
0
        private static void SendKeysToMenu(string[] keys)
        {
            AttachedKeyboard keyboard = mainWindow.Keyboard;

            //Log("Sending ALT");
            keyboard.HoldKey(KeyboardInput.SpecialKeys.ALT);
            foreach (var key in keys)
            {
                //logger.Log($"Sending {key}");
                keyboard.Enter(key);
                Thread.Sleep(200);
            }

            keyboard.LeaveKey(KeyboardInput.SpecialKeys.ALT);
            Thread.Sleep(1000);
            //logger.Log($"{mainWindow.Title}");
        }
Пример #6
0
        void CopyTest()
        {
            var textBox = MainWindow.Get <TextBox>("TextBox");
            AttachedKeyboard attachedKeyboard = MainWindow.Keyboard;

            textBox.Text = "userText";
            attachedKeyboard.HoldKey(KeyboardInput.SpecialKeys.CONTROL);
            attachedKeyboard.Enter("ac");
            attachedKeyboard.LeaveKey(KeyboardInput.SpecialKeys.CONTROL);


            //check the text is the same as that on the clipboard
            Retry.For(() =>
            {
                string clipbrdText = Clipboard.GetText();
                Assert.Equal(textBox.Text, clipbrdText);
            }, TimeSpan.FromSeconds(5));
        }