Exemple #1
0
        public static void FillDataInConfigureNetworkTraceInputOutput(IWebDriver driver, TestContext context)
        {
            AppCommonUtility.FindElementDynamically(driver, "esriCTTaskData");

            IWebElement         esriCTTaskData = driver.FindElement(By.ClassName("esriCTTaskData"));
            IList <IWebElement> taskDataList   = esriCTTaskData.FindElements(By.ClassName("dijitTitlePaneTitle"));

            foreach (IWebElement item in taskDataList)
            {
                switch (item.FindElement(By.ClassName("dijitTitlePaneTextNode")).Text)
                {
                case "Input":
                    FillDataInTaskData(driver, context);
                    item.Click();
                    break;

                case "Output":
                    item.Click();
                    FillDataOutputTaskPanel(driver, context);
                    item.Click();
                    break;
                    //case "Overview":
                    //    item.Click();
                    //    FillDataOverViewPanel(driver, Convert.ToBoolean(context.DataRow["chkVisibleOverview"].ToString()), context.DataRow["bufferDistanceTextOverview"].ToString(), context.DataRow["ddlTextUnitOverview"].ToString(), context.DataRow["minScaleTextOverview"].ToString(), context.DataRow["maxScaleTextOverview"].ToString(), Convert.ToBoolean(context.DataRow["chkSaveToLayerOverView"].ToString()), context.DataRow["ddlTextTargetLayerOverview"].ToString(), context.DataRow["ddlTextIsolatingValvesOverview"].ToString(), context.DataRow["ddlTextIsolatedHydrantsOverview"].ToString(), context.DataRow["ddlTextIsolatedCustomersOverview"].ToString());
                    //    break;
                    //case "Other":
                    //    item.Click();
                    //    FillDataOtherPanel(driver, context.DataRow["iamgeHeightTextOther"].ToString(), context.DataRow["imageWidthTextOther"].ToString(), context.DataRow["timeoutTextOther"].ToString(), context.DataRow["displayTextOther"].ToString());
                    //    break;
                }
            }
            //CreateNewClickOKCancel(driver, context);
        }
Exemple #2
0
        private static void FillDataOverViewPanel(IWebDriver driver, bool visibleCheck, string fillDataBufferDistance, string ddlOptionName, string fillDataMinScale, string fillDataMaxScale, bool saveToLayerCheck, string ddlOptionNameTargetLayer, string ddlOptionNameIsolatingValve, string ddlOptionNameIsolatedHydrants, string ddlOptionNameIsolatedCustomers)
        {
            IList <IWebElement> overviewContainer = driver.FindElements(By.ClassName("field"));

            if (visibleCheck)
            {
                AppCommonUtility.ClickCheckBoxUsingLabelName(overviewContainer, "Visible");
            }

            AppCommonUtility.FillDataTextBoxUsingLabelName(overviewContainer, "Buffer distance", fillDataBufferDistance);

            DropDownSelect(driver, "Unit", ddlOptionName);

            AppCommonUtility.FillDataTextBoxUsingLabelName(overviewContainer, "Min scale", fillDataMinScale);

            AppCommonUtility.FillDataTextBoxUsingLabelName(overviewContainer, "Max scale", fillDataMaxScale);

            if (saveToLayerCheck)
            {
                AppCommonUtility.ClickCheckBoxUsingLabelName(overviewContainer, "Save to layer");
                Thread.Sleep(200);

                DropDownSelect(driver, "Target layer", ddlOptionNameTargetLayer);

                DropDownSelectOverview(driver, "Isolating_Valves", ddlOptionNameIsolatingValve);

                DropDownSelectOverview(driver, "Isolated_Hydrants", ddlOptionNameIsolatedHydrants);

                DropDownSelectOverview(driver, "Isolated_Customers", ddlOptionNameIsolatedCustomers);
            }
        }
Exemple #3
0
        public static void ConfigureNetworkSetUrl(IWebDriver driver, TestContext context)
        {
            AppCommonUtility.FindElementDynamically(driver, "esriSetButton");

            IWebElement setButton = driver.FindElement(By.ClassName("esriSetButton"));

            setButton.Click();
        }
        public static void NextButtonClickCreateAppPanel(IWebDriver driver)
        {
            AppCommonUtility.FindElementDynamically(driver, "button-container");
            IWebElement         nextBtnDiv = driver.FindElement(By.ClassName("button-container"));
            IList <IWebElement> btnList    = nextBtnDiv.FindElements(By.ClassName("jimu-float-trailing"));

            AppCommonUtility.ListClickActionByName(btnList, "Next");
        }
