Beispiel #1
0
        /// <summary>
        /// ClickFirstAction
        /// </summary>
        public void ClickMappingTab(int x = 280)
        {
            UITestControl uIItemImage = StudioWindow.GetChildren()[0].GetChildren()[2];

            Playback.Wait(500);
            Mouse.Click(uIItemImage, new Point(x, 25));
        }
        public void ClickNewWebSource()
        {
            var control = StudioWindow.GetChildren()[0].GetChildren()[2];

            control.WaitForControlEnabled();
            Mouse.Click(control, new Point(410, 79));
        }
Beispiel #3
0
        public void ClickSave()
        {
            var control = StudioWindow.GetChildren()[0].GetChildren()[2];

            control.WaitForControlEnabled();
            Mouse.Click(control, new Point(648, 501));
        }
Beispiel #4
0
        public void ClickFourthAction()
        {
            var kids      = StudioWindow.GetChildren();
            var grandKids = kids[0].GetChildren();

            Mouse.Click(grandKids[2], new Point(172, 229));
        }
        private UITestControl GetLocalHostExplorerTree()
        {
            var SelectActivityDialog = StudioWindow.GetChildren()[0];

            foreach (var child in SelectActivityDialog.GetChildren())
            {
                var navViewAutoID = child.GetProperty("AutomationID").ToString();
                if (navViewAutoID.Contains("TheNavigationView"))
                {
                    foreach (var navigationViewChid in child.GetChildren())
                    {
                        var navAutoID = navigationViewChid.GetProperty("AutomationID").ToString();
                        if (navAutoID.Contains("Navigation"))
                        {
                            foreach (var navChild in navigationViewChid.GetChildren())
                            {
                                if (navChild.ControlType == ControlType.TreeItem)
                                {
                                    return(navChild);
                                }
                            }
                        }
                    }
                }
            }
            throw new UITestControlNotFoundException("Localhost explorer tree not found, Activity Drop Window may not have openned yet.");
        }
        /// <summary>
        /// ClickOK
        /// </summary>
        public void ClickDone(int waitAmt = 0)
        {
            Playback.Wait(waitAmt);
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            Mouse.Click(wizard, new Point(650, 450));
        }
        public void CloseAllTabs()
        {
            try
            {
                StudioWindow.SetFocus();
                // first try closing wizards ;)
                for (var i = 0; i < 5; i++)
                {
                    Playback.Wait(150);
                    SendKeys.SendWait("{ESC}");
                }

                // fetch the darn thing once ;)
                var tabManager = GetManager();

                if (tabManager != null)
                {
                    var tabs = tabManager.GetChildren();

                    for (int index = tabs.Count - 1; index >= 0; index--)
                    {
                        var tab = tabs[index];
                        CloseTab_Click_No(tab);
                    }
                }
            }
            // ReSharper disable EmptyGeneralCatchClause
            catch
            // ReSharper restore EmptyGeneralCatchClause
            {
                // just do it ;)
            }
        }
Beispiel #8
0
        public void ClickHelpFeedback_Expected_FeedbackWindowOpens()
        {
            RibbonUIMap.ClickRibbonMenuItem("Feedback", 600);
            var dialogPrompt = StudioWindow.GetChildren()[0];

            if (dialogPrompt.GetType() != typeof(WpfWindow))
            {
                Assert.Fail("Error - Clicking the Feedback button does not create the Feedback Window");
            }

            KeyboardCommands.SendEnter();
            KeyboardCommands.SendEnter();

            // Wait for the init, then click around a bit

            // Click stop, then make sure the Feedback window has appeared.
            FeedbackUIMap.ClickStartStopRecordingButton();

            if (!FeedbackUIMap.DoesFeedbackWindowExist())
            {
                Assert.Fail("The Feedback window did not appear after the recording has been stopped.");
            }

            FeedbackUIMap.FeedbackWindow_ClickCancel();
        }
        /// <summary>
        /// Gets the first intellisense result
        /// </summary>
        public void GetFirstIntellisense(string startWith, bool deleteText = false, Point relativeToWizard = default(Point))
        {
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            //prompt intellisense
            SendKeys.SendWait(startWith);

            //wait for intellisense to drop down
            Playback.Wait(500);

            if (relativeToWizard != default(Point))
            {
                Playback.Wait(1000);
                // nasty fixed sizing, but no other real choice to test what  I need to ;(
                Mouse.Click(new Point(wizard.Left + relativeToWizard.X, wizard.Top + relativeToWizard.Y));
            }
            else
            {
                Keyboard.SendKeys(wizard, "{DOWN}");
                Playback.Wait(250);
                Keyboard.SendKeys(wizard, "{ENTER}");
            }

            if (deleteText)
            {
                SendKeys.SendWait("^a");
                Playback.Wait(150);
                SendKeys.SendWait("^x");
                Playback.Wait(150);
            }
        }
