Пример #1
0
        /// <summary>
        /// Cancels startup and leaves X-ray off.
        /// </summary>
        public void CancelStartup()
        {
            WaitHelpers.WaitForDialog(MainWindow, Properties.Resources.MeatMasterII_InstrumentStartupDialog, TimeSpan.FromMinutes(5));

            MainWindow.ModalWindow(Properties.Resources.MeatMasterII_InstrumentStartupDialog)
            .Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.InstrumentStartupCancelButton))
            .Click();
        }
Пример #2
0
        public void CollectLogs()
        {
            ClickRadioButton(MeatMaster2UiItems.CareViewButton, MainWindow);
            ClickButton(MeatMaster2UiItems.CareViewExportLogsButton, MainWindow);

            WaitHelpers.WaitForDialog(MainWindow, MeatMaster2UiItems.ExportLogsDialog, TimeSpan.FromSeconds(30));
            MainWindow.ModalWindow(MeatMaster2UiItems.ExportLogsDialog).Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.PopupCollectLogsButton)).Click();
        }
Пример #3
0
 public void HandleSampleRegistration()
 {
     if (WaitHelpers.WaitForDialog(MainWindow, "UdfDialog", TimeSpan.FromSeconds(30)))
     {
         Button okButton = MainWindow.ModalWindow("UdfDialog").Get <Button>(SearchCriteria.ByText("PopupLeftButton"));
         WaitHelpers.WaitForEnabled(okButton, TimeSpan.FromMinutes(2));
         okButton.Click();
     }
 }
Пример #4
0
        public void CloseDown()
        {
            ClickRadioButton(MeatMaster2UiItems.CareViewButton, MainWindow);
            Button closeButton = MainWindow.Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.CloseDownButton));

            WaitHelpers.WaitForEnabled(closeButton, TimeSpan.FromSeconds(30));

            closeButton.Click();

            WaitHelpers.WaitForDialog(MainWindow, MeatMaster2UiItems.MessageBoxPopup, TimeSpan.FromMinutes(2));

            MainWindow.ModalWindow(MeatMaster2UiItems.MessageBoxPopup).Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.PopupLeftButton)).Click();
        }
Пример #5
0
        public void HandlePopup(string answer)
        {
            WaitHelpers.WaitForDialog(MainWindow, UiItems.MessageBoxPopup, TimeSpan.FromSeconds(30));
            Window messagePopup = MainWindow.ModalWindow(UiItems.MessageBoxPopup);

            answer = answer.ToLower();

            if (answer == "yes")
            {
                ClickButton(UiItems.MessageBoxPopupYesButton, messagePopup);
                return;
            }

            ClickButton(UiItems.MessageBoxPopupNoButton, messagePopup);

            WaitHelpers.WaitFor(() => messagePopup.IsClosed, TimeSpan.FromSeconds(30));
        }
Пример #6
0
        /// <summary>
        /// Selects a product in any Nova
        /// </summary>
        /// <param name="productName"></param>
        public void SelectProduct(string productName)
        {
            ClickSelectProduct();

            if (WaitHelpers.WaitForDialog(MainWindow, SelectProductsDialogName, TimeSpan.FromSeconds(30)))
            {
                Window selectProductDialog = MainWindow.ModalWindow(SelectProductsDialogName);

                if (SelectProductDialogIsUpdated) //True from 7.0
                {
                    ClickButton(SearchCriteria.ByText(productName), selectProductDialog);
                }
                else
                {
                    ListBox productList = selectProductDialog.Get <ListBox>(ProductList);
                    SelectValueFromList(productName, productList);
                }
            }
        }
Пример #7
0
        /// <summary>
        /// Closes down Nova
        /// </summary>
        /// <param name="restartWindows">If true, windows will restart during the shutdown, before it is done.</param>
        public void CloseDown(bool restartWindows)
        {
            ClickRadioButton(MeatMaster2UiItems.CareViewButton, MainWindow);
            Button closeButton = MainWindow.Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.CloseDownButton));

            WaitHelpers.WaitForEnabled(closeButton, TimeSpan.FromSeconds(30));

            closeButton.Click();

            WaitHelpers.WaitForDialog(MainWindow, MeatMaster2UiItems.MessageBoxPopup, TimeSpan.FromMinutes(2));

            MainWindow.ModalWindow(MeatMaster2UiItems.MessageBoxPopup)
            .Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.PopupLeftButton))
            .Click();

            if (restartWindows)
            {
                applicationHelpers.RestartWindows();
            }

            WaitHelpers.WaitFor(() => !applicationHelpers.ProcessIsRunning(MeatMaster2UiItems.Mm2ProcessName),
                                TimeSpan.FromMinutes(20), TimeSpan.FromMinutes(1));
        }
