Example #1
0
        private static void OnStaysOpenChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            var popup        = dependencyObject as Windows.Popup;
            var popupWatcher = GetPopupWatcher(popup);;
            var staysOpen    = (bool)e.NewValue;

            if (staysOpen)
            {
                if (popupWatcher != null)
                {
                    popupWatcher.Detach();
                    SetPopupWatcher(popup, null);
                }
            }
            else
            {
                if (popupWatcher == null)
                {
                    popupWatcher = new PopupWatcher(popup);
                    SetPopupWatcher(popup, popupWatcher);
                }

                popupWatcher.Attach();
            }
        }
        private static void onStaysOpenChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            var          popup = dependencyObject as System.Windows.Controls.Primitives.Popup;
            PopupWatcher popupWatcher;
            var          staysOpen = (bool)e.NewValue;

            if (popup == null)
            {
                return;
            }

            PopupWatcherCache.TryGetValue(popup, out popupWatcher);

            if (staysOpen)
            {
                if (popupWatcher != null)
                {
                    popupWatcher.Detach();
                    PopupWatcherCache.Remove(popup);
                }
            }
            else
            {
                if (popupWatcher == null)
                {
                    popupWatcher             = new PopupWatcher(popup);
                    PopupWatcherCache[popup] = popupWatcher;
                }

                popupWatcher.Attach();
            }
        }
Example #3
0
        private static void OnStaysOpenChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            var popup        = dependencyObject as Windows.Popup;
            var popupWatcher = (PopupWatcher)null;
            var staysOpen    = (bool)e.NewValue;

            popupWatcherCache.TryGetValue(popup, out popupWatcher);

            if (staysOpen)
            {
                if (popupWatcher != null)
                {
                    popupWatcher.Detach();
                    popupWatcherCache.Remove(popup);
                }
            }
            else
            {
                if (popupWatcher == null)
                {
                    popupWatcher             = new PopupWatcher(popup);
                    popupWatcherCache[popup] = popupWatcher;
                }

                popupWatcher.Attach();
            }
        }
Example #4
0
        public void Perform()
        {
            PopupWatcher unpostedContinue = new PopupWatcher();

            unpostedContinue.WatchAndClick(bill.PromptForm, bill.PromptForm.btnYesInfo);
            unpostedContinue.Start();

            bill.MainForm.btnBilling.Click();
            bill.MainForm.ToolbarBill.Click();
            bill.MainForm.SelectBill.Click();
            bill.BillingDetailForm.SelectFile.Click();
            te.FileSelectForm.btnQuickFind.Click();
            te.FindFilesForm.txtFind.TextValue = fileName + time;
            te.FindFilesForm.btnOK.Click();
            te.FileSelectForm.listFirstFound.DoubleClick();
            Validate.Exists(bill.BillingDetailForm.BillValueInfo);
            bill.BillingDetailForm.btnSendtoFinal.Click();
            bill.BillingDetailForm.btnPrintPost.Click();
            bill.InvoiceEmailForm.Checkbox.Click();
            bill.InvoiceEmailForm.btnProceed.Click();
            Delay.Milliseconds(500);
            bill.OutputPromptForm.btnOk.Click();
            if (bill.PromptForm.btnOk1Info.Exists())
            {
                bill.PromptForm.btnOk1.Click();
            }
            bill.ReportViewerForm.btnClose.Click();
            bill.BillingDetailForm.btnClose.Click();
            unpostedContinue.Stop();
        }
 private static void StopPopupWatcher(string key, PopupWatcher watcher)
 {
     watcher.Clear();
     watcher.Stop();
     Report.Info("Popup watcher stopped.");
     watchers.Remove(key);
 }
