Example #1
0
        // Perry Hunter 06/10/2013
        /// <summary>Selects the requested channel tab in the in the FGen window</summary>
        /// <summary>PREREQUISITE: Function Generator mode UI context</summary>
        /// <param name="channel">The requested channel number for the tab to be selected</param>
        public static void SelectFGenChannelTab(string channel)
        {
            string _tabName = null;

            // Decide which tab we requested
            if (channel == "1")
            {
                _tabName = AWGUI.FGenCh1Tab;
            }
            else if (channel == "2")
            {
                _tabName = AWGUI.FGenCh2Tab;
            }
            else
            {
                Assert.Fail("Requested channel " + channel + " is not defined");
            }

            // Using the previously set context of the AWGUI:currentUIChildPanel from the "When I select the Functions button" step,
            // find the required tab control
            TabPage _tab = AWGUI.currentUIChildPanel.Get <TabPage>(SearchCriteria.ByAutomationId(_tabName));

            Assert.IsNotNull(_tab);

            //For tabs, you must first select, then click the tab.
            _tab.Select();
            _tab.Click();

            //Set context to the control pane of the selected channel tab
            AwgContextFunctions.SetContextToSelectedFGenChannel();
        }
        /// <summary>
        /// Common work<para>
        /// Sends a *RST to AWG</para><para>
        /// Does an unnecessary *OPC?</para><para>
        /// Does a *CLS which clears the error queue</para><para>
        /// Resets the UI context.? Is this the proper place?</para>
        /// </summary>
        /// <param name="awg"></param>
        void PutAwgIntoKnownState(IAWG awg)
        {
            // Put into a known state
            _awgSystemGroup.AwgRST(awg);

            // While not necessary for an implied *RST, do a *OPC? and test for health
            _awgSyncGroup.AwgOperationCompleteQuery(awg);

            // Clear out any errors in this AWG's error queue.
            _awgStatusGroup.AwgClearErrorQueue(awg);

            // Set UI context to top level
            AwgContextFunctions.SetContextToTopLevel();
        }
        [BeforeTestRun] //MUST be static
        public static void BeforeTestRun()
        {
            AwgSystemGroup  awgSystemGroup  = new AwgSystemGroup();
            AwgStatusGroup  awgStatusGroup  = new AwgStatusGroup();
            AwgControlGroup awgControlGroup = new AwgControlGroup();

            //create a local instance of AWG to collect the test setup (model, options,channels) information and save that into accessors
            IAWG awg = GetAWG("1");

            // Get the AWG ID string, model number and S/N
            awgSystemGroup.AwgIdentifyYourself(awg);

            // Find the number of channels for this awg
            awgControlGroup.FindTheNumberOfChannelsAvailable(awg);

            // Get the list of options for this AWG
            awgStatusGroup.GetOptions(awg);

            //AwgSetupSteps the UI context accessors to the top level
            AwgContextFunctions.SetContextToTopLevel();
        }
        // Perry Hunter 06/10/2013
        /// <summary>
        /// Selects the File button in the AWG main window
        /// </summary>

        public static void SelectTheFileAndUtilitiesTab()
        {
            AwgContextFunctions.SetContextToTopLevel();
            AwgUITabControls.SelectMainTabControl(AWGUI.FileAndUtilitiesWindow);
            AwgContextFunctions.SetContextToFileAndUtilities();
        }