Пример #8
0
        /// <summary>
        /// Starts instrument diagnostic waits for finish dialog, and clicks OK.
        /// </summary>
        public void HandleInstrumentDiagnostic()
        {
            WaitHelpers.WaitForDialog(MainWindow, Properties.Resources.MeatMasterII_InstrumentStartupDialog, TimeSpan.FromMinutes(5));

            MainWindow.ModalWindow(Properties.Resources.MeatMasterII_InstrumentStartupDialog)
            .Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.InstrumentStartupStartButton)).Click();

            WaitHelpers.WaitForDialog(MainWindow, MeatMaster2UiItems.InstrumentDiagnosticDialog, TimeSpan.FromSeconds(30));

            Button instrumentDiagnosticOkButton = MainWindow.ModalWindow(MeatMaster2UiItems.InstrumentDiagnosticDialog)
                                                  .Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.InstrumentDiagnosticOkButton));

            if (WaitHelpers.WaitForVisible(instrumentDiagnosticOkButton, TimeSpan.FromMinutes(60)))
            {
                logger.LogInfo("Button was enabled");
                instrumentDiagnosticOkButton.Click();
            }

            else
            {
                logger.LogInfo("Button was not enabled");
            }
        }
Пример #9
0
        /// <summary>
        /// Starts the instrument diagnostic, and cancels after waitTime
        /// </summary>
        /// <param name="waitTime">Time to let the test run before canceling</param>
        public void CancelStartup(TimeSpan waitTime)
        {
            WaitHelpers.WaitForDialog(MainWindow, Properties.Resources.MeatMasterII_InstrumentStartupDialog, TimeSpan.FromMinutes(5));

            Window instrumentDiagnosticDialog = MainWindow.ModalWindow(Properties.Resources.MeatMasterII_InstrumentStartupDialog);

            instrumentDiagnosticDialog.Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.InstrumentStartupStartButton))
            .Click();

            WaitHelpers.WaitForDialog(MainWindow, MeatMaster2UiItems.InstrumentDiagnosticDialog, TimeSpan.FromSeconds(30));

            Button instrumentDiagnosticCancelButton = MainWindow.ModalWindow(MeatMaster2UiItems.InstrumentDiagnosticDialog)
                                                      .Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.InstrumentDiagnosticCancelButton));

            if (WaitHelpers.WaitForEnabled(instrumentDiagnosticCancelButton, TimeSpan.FromSeconds(60)))
            {
                Thread.Sleep(waitTime);
                instrumentDiagnosticCancelButton.Click();
                HandlePopup("yes");
            }
            WaitHelpers.WaitForDialog(MainWindow, MeatMaster2UiItems.InstrumentDiagnosticDialog, TimeSpan.FromSeconds(20));

            Button instrumentDiagnosticOkButton = MainWindow.ModalWindow(MeatMaster2UiItems.InstrumentDiagnosticDialog)
                                                  .Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.InstrumentDiagnosticOkButton));

            if (WaitHelpers.WaitForVisible(instrumentDiagnosticOkButton, TimeSpan.FromSeconds(60)))
            {
                logger.LogInfo("Button was enabled");
                instrumentDiagnosticOkButton.Click();
            }

            else
            {
                logger.LogInfo("Button was not enabled");
            }
        }
Пример #10
0
        public void GetDiagnosticsResult()
        {
            WaitHelpers.WaitForDialog(MainWindow, MeatMaster2UiItems.InstrumentDiagnosticDialog, TimeSpan.FromSeconds(30));
            Button instrumentDiagnosticOkButton = MainWindow.ModalWindow(MeatMaster2UiItems.InstrumentDiagnosticDialog)
                                                  .Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.InstrumentDiagnosticOkButton));
            Button instrumentDiagnosticRepeatButton = MainWindow.ModalWindow(MeatMaster2UiItems.InstrumentDiagnosticDialog)
                                                      .Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.InstrumentDiagnosticRepeatButton));

            if (WaitHelpers.WaitForVisible(instrumentDiagnosticOkButton, TimeSpan.FromMinutes(60)))
            {
                if (instrumentDiagnosticRepeatButton.Visible)
                {
                    instrumentDiagnosticOkButton.Click();
                    CollectLogs();
                }
                logger.LogInfo("diagnostics passed.");
                instrumentDiagnosticOkButton.Click();
            }

            else
            {
                logger.LogInfo("Button was not enabled");
            }
        }