Exemple #5
0
        public static void ClickConfigSaveButton(IWebDriver driver)
        {
            AppCommonUtility.FindElementDynamically(driver, "save-enable");

            IWebElement SaveButton = driver.FindElement(By.ClassName("save-enable"));

            SaveButton.Click();
        }
Exemple #6
0
        public static void ClickAddWidgetIcon(IWebDriver driver)
        {
            AppCommonUtility.FindElementDynamically(driver, "tab-item-title");
            IList <IWebElement> ele = driver.FindElements(By.ClassName("tab-item-title"));

            AppCommonUtility.ListClickActionByName(ele, "Widget");
            //IWebElement addIcon = driver.FindElement(By.ClassName("", "Widget"));
            //addIcon.Click();
        }
Exemple #7
0
        public static void ClickContinueBtn(IWebDriver driver)
        {
            AppCommonUtility.FindElementDynamically(driver, "ContinueBtn");

            //  Click on continue button
            IWebElement continueBtn = driver.FindElement(By.ClassName("ContinueBtn"));

            continueBtn.Click();
        }
Exemple #8
0
        public static void ClickSetWidgetController(IWebDriver driver)
        {
            IWebElement controllerPanel = driver.FindElement(By.ClassName("action-node"));

            controllerPanel.Click();
            IWebElement addWidgetNode = driver.FindElement(By.ClassName("add-widget-node"));

            AppCommonUtility.ClickDisplayedAndEnableElement(addWidgetNode);
        }
Exemple #9
0
        public static void GeoProcessingServiceUrlClickValidationBtn(IWebDriver driver)
        {
            //validate-btn
            AppCommonUtility.FindElementDynamically(driver, "validate-btn");

            IWebElement validateButton = driver.FindElement(By.ClassName("validate-btn"));

            AppCommonUtility.ClickDisplayedAndEnableElement(validateButton);
        }
Exemple #10
0
        public static void NetworkTraceCreateNewApp(IWebDriver driver)
        {
            AppCommonUtility.FindElementDynamically(driver, "create-button");

            //  Click on continue button
            IWebElement createButton = driver.FindElement(By.ClassName("create-button"));

            createButton.Click();
        }
Exemple #11
0
        public static void ClickMenuOption(IWebDriver driver, TestContext context)
        {
            AppCommonUtility.FindElementDynamically(driver, "config-section");

            IWebElement         controlTable = driver.FindElement(By.ClassName("config-section"));
            IList <IWebElement> menuOptions  = controlTable.FindElements(By.ClassName("tab-item-title"));

            //  Need to insert Data in excel
            AppCommonUtility.ListClickActionByName(menuOptions, context.DataRow["menuOption"].ToString());
        }
Exemple #12
0
        public static void EnterGeoProcessingServiceUrl(IWebDriver driver, TestContext context)
        {
            AppCommonUtility.FindElementDynamically(driver, "jimu-url-input");

            IWebElement         geoProcessingServiceUrl = driver.FindElement(By.ClassName("jimu-url-input"));
            IList <IWebElement> serviceTextBox          = geoProcessingServiceUrl.FindElements(By.TagName("input"));

            //  Need to insert data column in Excel
            serviceTextBox[1].SendKeys(context.DataRow["gpTaskUrl"].ToString());
        }
Exemple #13
0
        //  Get Icon Name
        public static void NetworkTraceGetFlagName(IWebDriver driver, List <string> iconNames)
        {
            AppCommonUtility.FindElementDynamically(driver, "traceControls");
            IWebElement         DivControl    = driver.FindElement(By.ClassName("traceControls"));
            IList <IWebElement> flagContainer = DivControl.FindElements(By.TagName("label"));

            foreach (IWebElement item in flagContainer)
            {
                iconNames.Add(item.Text);
            }
        }
Exemple #14
0
        public static void SetTaskSelectRadioButton(IWebDriver driver, TestContext context)
        {
            AppCommonUtility.FindElementDynamically(driver, "url-radio");

            //  Need to insert boolean value in the Excel
            if (Convert.ToBoolean(context.DataRow["checkRadioButton"].ToString()))
            {
                IWebElement addServiceUrl = driver.FindElement(By.ClassName("url-radio"));
                addServiceUrl.Click();
            }
        }