Beispiel #10
0
        /// <summary>
        /// ClickFirstAction
        /// </summary>
        public void ClickFirstAction()
        {
            var control = StudioWindow.GetChildren()[0].GetChildren()[2];

            control.WaitForControlEnabled();
            Mouse.Click(control, new Point(172, 164));
        }
Beispiel #11
0
        public override void HandleCommand(int itemIndex)
        {
            if (itemIndex == 0)
            {
                string url;
                switch (Source.Number)
                {
                case 1: url = "http://www.radioswh.lv/eters/pedejas-50-dziesmas/"; break;

                case 2: url = "http://www.radioswhplus.lv/последние-50-песен/"; break;

                case 3: url = "http://old.radioswh.lv/rss/rock_playlist.html"; break;

                case 4: url = "http://www.spinfm.lv/eters/pedejas-50-dziesmas/"; break;

                default: url = "http://radioswhgold.lv/dziesmas"; break;
                }
                DefaultProgram.OpenPage(url); return;
            }
            if (itemIndex == archiveIndex)
            {
                DefaultProgram.OpenPage(string.Concat(Source.HomepageUrl, "player?archive=",
                                                      TimeZoneInfo.ConvertTime(DateTime.UtcNow, Source.Timezone).ToString("yyyy-MM-dd"))); // Neņem vērā faktu, ka SpinFM nav brīvdienu arhīva un tas mēdz kavēties par nedēļu.
                return;
            }
            StudioWindow.Open("Tiešraide no studijas", videoUrl, 640, 360, @"chunklist_w([0-9]+)\.m3u8");
        }
        public bool TryWaitForWizard(int timeOut = 10000)
        {
            Playback.Wait(timeOut);
            var tryGetDialog = StudioWindow.GetChildren()[0].GetChildren()[2];
            var type         = tryGetDialog.GetType();

            return(type == typeof(WpfImage));
        }
        public WpfWindow GetWindow()
        {
            #region Variable Declarations
            WpfWindow theWindow = StudioWindow.GetChildren()[0] as WpfWindow;
            #endregion

            return(theWindow);
        }
Beispiel #14
0
 public override void HandleCommand(int itemIndex)
 {
     // http://www2.mixnews.lv/radio_mixfm/live/ ir rtmpt://live.mixnews.lv/live/mp4:mixfm, no kura iegūta m3u8 adrese
     // Tāpat http://www2.mixnews.lv/radio_baltcom/live/ lieto RTMP.
     StudioWindow.Open(Items[0],
                       Source.Number == 2 ? "http://live.mixnews.lv/live/mp4:mixfm/playlist.m3u8":"http://live.mixnews.lv/live/mp4:baltkom/playlist.m3u8",
                       640, 360, @"chunklist\.m3u8\?wowzasessionid=[0-9]+");
 }
Beispiel #15
0
        public void TabToInputMappings()
        {
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            TabToMappingsTab();
            wizard.WaitForControlReady();
            Keyboard.SendKeys(wizard, "{TAB}");
            Playback.Wait(200);
        }