Example #6
0
        public void PerformTimeEntry()
        {
            PopupWatcher timeEntryCombine = new PopupWatcher();

            timeEntryCombine.WatchAndClick(te.PromptForm, te.PromptForm.btnYesInfo);
            timeEntryCombine.Start();

            te.MainForm.btnTimeFeesExpenses.Click();
            te.MainForm.btnMenuItem.Click();
            te.AmicusAttorneyXWin.MenuItemNewItemsMenuItemIndex.Click();
//          te.AmicusAttorneyXWin.MenuPopup.Click("58;21");
            te.FileSelectForm.btnQuickFind.Click();
            te.FindFilesForm.txtFind.TextValue = fileName;
            te.FindFilesForm.btnOK.Click();


            te.FileSelectForm.listFirstFound.DoubleClick();
            te.TimeEntryDetailsForm.txtActivityDescription.PressKeys(activityDescription);
            te.TimeEntryDetailsForm.btnOK.Click();

            //Verify
            te.MainForm.rdbtnTimeFees.Click();
            te.MainForm.listFirstTimeEntryFile.DoubleClick();
            Report.Success("Create Time Entry for Billing passed");
            te.TimeEntryDetailsForm.btnPost.Click();
            timeEntryCombine.Stop();
            //te.TimeEntryDetailsForm.btnOK.Click();
        }
Example #7
0
        void BrowserVerify()
        {
//          Host.Local.RunApplication("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");

//			Host.Local.ClearBrowserCache("chrome");
            Host.Local.OpenBrowser("https://test.amicusanywhere.com/Portal");
            cp.AmicusAttorney.Self.EnsureVisible();
            cp.AmicusAttorney.LoginPage.TbEmailInfo.WaitForExists(Utilities.Constants.customWaitTime);
            cp.AmicusAttorney.LoginPage.TbEmail.PressKeys("*****@*****.**");
            cp.AmicusAttorney.LoginPage.TbPwd.PressKeys("Password123$$");
            cp.AmicusAttorney.LoginPage.BtLogin.Click();

            PopupWatcher activeSessionDialog = new PopupWatcher();

            activeSessionDialog.WatchAndClick(cp.AmicusAttorney.LoginPage.ContinueToLoginAnywayInfo, cp.AmicusAttorney.LoginPage.ContinueToLoginAnywayInfo);
            activeSessionDialog.Start();
            try {
                cp.AmicusAttorney.Main.UserNameInfo.WaitForExists(Utilities.Constants.customWaitTime * 10);
                Report.Log(ReportLevel.Info, "Client Portal Login Successfully for client: " + cp.AmicusAttorney.Main.UserName.GetAttributeValue <String>("InnerText").ToString());
                Report.Log(ReportLevel.Info, "Client Portal build number under curent test is " + cp.AmicusAttorney.Main.BuildNumber.GetAttributeValue <String>("InnerText").ToString());
            } catch (Exception) {
                Report.Log(ReportLevel.Error, "Failed to login Client Portal within 30 seconds, terminating the Client Portal test case");
            }
            activeSessionDialog.Stop();
            cp.AmicusAttorney.Main.LkLogout.Click();
            Delay.Seconds(5);

            Host.Local.KillBrowser("chrome");
        }
Example #8
0
 private void Init()
 {
     _closingManagerInstancesWatcher = new PopupWatcher();
     _closingManagerInstancesWatcher.Watch(@"/form[@title='MyAssays Desktop Setup']/?/?/radiobutton[@text~'^&Close\ the\ applications\ a']", CloseAllMyAssaysWindows);
     _closingManagerInstancesWatcher.Start();
     _setupUnableTextWatcher = new PopupWatcher();
     _setupUnableTextWatcher.Watch(@"/form[@title='MyAssays Desktop Setup']/text[@windowtext='The setup was unable to automatically close all requested applications. Please ensure that the applications holding files in use are closed before continuing with the installation.']", CloseAllWindows);
     _setupUnableTextWatcher.Start();
 }
