Пример #1
0
        public void EditDM(DataMart dataMart, IWebDriver driver, string browser)
        {
            log.Info("Waiting for DataMart Grid to load to click link");
            System.Threading.Thread.Sleep(1000);
            WaitAndFindSelector.FindXPathAndClick("//a[.='" + dataMart.DMTestName + "']", driver);

            //First we loop over to Create the DataMart

            System.Threading.Thread.Sleep(1000);
            foreach (var action in dataMart.Actions)
            {
                try
                {
                    log.Info("Executing the action: " + action.InputType + " on property " + action.ByType + " " + action.ByValue);

                    WaitAndFindSelector.FindByAndExecute(action, driver);

                    log.Info("Executing the action: " + action.InputType + " on property " + action.ByType + " " + action.ByValue + " successfull");
                }
                catch (Exception ex)
                {
                    log.Error("error in DataMart Editing for " + dataMart.DMTestName + " in action " + action.Name);
                }
            }

            log.Info("Refreshing page to validate entries");

            driver.Navigate().Refresh();

            System.Threading.Thread.Sleep(2000);

            foreach (var action in dataMart.Actions.Where(x => x.Validate))
            {
                try
                {
                    log.Info("Validating the action: " + action.InputType + " on property" + action.ByType + " " + action.ByValue);

                    WaitAndFindSelector.ValidateFindByAndExecute(action, driver);

                    log.Info("Executing the action: " + action.InputType + " on property" + action.ByType + " " + action.ByValue + " successfull");
                }
                catch (Exception ex)
                {
                    log.Error("error in DataMart validation for " + dataMart.DMTestName + " in action " + action.Name);
                }
            }
        }
        public void DeleteDataMart(string datamart, IWebDriver driver, string browser)
        {
            try
            {
                log.Info("Waiting for DataMart Grid to load");
                System.Threading.Thread.Sleep(1000);

                WaitAndFindSelector.FindXPathAndClick("//a[.='" + datamart + "']", driver);

                System.Threading.Thread.Sleep(2000);

                WaitAndFindSelector.FindIdAndClick("btnDelete", driver);

                System.Threading.Thread.Sleep(2000);

                WaitAndFindSelector.FindIdAndClick("confirmYes", driver);

                System.Threading.Thread.Sleep(2000);
            }
            catch (Exception ex)
            {
                log.Error("error in DataMart Deletion for " + datamart);
            }
        }