Beispiel #16
0
        public void TabToOutputMappings()
        {
            TabToMappingsTab();
            Playback.Wait(500);
            var wizard = StudioWindow.GetChildren()[0];

            Keyboard.SendKeys(wizard, "{TAB}{TAB}{TAB}{TAB}");
            Playback.Wait(200);
        }
Beispiel #17
0
        public void ClickSaveButton(int numberOfTabsToSaveButton)
        {
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            wizard.WaitForControlReady();
            KeyboardCommands.SendTabs(numberOfTabsToSaveButton, 200);
            KeyboardCommands.SendEnter();
            Playback.Wait(500);
        }
        /// <summary>
        /// ClickCancel
        /// </summary>
        public void HitDoneWithKeyboard()
        {
            UITestControl decisionDialog = StudioWindow.GetChildren()[0].GetChildren()[2];

            // Click middle of the image to set focus
            Mouse.Click(decisionDialog, new Point(decisionDialog.BoundingRectangle.X + decisionDialog.Width / 2, decisionDialog.BoundingRectangle.Y + decisionDialog.Height / 2));
            SendKeys.SendWait("{TAB}");
            Playback.Wait(200);
            SendKeys.SendWait("{ENTER}");
        }
        /// <summary>
        /// Click Save
        /// </summary>
        public void ClickSave()
        {
            var uIItemImage = StudioWindow.GetChildren()[0].GetChildren()[2];

            // Click image
            Mouse.Click(uIItemImage, new Point(523, 450));

            // Click image
            Mouse.Click(uIItemImage, new Point(488, 436));
        }
Beispiel #20
0
 public string GetAssemblyPathText()
 {
     Mouse.Click(StudioWindow.GetChildren()[0].GetChildren()[2], new Point(423, 406));
     StudioWindow.GetChildren()[0].GetChildren()[2].WaitForControlReady();
     Keyboard.SendKeys(StudioWindow.GetChildren()[0].GetChildren()[2], "{CTRL}a");
     StudioWindow.GetChildren()[0].GetChildren()[2].WaitForControlReady();
     Keyboard.SendKeys(StudioWindow.GetChildren()[0].GetChildren()[2], "{CTRL}c");
     StudioWindow.GetChildren()[0].GetChildren()[2].WaitForControlReady();
     Keyboard.SendKeys(StudioWindow.GetChildren()[0].GetChildren()[2], "{RIGHT}");
     return(Clipboard.GetText());
 }
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public UITestControl GetOkButtonOnActivityDropWindow()
 {
     foreach (var child in StudioWindow.GetChildren()[0].GetChildren())
     {
         if (child.FriendlyName == "OK")
         {
             return(child as WpfButton);
         }
     }
     return(null);
 }
Beispiel #22
0
        public void NewWorkflowShortcutKeyExpectedWorkflowOpens()
        {
            var preCount = TabManagerUIMap.GetTabCount();

            StudioWindow.SetFocus();
            Keyboard.SendKeys(StudioWindow, "{CTRL}W");
            string activeTabName = TabManagerUIMap.GetActiveTabName();
            var    postCount     = TabManagerUIMap.GetTabCount();

            Assert.IsTrue(postCount == preCount + 1, "Tab quantity has not been increased");
            Assert.IsTrue(activeTabName.Contains("Unsaved"), "Active workflow is not an unsaved workflow");
        }
Beispiel #23
0
        public void NewWebServiceShortcutKeyExpectedWebServiceOpens()
        {
            StudioWindow.WaitForControlReady(1000);
            Keyboard.SendKeys(StudioWindow, "{CTRL}{SHIFT}W");
            if (!WizardsUIMap.TryWaitForWizard())
            {
                Assert.Fail("New web service shortcut key doesnt work");
            }

            StudioWindow.SetFocus();
            WebServiceWizardUIMap.Cancel();
        }
        public string GetUserName()
        {
            KeyboardCommands.SendTabs(3, 250);
            KeyboardCommands.SelectAll();
            KeyboardCommands.SendKey(KeyboardCommands.CopyCommand);
            var wizard   = StudioWindow.GetChildren()[0].GetChildren()[2];
            var userName = Clipboard.GetText();

            //Clipboard.SetText(persistClipboard);
            Mouse.Click(wizard, new Point(584, 160));
            return(userName);
        }
