Esempio n. 1
0
        /// <summary>
        /// Waits for the sample to complete in Mini or Advanced UI
        /// </summary>
        /// <param name="timeBetweenSamples"></param>
        public void WaitForSample(int timeBetweenSamples)
        {
            Button selectProductButton = MainWindow.Get <Button>(SearchCriteria.ByText(UiItems.SelectProductButtonName));

            WaitHelpers.WaitForEnabled(selectProductButton, TimeSpan.FromMinutes(5), TimeSpan.FromSeconds(timeBetweenSamples));

            Thread.Sleep(TimeSpan.FromSeconds(timeBetweenSamples));
        }
Esempio n. 2
0
        private void ClickSelectProduct()
        {
            Button selectPruductButton = MainWindow.Get <Button>(SearchCriteria.ByText(UiItems.SelectProductButtonName));

            if (WaitHelpers.WaitForEnabled(selectPruductButton, TimeSpan.FromMinutes(5)))
            {
                selectPruductButton.Click();
            }
        }
Esempio n. 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();
     }
 }
Esempio n. 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();
        }
Esempio n. 5
0
        /// <summary>
        /// Envoked to click the start stop button in any Nova
        /// </summary>
        public void ClickStartStopButton()
        {
            logger.LogInfo("Clicking start/stop button");

            Button startStopButton = MainWindow.Get <Button>(StartStopButton);

            logger.LogInfo("Button found {0}", startStopButton.Name);

            if (WaitHelpers.WaitForEnabled(startStopButton, TimeSpan.FromMinutes(5)))
            {
                startStopButton.Click();
            }
        }
Esempio n. 6
0
        public void ClickRadioButton(SearchCriteria criteria, Window window)
        {
            logger.LogInfo($"Searching for radiobutton with criteria {criteria}");

            RadioButton radioButton = window.Get <RadioButton>(criteria);

            logger.LogInfo($"Button found {radioButton.Name} in {window.Title}");

            if (WaitHelpers.WaitForEnabled(radioButton, TimeSpan.FromMinutes(5)))
            {
                logger.LogInfo($"Clicking {radioButton.Name}");
                radioButton.Click();
            }
        }
Esempio n. 7
0
        public void ClickApplicationswitchButton()
        {
            Button appSwitchButton =
                MainWindow.Get <Button>(SearchCriteria.ByText(MeatMaster2UiItems.MenuBarApplicationSwitchButton));

            if (WaitHelpers.WaitForEnabled(appSwitchButton, TimeSpan.FromSeconds(60)))
            {
                logger.LogInfo("Application switch button is enabled.");
                appSwitchButton.Click();
                WaitForManta();
            }
            else
            {
                logger.LogError("Application switch was not enabled.");
            }
        }
Esempio n. 8
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));
        }
Esempio n. 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");
            }
        }