Exemple #15
0
        private static void FillDataOtherPanel(IWebDriver driver, string fillDataImageHeight, string fillDataImageWidth, string fillDataTimeout, string fillDataDisplayText)
        {
            IList <IWebElement> otherContainer = driver.FindElements(By.ClassName("field"));

            AppCommonUtility.FillDataTextBoxUsingLabelName(otherContainer, "Image height", fillDataImageHeight);

            AppCommonUtility.FillDataTextBoxUsingLabelName(otherContainer, "Image width", fillDataImageWidth);

            AppCommonUtility.FillDataTextBoxUsingLabelName(otherContainer, "Timeout", fillDataTimeout);

            AppCommonUtility.FillDataTextBoxUsingLabelName(otherContainer, "Display text", fillDataDisplayText);
        }
Exemple #16
0
        public static void ClickOnZoonIn(IWebDriver driver, int clickCount)
        {
            AppCommonUtility.FindElementDynamically(driver, "esriSimpleSliderIncrementButton");

            for (int i = 0; i < clickCount; i++)
            {
                //esriSimpleSliderDecrementButton esriSimpleSliderIncrementButton
                IWebElement zoomIn = driver.FindElement(By.ClassName("esriSimpleSliderDecrementButton"));
                zoomIn.Click();
                Thread.Sleep(2000);
            }
        }
Exemple #17
0
        public static void SearchForWebMap(IWebDriver driver, TestContext context)
        {
            AppCommonUtility.FindElementDynamically(driver, "jimu-input");
            IWebElement searchTextBox = driver.FindElement(By.ClassName("jimu-input"));

            //  Need to insert value in excel
            searchTextBox.SendKeys(context.DataRow["searchForWebMap"].ToString());

            IWebElement searchBtn = driver.FindElement(By.ClassName("search-btn"));

            searchBtn.Click();
        }
Exemple #18
0
        private static void FillDataInputInPanel(IWebDriver driver, string fillDataToolTip, string ddlOptionName)
        {
            IList <IWebElement> inputContainer = driver.FindElements(By.ClassName("field"));

            AppCommonUtility.FillDataTextBoxUsingLabelName(inputContainer, "Tooltip", fillDataToolTip);

            DropDownSelect(driver, "Type", ddlOptionName);

            AppCommonUtility.FindElementDynamically(driver, "symbol-td-item");
            IWebElement iconPanel = driver.FindElement(By.ClassName("symbol-td-item"));

            AppCommonUtility.ClickAndSelectFeature(iconPanel);
        }
Exemple #19
0
        public static void FillDetailsCreateNewApp(IWebDriver driver, TestContext context)
        {
            AppCommonUtility.FindElementDynamically(driver, "jimu-popup");

            IWebElement appTitle = driver.FindElement(By.ClassName("dijitInputInner"));

            appTitle.SendKeys(context.DataRow["appData"].ToString() + "_" + DateTime.Now);

            IWebElement appDescription = driver.FindElement(By.ClassName("dijitTextArea"));

            appDescription.SendKeys(context.DataRow["appDescription"].ToString());

            CreateNewClickOKCancel(driver, context);
        }
Exemple #20
0
        public static void EnterUserCredential(IWebDriver driver, string userName, string password)
        {
            AppCommonUtility.FindElementDynamically(driver, "user_username", "Id");
            IWebElement agolUserName = driver.FindElement(By.Id("user_username"));

            agolUserName.SendKeys(userName);

            IWebElement agolPassword = driver.FindElement(By.Id("user_password"));

            agolPassword.SendKeys(password);

            IWebElement signInBtn = driver.FindElement(By.Id("signIn"));

            signInBtn.Click();
        }