Beispiel #25
0
        public override void HandleCommand(int itemIndex)
        {
            // Atskaņotājs atrodas lapā http://echo.msk.ru/set/, kura ielāde sekojošo adresi. Flash versijā ar RTMP protokolu ir pieejamas vairākas plūsmas, bet M3U8 variantā tās visas saliktas vienā kadrā (dažreiz kadrs var attēlot arī vienu plūsmu).
            string sessionId;             // Adresē mainās sesijas identifikators, tāpēc to katru reizi jāpārlādē.

            // Lai gan no lappuses var ņemt pilnu adresi, kopš reizes tā ir mainījusies Flash klientam, neatbilst patiesībai M3U8 versijai, tāpēc pagrābj tikai sesijas numuru.
            using (var client = new ProperWebClient())
                sessionId = Regex.Match(client.DownloadString("http://echomsk.onlinetv.ru/widget/live/echomsk.html"), @"\.m3u8\?s=[a-z0-9]+").Value;
            StudioWindow.Open(Items[0],
                              "http://prague1.setevisor.tv:1935/echomsk/_definst_/echomsk.stream/playlist" + sessionId,
                              640, 480, @"playlist\.m3u8\?[^\n]+");   // Aiz jautājumzīmes wowzasessionid un tā pati drošības sesija.
        }
Beispiel #26
0
        public void EnterDataIntoMappingTextBox(int textboxNumber, string newMappingText)
        {
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            wizard.WaitForControlReady();
            for (int i = 0; i <= textboxNumber; i++)
            {
                SendKeys.SendWait("{TAB}");
                Playback.Wait(50);
            }
            Keyboard.SendKeys(newMappingText);
        }
 private void Initialize()
 {
     MainWindow = new StudioWindow(this);
     _mainSite  = MainWindow.MainSite;
     // Initialize Composition Host
     Host.InitiailizeComposition(this);
     // Initialize main sites
     MainSiteManager.Instance().InitializeMainSite(this);
     // Initialize left panels
     LeftPanelManager.Instance().InitializeLeftPanels(this, MainWindow.LeftPanelsContainer);
     MainWindow.Show();
 }
Beispiel #28
0
        public void ClickNewPluginServiceExpectedPluginServiceOpens()
        {
            RibbonUIMap.ClickNewPlugin();
            UITestControl uiTestControl = PluginServiceWizardUIMap.GetWizardWindow();

            if (uiTestControl == null)
            {
                Assert.Fail("Error - Clicking the new plugin service button does not create the new plugin service window");
            }

            StudioWindow.SetFocus();
            PluginServiceWizardUIMap.ClickCancel();
        }
        public string GetActionName()
        {
            var persistClipboard = Clipboard.GetText();
            var wizard           = StudioWindow.GetChildren()[0].GetChildren()[2];

            Mouse.StartDragging(wizard, new Point(398, 83));
            Mouse.StopDragging(wizard, 125, 0);
            Keyboard.SendKeys(wizard, "{CTRL}c");
            var actionName = Clipboard.GetText();

            Clipboard.SetText(persistClipboard);
            return(actionName);
        }
Beispiel #30
0
        public void TabToSaveButton(int numberOfTabsToSaveButton)
        {
            var wizard = StudioWindow.GetChildren()[0].GetChildren()[2];

            wizard.WaitForControlReady();
            for (int i = 0; i <= numberOfTabsToSaveButton; i++)
            {
                SendKeys.SendWait("{TAB}");
                Playback.Wait(250);
            }
            SendKeys.SendWait("{ENTER}");
            Playback.Wait(500);
        }