Example #9
0
        /// <summary>
        /// This method gets called right after the recording has been started.
        /// It can be used to execute recording specific initialization code.
        /// </summary>
        private void Init()
        {
            // Your recording specific initialization code goes here.
            // Create PopupWatcher
            PopupWatcher myPopupWatcher = new PopupWatcher();

            // Add a Watch using a RanoreXPath and triggering the Method CloseUpdateCheckDialog
            //myPopupWatcher.Watch("/form[@controlname='UpdateCheckForm']/button[@controlname='m_btnClose']", CloseUpdateCheckDialog);
            myPopupWatcher.Watch("/dom[@domain='192.168.0.1']//div[#'warningWizard']/div[2]", CloseUpdateCheckDialog);
            // Start PopupWatcher
            myPopupWatcher.Start();
        }
Example #10
0
        public static void StopPopupWatcher(RepoItemInfo findElement, RepoItemInfo clickElement)
        {
            var          key     = findElement.GetMetaInfos()["id"] + clickElement.GetMetaInfos()["id"];
            PopupWatcher watcher = null;

            if (watchers.TryGetValue(key, out watcher))
            {
                StopPopupWatcher(key, watcher);
            }
            else
            {
                Report.Warn("The popup watcher you tried to remove does not exist.");
            }
        }
Example #11
0
        public static PopupWatcher StartPopupWatcher(RepoItemInfo findElement, RepoItemInfo clickElement)
        {
            var key = findElement.GetMetaInfos()["id"] + clickElement.GetMetaInfos()["id"];

            if (watchers.ContainsKey(key))
            {
                throw new ArgumentException("Popup watcher with given parameters already exists.");
            }

            var watcher = new PopupWatcher();

            watcher.WatchAndClick(findElement, clickElement);
            watcher.Start();
            watchers.Add(key, watcher);
            Report.Info("Popup watcher started.");
            return(watcher);
        }
Example #12
0
        public static PopupWatcher PauseWhileExists(RepoItemInfo findElement)
        {
            CheckArgumentNotNull(findElement, "findElement");

            var key = findElement.GetMetaInfos()["id"];

            if (watchers.ContainsKey(key))
            {
                throw new ArgumentException("Popup watcher with given parameters already exists.");
            }

            var watcher = new PopupWatcher();

            watcher.Watch(findElement, RequestPauseWhileExists);
            watcher.Start();
            watchers.Add(key, watcher);
            Report.Info(string.Format("Started watching for '{0}'.", findElement.FullName));
            return(watcher);
        }
Example #13
0
 private static void SetPopupWatcher(DependencyObject obj, PopupWatcher value)
 {
     obj.SetValue(PopupWatcherProperty, value);
 }
Example #14
0
        private static void OnStaysOpenChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            var popup = dependencyObject as Windows.Popup;
            var popupWatcher = GetPopupWatcher(popup); ;
            var staysOpen = (bool)e.NewValue;

            if (staysOpen)
            {
                if (popupWatcher != null)
                {
                    popupWatcher.Detach();
                    SetPopupWatcher(popup, null);
                }
            }
            else
            {
                if (popupWatcher == null)
                {
                    popupWatcher = new PopupWatcher(popup);
                    SetPopupWatcher(popup, popupWatcher);
                }

                popupWatcher.Attach();
            }
        }
Example #15
0
        private static void OnStaysOpenChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            var popup = dependencyObject as Windows.Popup;
            var popupWatcher = (PopupWatcher)null;
            var staysOpen = (bool)e.NewValue;

            popupWatcherCache.TryGetValue(popup, out popupWatcher);

            if (staysOpen)
            {
                if (popupWatcher != null)
                {
                    popupWatcher.Detach();
                    popupWatcherCache.Remove(popup);
                }
            }
            else
            {
                if (popupWatcher == null)
                {
                    popupWatcher = new PopupWatcher(popup);
                    popupWatcherCache[popup] = popupWatcher;
                }

                popupWatcher.Attach();
            }
        }
 private void Init()
 {
     _closeChangingVersionWatcher = new PopupWatcher();
     _closeChangingVersionWatcher.Watch(@"/form[@title='MyAssays Analysis']", confirmChangingVersion);
 }
Example #17
0
 private static void SetPopupWatcher(DependencyObject obj, PopupWatcher value)
 {
     obj.SetValue(PopupWatcherProperty, value);
 }