Exemple #21
0
        public static void SelectWidgetFormList(IWebDriver driver, TestContext context)
        {
            IList <IWebElement> widgetList = driver.FindElements(By.ClassName("label"));

            AppCommonUtility.ListClickActionByName(widgetList, "NetworkTrace");


            //IWebElement widgetContainer = driver.FindElement(By.ClassName("widgetList"));
            //IList<IWebElement> widgetList1 = widgetContainer.FindElements(By.ClassName("label"));

            //AppCommonUtility.ListClickActionByName(widgetList1, context.DataRow["NetworkTrace"].ToString());

            //  Click on OK button
            CreateNewClickOKCancel(driver, context);
        }
        public static void SelectMapByName(IWebDriver driver, TestContext context)
        {
            AppCommonUtility.FindElementDynamically(driver, "maps-table-div");

            //  Parent class
            IList <IWebElement> mapDiv = driver.FindElements(By.ClassName("maps-table-div"));

            foreach (IWebElement item in mapDiv)
            {
                //  Flag
                int i = 0;
                if (item.Displayed)
                {
                    //  Map div
                    IList <IWebElement> mapItems = driver.FindElements(By.ClassName("map-item-div"));
                    foreach (IWebElement map in mapItems)
                    {
                        if (map.Displayed)
                        {
                            //  Name of web map
                            string mapName = map.FindElement(By.TagName("span")).Text;

                            //  Need to insert value in excel
                            // if (mapName == context.DataRow["mapName"].ToString())
                            if (mapName == "Early-Voting webmap AUTO1")
                            {
                                i++;

                                //  Click on map
                                IWebElement mapContent = map.FindElement(By.ClassName("jimu-auto-vertical"));
                                mapContent.Click();
                                break;
                            }
                        }
                    }

                    if (i > 0)
                    {
                        break;
                    }
                }
            }

            //  Click on OK button
            CreateNewClickOKCancel(driver, context);
            Thread.Sleep(9000);
        }
Exemple #23
0
        private static void CreateNewClickOKCancel(IWebDriver driver, TestContext context)
        {
            // Need to insert condition in Excel
            bool check = Convert.ToBoolean(context.DataRow["checkBtn"].ToString());

            IWebElement         buttonContainer  = driver.FindElement(By.ClassName("button-container"));
            IList <IWebElement> buttonCollection = buttonContainer.FindElements(By.TagName("div"));

            if (check)
            {
                AppCommonUtility.ListClickActionByName(buttonCollection, "OK");
            }
            else
            {
                AppCommonUtility.ListClickActionByName(buttonCollection, "Cancel");
            }
        }
Exemple #24
0
        //  Click on Flag Icon using name
        public static void NetworkTraceClickFlagIconUsingName(IWebDriver driver, string flagName)
        {
            AppCommonUtility.FindElementDynamically(driver, "traceControls");

            IWebElement         DivControl    = driver.FindElement(By.ClassName("traceControls"));
            IList <IWebElement> flagContainer = DivControl.FindElements(By.TagName("div"));
            int i = 0;

            foreach (IWebElement item in flagContainer)
            {
                if (string.Equals(item.Text, flagName))
                {
                    flagContainer[i + 1].Click();
                }
                i++;
            }
        }
Exemple #25
0
        // Get Output Name from application
        public static List <string> NetworkTraceGetOutputNames(IWebDriver driver, List <string> outputNames)
        {
            AppCommonUtility.FindElementDynamically(driver, "resultPanelContainer");
            Thread.Sleep(5000);
            IList <IWebElement> outputpanelLabel = driver.FindElements(By.ClassName("dijitTitlePaneTitleFocus"));

            foreach (var item in outputpanelLabel)
            {
                string   getTextOutputPanellabel        = item.Text;
                string[] getSplitTextOutputPanel        = getTextOutputPanellabel.Split('(');
                string   getSplitTextOutputPanelIndex   = getSplitTextOutputPanel[0];
                string   getSplitTextOutputPanelTrimmed = getSplitTextOutputPanelIndex.TrimEnd();
                outputNames.Add(getSplitTextOutputPanelTrimmed);
            }
            outputNames.Remove(outputNames[0]);

            return(outputNames);
        }
Exemple #26
0
        public static void ClickOnEditIconNetworkTrace(IWebDriver driver)
        {
            //  IList<IWebElement> listContainer = driver.FindElements(By.ClassName("label"));
            IList <IWebElement> boxContainer = driver.FindElements(By.ClassName("widget-pool-list"));

            foreach (var item in boxContainer)
            {
                // IWebElement lableContainer = item.FindElement(By.ClassName("box"));
                IList <IWebElement> labelDiv = item.FindElements(By.ClassName("box"));
                labelDiv[3].Click();
                break;
            }
            IJavaScriptExecutor js = (IJavaScriptExecutor)driver;

            js.ExecuteScript("return document.getElementsByClassName('edit-btn')[0].click();");
            //  Thread.Sleep(5000);

            AppCommonUtility.FindElementDynamically(driver, "esriCTTaskData");
        }
