示例#1
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            //TODO: Databinding iteration(CDI || HART) -> protocol
            var repo = EH.PCPS.TestAutomation.DeviceCare.V10300.GUI.DeviceCareApplication.Instance;

            //Ask Anja how this DB will be handled when the automation Rack is ready

            //Initialize the Statusbar_Functions class
            Statusbar_Functions getCommunicationUnit = new Statusbar_Functions();

            //Set its parameter 'CommunicationUnit' -> will be passed into the IsUSBCommunicationUnitRecognized() method by its constructor
            //Passing any parameters into the method itself is not required therefore
            getCommunicationUnit.CommunicationUnit = var_CommUnitName;

            //Checks if HART FXA195 is connected
            if (!getCommunicationUnit.IsCommunicationUnitRecognized())
            {
                Report.Failure("No suitable communication unit has been found.");
            }
            else
            {
                Report.Success("Device is connected.");
            }
            repo.StatusArea.UsbCommunicationUnitList.Click();
        }
示例#2
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;


            Statusbar_Functions getUSBCommunicationUnit = new Statusbar_Functions();

            getUSBCommunicationUnit.CommunicationUnit = Protocol.HART.commHardwareFXA195;
            if (!getUSBCommunicationUnit.IsCommunicationUnitRecognized())
            {
                Report.Failure("No suitable unit has been found.");
            }
            else
            {
                Report.Success("Device is connected.");
            }
        }
        //TODO: Create summary
        //		Add validation structure
        //		Add comments

        /// <summary>
        /// The Go Online
        /// </summary>
        public void GoOnline()
        {
            //instance required components
            Page_Home_Functions homeFunctions = new Page_Home_Functions();
            Assistant_ProtocolSelection_Function protocolSeletion = new Assistant_ProtocolSelection_Function();
            Assistant_ModemSelection_Functions   modemSelection   = new Assistant_ModemSelection_Functions();
            Assistant_ConfigureCommDTM_Functions configureCommDTM = new Assistant_ConfigureCommDTM_Functions();

            Functions.Helpers.InterfaceHelpers.OnlineConnectFunctions connect = new EH.PCPS.TestAutomation.DeviceCare.V10107.Functions.Helpers.InterfaceHelpers.OnlineConnectFunctions();
            Statusbar_Functions waitForConnection = new Statusbar_Functions();

            var repo = EH.PCPS.TestAutomation.DeviceCare.V10107.GUI.DeviceCareApplication.Instance;

            //Click button assistant on home page
            homeFunctions.ClickAssistant();

            if (connect.WaitForItemVisible(repo.DeviceCare.ApplicationArea.Page_Assistant.ProtocolSelectionPage.Text_Title_ProtocolInfo))
            {
                //select desired protocol
                Ranorex.Report.Info("Protocol page is shown. Selecting desired protocol...");
                protocolSeletion.SelectProtocol(this.protocolName);

                if (connect.WaitForItemVisible(repo.DeviceCare.ApplicationArea.Page_Assistant.ModemSelectionPages.Text_Title_ModemInfo))
                {
                    Ranorex.Report.Info("Modem page is shown. Selecting desired modem...");
                    //select desired modem
                    modemSelection.SelectModem(this.protocolName, this.commUnit);

                    if (connect.WaitForItemVisible(repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.OwnConfigurationControls.SelfInfo))
                    {
                        Ranorex.Report.Info("Configuration page is shown. Opening advanced configuration...");
                        //open advanced configuration
                        configureCommDTM.OpenAdvancedConfiguration();

                        if (connect.WaitForItemVisible(repo.DeviceCare.ApplicationArea.Page_Assistant.CommDTMConfigurationPages.CommDTMHostingGUIInfo))
                        {
                            Ranorex.Report.Info("Device Configuration page is shown. Start scanning...");
                            System.Threading.Thread.Sleep(5000);
                            //scann device
                            configureCommDTM.ClickScan();

                            //check if scanning is in progress
                            while (repo.DeviceCare.ApplicationArea.Page_ProgressIndicator.Self.Visible)
                            {
                                //watch for scan result: No device found.
                                if (repo.DeviceCare.ApplicationArea.Page_ScanResult.Message_NoResultFound.Visible)
                                {
                                    Ranorex.Report.Failure("Something somewhere went terribly wrong... No device found.");
                                    break;
                                }
                            }
                            //check if desired page is displayed
                            if (repo.DeviceCare.ApplicationArea.Page_ScanResult.Message_NoResultFound.Visible)
                            {
                                Ranorex.Report.Failure("Scan device failed.");
                            }
                            else if (repo.DeviceCare.ApplicationArea.Page_DeviceScreen.DTMHostingGUI.Visible)
                            {
                                Ranorex.Report.Success("Device has been scanned successfully.");
                                Ranorex.Delay.Milliseconds(5000);
                            }
                        }
                    }
                }
            }
        }