Esempio n. 1
0
        public void CheckForClonedTemplate(string tName, string tPurpose, bool includeInvisible = true)
        {
            string str = this.CheckResultsInTemplateSearch(tName, includeInvisible);

            Assert.AreEqual(str, "Record Found");
            IWebElement resultTile = WebContext.WebDriver.FindElement(By.CssSelector("[data-automation-id='resultTile']"));

            SeleniumHelper.ClickByJS(resultTile);
            POM.Helper.Wait.WaitForElement(By.CssSelector(SeleniumHelper.AutomationId("ignore_commit_dialog")));
            IWebElement dontSaveButton = WebContext.WebDriver.FindElement(By.CssSelector(SeleniumHelper.AutomationId("ignore_commit_dialog")));

            POM.Helper.SeleniumHelper.ClickByJS(dontSaveButton);
        }
Esempio n. 2
0
        //Method to delete template opened in maintenance mode
        public string DeleteTemplate(string tName, bool includeInvisible = false)
        {
            string str = this.CheckResultsInTemplateSearch(tName, includeInvisible);

            IWebElement resultTile = WebContext.WebDriver.FindElement(By.CssSelector("[data-automation-id='resultTile']"));

            SeleniumHelper.ClickByJS(resultTile);

            BaseSeleniumComponents.WaitUntilDisplayed(By.CssSelector("[data-automation-id='delete_button']"));
            SeleniumHelper.ClickByJS(deleteButton);

            BaseSeleniumComponents.WaitUntilDisplayed(By.CssSelector("[data-automation-id='continue_with_delete_button']"));
            SeleniumHelper.ClickByJS(continueWithDeleteButton);
            Wait.WaitForAjaxReady(By.CssSelector(".locking-mask-loading"));
            //Search the same template to check successful deletion
            return(this.CheckResultsInTemplateSearch(tName, includeInvisible));
        }
Esempio n. 3
0
        public void CloneTemplateFromToolbar(string tName, string tPurpose, bool includeInvisible = true)
        {
            string str = this.CheckResultsInTemplateSearch(tName, includeInvisible);

            IWebElement resultTile = WebContext.WebDriver.FindElement(By.CssSelector("[data-automation-id='resultTile']"));

            //    POM.Helper.SeleniumHelper.ClickByJS(resultTile);

            SeleniumHelper.ClickByJS(resultTile);
            Wait.WaitForAjaxReady(By.CssSelector(".locking-mask-loading"));
            if (new TemplateSearchScreen().IsCloneTemplateDisplayed())
            {
                cloneTemplate.ClickByJS();
                Wait.WaitForAjaxReady(By.CssSelector(".locking-mask-loading"));
                POM.Helper.Wait.WaitForElement(By.CssSelector(SeleniumHelper.AutomationId("ignore_commit_dialog")));
                IWebElement dontSaveButton = WebContext.WebDriver.FindElement(By.CssSelector(SeleniumHelper.AutomationId("ignore_commit_dialog")));
                POM.Helper.SeleniumHelper.ClickByJS(dontSaveButton);
            }
            Wait.WaitForAjaxReady(By.CssSelector(".locking-mask-loading"));
            saveTemplate.Click();
        }
Esempio n. 4
0
 public void SignIn()
 {
     SeleniumHelper.ClickByJS(_signInButton);
     //_signInButton.Click();
 }
Esempio n. 5
0
        //Method to create new Message Template
        public bool CreateMessageTemplate(string tName, string tPurpose, bool activeFlag = true)
        {
            if (new TemplateSearchScreen().IsCreateNewTemplateDisplayed())
            {
                Thread.Sleep(500);
                createNewTemplate.Click();

                //Set template name
                BaseSeleniumComponents.WaitUntilDisplayed(By.Name("NameOfTemplate"));
                templateName.SendKeys(tName);

                //set template type
                Actions action = new Actions(WebContext.WebDriver);
                action.MoveToElement(documentTypeList).Click();
                action.SendKeys(Keys.Enter);
                action.Build().Perform();
                Thread.Sleep(300);
                action.SendKeys(tPurpose);
                action.SendKeys(Keys.Enter);
                action.Build().Perform();


                //set template as inactive.
                if (activeFlag == false && activeCheckBox.Selected)
                {
                    SeleniumHelper.ClickByJS(activeCheckBox);
                }

                //set template description.
                templateDescription.SendKeys(RandomString(15));

                //set template email subject
                emailSubject.SendKeys(RandomString(8));

                //save the template.
                SeleniumHelper.ClickByJS(saveTemplate);
                Wait.WaitForAjaxReady(By.CssSelector(".locking-mask-loading"));
                SeleniumHelper.Sleep(3);

                try
                {
                    if (statusError.Displayed)
                    {
                        //Add code to cancel the template creation.
                        cancelTemplate.Click();
                        //Add click event for dont save button on dialog box
                        return(false);
                    }
                    else
                    {
                        return(false);
                    }
                }
                catch
                {
                    //It throws an NoSuchElement exception when status error message is not displayed.
                    //Hence record creation successful
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }