示例#1
0
        public static void AccessMenu(BrowserWindow browserWindow)

        {
            // Find and Open / Expand Content Menu with click
            HtmlButton toggleNav = new HtmlButton(browserWindow);

            toggleNav.SearchProperties.Add(HtmlButton.PropertyNames.TagName, "BUTTON", HtmlButton.PropertyNames.InnerText, "Toggle navigation");
            toggleNav.WaitForControlReady();
            Mouse.Click(toggleNav);

            // Verify sections available for selection (Offices, Programs, People, Organizations, Reports- currently functional)

            //offices
            HtmlHyperlink offices = new HtmlHyperlink(browserWindow);

            offices.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Offices", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "2");
            offices.WaitForControlReady();
            Assert.AreEqual(true, offices.Exists);

            //programs
            HtmlHyperlink programs = new HtmlHyperlink(browserWindow);

            programs.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Programs", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "3");
            programs.WaitForControlReady();
            Assert.AreEqual(true, programs.Exists);

            //people
            HtmlHyperlink people = new HtmlHyperlink(browserWindow);

            people.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "People", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "4");
            people.WaitForControlReady();
            Assert.AreEqual(true, people.Exists);

            //orgs
            HtmlHyperlink organizations = new HtmlHyperlink(browserWindow);

            organizations.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Organizations", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "5");
            organizations.WaitForControlReady();
            Assert.AreEqual(true, organizations.Exists);

            //reports
            HtmlHyperlink reports = new HtmlHyperlink(browserWindow);

            reports.SearchProperties.Add(HtmlHyperlink.PropertyNames.InnerText, "Reports", HtmlHyperlink.PropertyNames.ControlType, "Hyperlink", HtmlHyperlink.PropertyNames.TagInstance, "7");
            reports.WaitForControlReady();
            Assert.AreEqual(true, reports.Exists);

            //collapse content menu
            //Mouse.Click(toggleNav);
        }
示例#2
0
        public static void ClickButton()
        {
            var btn = new HtmlButton(browserWindow)
            {
                TechnologyName = "Web"
            };

            try
            {
                btn.SearchProperties.Add(CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType, CSVReader.LocatorValue);
                btn.WaitForControlEnabled();
                btn.WaitForControlReady();
            }
            catch (Exception)
            {
                Assert.Fail("Failed to find " + CSVReader.ControlType + " Element - Element not Found");
            }
            Mouse.Click(btn);
        }
示例#3
0
 public static void ClickButton()
 {
     var btn = new HtmlButton(browserWindow) { TechnologyName = "Web" };
     try
     {
         btn.SearchProperties.Add(CSVReader.ControlType+".PropertyNames." + CSVReader.LocatorType, CSVReader.LocatorValue);
         btn.WaitForControlEnabled();
         btn.WaitForControlReady();
     }
     catch (Exception)
     {
         Assert.Fail("Failed to find " + CSVReader.ControlType + " Element - Element not Found");
     }
     Mouse.Click(btn);
 }