Exemple #27
0
        public static void ValidateGeoProcessingServiceUrlClickOK(IWebDriver driver, TestContext context)
        {
            Thread.Sleep(1000);
            AppCommonUtility.FindElementDynamically(driver, "operations");
            IWebElement         popupOfWidgetSelect = driver.FindElement(By.ClassName("operations"));
            IList <IWebElement> OKBtnOftask         = popupOfWidgetSelect.FindElements(By.ClassName("jimu-float-trailing"));

            AppCommonUtility.ListClickActionByName(OKBtnOftask, "OK");
            //try
            //{
            //    AppCommonUtility.FindElementDynamically(driver, "operations");
            //}
            //catch (Exception)
            //{
            //    // URL is not valid
            //}

            //  Click on OK button
            // CreateNewClickOKCancel(driver, context);
        }
Exemple #28
0
        private static void FillDataOutputPanel(IWebDriver driver, string fillDataLabel, bool skippableCheck, string ddlOptionName, string fillDataTooltip, string fillDataSummaryText, string fillDataDisplayText, string fillDataMinScale, string fillDataMaxScale, bool exportToCsvCheck, bool saveToLayerCheck, string ddlOptionNameTargetLayer)
        {
            IList <IWebElement> outputContainer = driver.FindElements(By.ClassName("field"));

            AppCommonUtility.FillDataTextBoxUsingLabelName(outputContainer, "Label", fillDataLabel);

            if (skippableCheck)
            {
                AppCommonUtility.ClickCheckBoxUsingLabelName(outputContainer, "Skippable");
                Thread.Sleep(200);

                DropDownSelect(driver, "Unique ID field", ddlOptionName);
            }

            AppCommonUtility.FillDataTextBoxUsingLabelName(outputContainer, "Tooltip", fillDataTooltip);

            AppCommonUtility.FillDataTextBoxUsingLabelName(outputContainer, "Summary text", fillDataSummaryText);

            AppCommonUtility.FillDataTextBoxUsingLabelName(outputContainer, "Display text", fillDataDisplayText);

            AppCommonUtility.FillDataTextBoxUsingLabelName(outputContainer, "Min scale", fillDataMinScale);

            AppCommonUtility.FillDataTextBoxUsingLabelName(outputContainer, "Max scale", fillDataMaxScale);

            if (exportToCsvCheck)
            {
                AppCommonUtility.ClickCheckBoxUsingLabelName(outputContainer, "Export to CSV");
            }

            if (saveToLayerCheck)
            {
                AppCommonUtility.ClickCheckBoxUsingLabelName(outputContainer, "Save to layer");
                Thread.Sleep(200);

                DropDownSelect(driver, "Target layer", ddlOptionNameTargetLayer);
            }

            IWebElement iconPanel = driver.FindElement(By.ClassName("symbol-td-item"));

            AppCommonUtility.ClickAndSelectFeature(iconPanel);
        }
        //  Assertion with three validation
        public static void GetApplicationSnapShot(IWebDriver webdriver, ClientOperatingSystem OperatingSystem, ClientBrowser browser, string uniqueRowIdentifier = null)
        {
            int left, top, width, height;

            // Allow time for all elements on the map to be fully displayed.
            Thread.Sleep(5000);

            // Use calling method to form a unique file name for the baseline data.
            StackTrace stackTrace       = new StackTrace();
            string     uniqueIdentifier = uniqueRowIdentifier + OperatingSystem.ToString() + browser.ToString();
            string     uniqueFileName   = AppCommonUtility.GetUniqueFileName(uniqueIdentifier, stackTrace);


            CreateAppSnap(webdriver, out left, out top, out width, out height);

            // Crop the screenshot and convert it to a snapshot type.
            Rectangle rectangle = new Rectangle(left, top, width, height);
            Snapshot  snapshot  = GetSnapshotOfMap(webdriver);

            CreateSnapShot.AppCreateSnapShot(snapshot, uniqueFileName, rectangle);
        }
Exemple #30
0
        public static void EditWebApplication(IWebDriver driver)
        {
            //item-operations-td

            AppCommonUtility.FindElementDynamically(driver, "item-operations-td", "ClassName");
            IList <IWebElement> appNameContainer = driver.FindElements(By.ClassName("item-operations-td"));

            //jimu-float-leading
            foreach (var item in appNameContainer)
            {
                IWebElement appEditOption = item.FindElement(By.ClassName("jimu-float-leading"));
                if (string.Equals(appEditOption.GetAttribute("title"), "Edit"))
                {
                    IList <IWebElement> listtableitem = driver.FindElements(By.ClassName("list-table-item"));
                    listtableitem[0].Click();

                    Thread.Sleep(200);
                    appEditOption.Click();
                    break;
                }
            }
        }