Beispiel #1
0
        public void WizardWithWindowWidth()
        {
            //Arrange

            double width  = 1200;
            string folder = TestResources.getGingerUnitTesterTempFolder("MyWizardItemsFolder3");

            //Act
            WizardPOM mWizard = ShowMyWizard(folder, width);
            double    w       = mWizard.WindowPOM.Width;

            mWizard.CancelButton.Click();

            //Assert
            Assert.AreEqual(width, w, "Wizard width");
        }
Beispiel #2
0
        public void CreateMyWizardItem()
        {
            //Arrange
            string folder = TestResources.GetTestTempFolder("MyWizardItemsFolder2");

            //Act
            WizardPOM mWizard = ShowMyWizard(folder);

            mWizard.NextButton.Click();
            mWizard.CurrentPage["Name AID"].SetText("My Wizard Item 1");
            mWizard.NextButton.Click();
            mWizard.FinishButton.Click();

            bool WizardOpen = WizardPOM.IsWizardOpen;

            //Assert

            Assert.IsFalse(WizardOpen, "Wizard was closed");
        }
Beispiel #3
0
        public void VerifyButtonsOnStartThenCancel()
        {
            //Arrange
            string folder = TestResources.GetTestTempFolder("MyWizardItemsFolder1");

            //Act
            WizardPOM mWizard             = ShowMyWizard(folder);
            bool      nextButtonEnabled   = mWizard.NextButton.IsEnabled;
            bool      prevButtonEnabled   = mWizard.PrevButton.IsEnabled;
            bool      finishButtonEnabled = mWizard.FinishButton.IsEnabled;

            mWizard.CancelButton.Click();
            bool WizardOpen = WizardPOM.IsWizardOpen;

            //Assert
            Assert.IsTrue(nextButtonEnabled, "Next button is enabled");
            Assert.IsFalse(prevButtonEnabled, "Prev button is disabled");
            Assert.IsTrue(finishButtonEnabled, "Finish button is enabled");
            Assert.IsFalse(WizardOpen, "Wizard was closed");
        }
Beispiel #4
0
        WizardPOM ShowMyWizard(string folder, double width = 0)
        {
            Task.Factory.StartNew(() => {
                mGingerAutomator.MainWindowPOM.Execute(() => {
                    MyWizard wiz = new MyWizard(folder);
                    if (width == 0)
                    {
                        WizardWindow.ShowWizard(wiz);
                    }

                    else
                    {
                        WizardWindow.ShowWizard(wiz, width);
                    }
                });
            });

            WizardPOM wizardPOM = WizardPOM.CurrentWizard;

            return(wizardPOM);
        }
Beispiel #5
0
        public void VerifyButtonsOnStartThenCancel()
        {
            //Arrange
            string folder = TestResources.GetTestTempFolder("MyWizardItemsFolder1");

            //Act
            WizardPOM mWizard             = ShowMyWizard(folder);
            bool      nextButtonEnabled   = mWizard.NextButton.IsEnabled;
            bool      prevButtonEnabled   = mWizard.PrevButton.IsEnabled;
            bool      finishButtonEnabled = mWizard.FinishButton.IsEnabled;

            mWizard.CancelButton.Click();
            bool WizardOpen = WizardPOM.IsWizardOpen;

            mGingerAutomator.MainWindowPOM.TakeScreenShot(mTestHelper.GetTempFileName("Wizard Screen Shot.png"));
            //Artifacts


            //Assert
            Assert.IsTrue(nextButtonEnabled, "Next button is enabled");
            Assert.IsFalse(prevButtonEnabled, "Prev button is disabled");
            Assert.IsTrue(finishButtonEnabled, "Finish button is enabled");
            Assert.IsFalse(WizardOpen, "Wizard was closed");
        }
Beispiel #6
0
        private ApplicationPOMModel CreatePOMOnWizard(string POMName, string POMDescription, string targetApp, Agent agent, string URL, List <eElementType> elementTypeCheckBoxToClickList, List <ElementLocator> prioritizedLocatorsList)
        {
            WizardPOM wizard = WizardPOM.CurrentWizard;

            wizard.NextButton.Click();
            ucAgentControl    ucAgentControl    = (ucAgentControl)wizard.CurrentPage["ucAgentControl AID"].dependencyObject;
            ucAgentControlPOM ucAgentControlPOM = new ucAgentControlPOM(ucAgentControl);

            ucAgentControlPOM.SelectValueUCAgentControl(agent);
            ucAgentControlPOM.UCAgentControlStatusButtonClick();
            SleepWithDoEvents(10000);

            //Process AutoMap Element Locators Grid
            ucGrid    ucElementLocatorsGrid    = (ucGrid)wizard.CurrentPage["AutoMapElementLocatorsGrid AID"].dependencyObject;
            ucGridPOM ucElementLocatorsGridPOM = new ucGridPOM(ucElementLocatorsGrid);
            int       locatorIndex             = 0;

            foreach (ElementLocator elemLocator in prioritizedLocatorsList)
            {
                if (!elemLocator.Active)
                {
                    ucElementLocatorsGridPOM.ClickOnCheckBox(nameof(ElementLocator.Active), nameof(ElementLocator.LocateBy), elemLocator.LocateBy.ToString());
                }

                ucElementLocatorsGridPOM.ReOrderGridRows(nameof(ElementLocator.LocateBy), elemLocator.LocateBy.ToString(), locatorIndex);

                locatorIndex++;
            }

            //Process AutoMap Element Types Grid
            ucGrid    ucElementTypesGrid    = (ucGrid)wizard.CurrentPage["AutoMapElementTypesGrid AID"].dependencyObject;
            ucGridPOM ucElementTypesGridPOM = new ucGridPOM(ucElementTypesGrid);

            foreach (eElementType elementType in elementTypeCheckBoxToClickList)
            {
                ucElementTypesGridPOM.ClickOnCheckBox(nameof(UIElementFilter.Selected), nameof(UIElementFilter.ElementType), elementType.ToString());
            }

            wizard.CurrentPage["LearnOnlyMappedElementsCheckBox AID"].SetCheckedValue(false);//to it will learn all

            string html = TestResources.GetTestResourcesFile(URL);

            ((AgentOperations)agent.AgentOperations).Driver.RunAction(new ActBrowserElement()
            {
                ControlAction = ActBrowserElement.eControlAction.GotoURL, ValueForDriver = html
            });
            SleepWithDoEvents(10000);
            wizard.NextButton.Click();
            SleepWithDoEvents(5000);
            while (((AgentOperations)agent.AgentOperations).Driver.IsDriverBusy)
            {
                SleepWithDoEvents(20000);
            }
            wizard.NextButton.Click();
            SleepWithDoEvents(2000);
            wizard.CurrentPage["Name POMID"].SetText(POMName);
            wizard.CurrentPage["Description POMID"].SetText(POMDescription);
            wizard.FinishButton.Click();
            SleepWithDoEvents(2000);

            ApplicationPOMModel POM = (from x in WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <ApplicationPOMModel>() where x.Name == POMName select x).SingleOrDefault();

            return(POM);
        }