示例#4
0
        public static void AddFundIn(BrowserWindow browserWindow)
        {
            //add funding item prop
            HtmlButton addNewFund = new HtmlButton(browserWindow);

            addNewFund.SearchProperties.Add(HtmlButton.PropertyNames.TagName, "BUTTON", HtmlButton.PropertyNames.InnerText, "ADD FUNDING ITEM", HtmlButton.PropertyNames.TagInstance, "3");
            addNewFund.WaitForControlReady();
            Assert.AreEqual(true, addNewFund.Exists);

            //select add funding item
            Mouse.Click(addNewFund);

            //outgoing tab prop (modal)
            HtmlSpan Incoming = new HtmlSpan(browserWindow);

            Incoming.SearchProperties.Add(HtmlSpan.PropertyNames.TagName, "SPAN", HtmlSpan.PropertyNames.InnerText, "Incoming", HtmlSpan.PropertyNames.TagInstance, "44");
            Incoming.WaitForControlReady();
            Assert.AreEqual(true, Incoming.Exists);

            //select outgoing tab
            Mouse.Click(Incoming);

            // office outgoing modal props
            //

            //Status***

            //status label
            HtmlLabel Status = new HtmlLabel(browserWindow);

            Status.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText, "Status *", HtmlLabel.PropertyNames.TagName, "LABEL", HtmlLabel.PropertyNames.TagInstance, "15");
            Status.WaitForControlReady();
            Assert.AreEqual(true, Status.Exists);

            //status field
            HtmlComboBox StatusField = new HtmlComboBox(browserWindow);

            StatusField.SearchProperties.Add(HtmlComboBox.PropertyNames.TagName, "SELECT", HtmlComboBox.PropertyNames.Id, "moneyFlowStatus", HtmlComboBox.PropertyNames.InnerText, "ActualAppropriatedEstimated", HtmlComboBox.PropertyNames.TagInstance, "3");
            StatusField.WaitForControlReady();
            Assert.AreEqual(true, StatusField.Exists);

            //Transaction date***

            //transaction date label
            HtmlLabel TransDTE = new HtmlLabel(browserWindow);

            TransDTE.SearchProperties.Add(HtmlLabel.PropertyNames.TagName, "LABEL", HtmlLabel.PropertyNames.InnerText, "Transaction Date *", HtmlLabel.PropertyNames.TagInstance, "16");
            TransDTE.WaitForControlReady();
            Assert.AreEqual(true, TransDTE.Exists);

            //transaction date field
            HtmlEdit TransDTEField = new HtmlEdit(browserWindow);

            TransDTEField.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.Name, "transactionDate", HtmlEdit.PropertyNames.TagInstance, "22");
            TransDTEField.WaitForControlReady();
            Assert.AreEqual(true, TransDTEField.Exists);

            //transaction date picker calendar
            HtmlButton TransDTECal = new HtmlButton(browserWindow);

            TransDTECal.SearchProperties.Add(HtmlButton.PropertyNames.TagName, "BUTTON", HtmlButton.PropertyNames.InnerText, "event", HtmlButton.PropertyNames.TagInstance, "13");
            TransDTECal.WaitForControlReady();
            Assert.AreEqual(true, TransDTECal.Exists);

            //Reference Fiscal Year***

            //reference fiscal year label
            HtmlLabel RefFY = new HtmlLabel(browserWindow);

            RefFY.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText, "Reference Fiscal Year *", HtmlLabel.PropertyNames.TagName, "LABEL", HtmlLabel.PropertyNames.TagInstance, "17");
            RefFY.WaitForControlReady();
            Assert.AreEqual(true, RefFY.Exists);

            //reference fiscal year field
            HtmlEdit RefFYField = new HtmlEdit(browserWindow);

            RefFYField.SearchProperties.Add(HtmlEdit.PropertyNames.Id, "fiscalYear", HtmlEdit.PropertyNames.TagName, "SELECT", HtmlEdit.PropertyNames.InnerText, "2005200620072008200920102011201220132014201520162017", HtmlEdit.PropertyNames.TagInstance, "4");
            RefFYField.WaitForControlReady();
            Assert.AreEqual(true, RefFYField.Exists);

            //select funding source name label
            HtmlLabel SelectSource = new HtmlLabel(browserWindow);

            SelectSource.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText,
                                              "Select a Funding Item that will be the Source for the new Funding Item", PropertyExpressionOperator.Contains);
            SelectSource.WaitForControlReady();

            //select source funding field
            HtmlCustom FundSource = new HtmlCustom(browserWindow);

            FundSource.SearchProperties.Add(HtmlCustom.PropertyNames.InnerText,
                                            "Select a source funding item...", PropertyExpressionOperator.Contains);
            FundSource.WaitForControlReady();

            //remaining unassigned funds label
            HtmlLabel RemainingFunds = new HtmlLabel(browserWindow);

            RemainingFunds.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText,
                                                "Remaining Unassigned Funds From Source", PropertyExpressionOperator.Contains);
            RemainingFunds.WaitForControlReady();

            //NEED TO MATCH THE SOURCE NAME DISPLAYED TO THE ONE ABOVE WHEN SELECTED TO VERIFY

            //funding amount label
            HtmlLabel Amount = new HtmlLabel(browserWindow);

            Amount.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText, "Amount *");
            Amount.WaitForControlReady();
            Assert.AreEqual(true, Amount.Exists);

            //funding amount field
            HtmlEdit AmountField = new HtmlEdit(browserWindow);

            AmountField.SearchProperties.Add(HtmlEdit.PropertyNames.TagName, "INPUT", HtmlEdit.PropertyNames.Id, "amount");
            AmountField.WaitForControlReady();
            Assert.AreEqual(true, AmountField.Exists);

            //description label
            HtmlLabel Description = new HtmlLabel(browserWindow);

            Description.SearchProperties.Add(HtmlLabel.PropertyNames.InnerText, "Description *");
            Description.WaitForControlReady();
            Assert.AreEqual(true, Description.Exists);

            //description field
            HtmlEdit DescField = new HtmlEdit(browserWindow);

            DescField.SearchProperties.Add(HtmlEdit.PropertyNames.Id, "description");
            DescField.WaitForControlReady();
            Assert.AreEqual(true, DescField.Exists);

            //save button
            HtmlButton SaveFund = new HtmlButton(browserWindow);

            SaveFund.SearchProperties.Add(HtmlButton.PropertyNames.InnerText, "Save", HtmlButton.PropertyNames.TagName, "BUTTON");
            SaveFund.WaitForControlReady();
            Assert.AreEqual(true, SaveFund.Exists);

            //cancel button
            HtmlButton CancelFund = new HtmlButton(browserWindow);

            CancelFund.SearchProperties.Add(HtmlButton.PropertyNames.InnerText, "Cancel", HtmlButton.PropertyNames.TagName, "BUTTON");
            CancelFund.WaitForControlReady();
            Assert.AreEqual(true, CancelFund.Exists);

            //END MODAL PROPS
        }