コード例 #1
0
        public void Feed_Configuration_duplicate(string UName, string Paswd, string optionalName, string Action, string URL)
        {
            Entered_Username     = UName;
            Entered_Password     = Paswd;
            Entered_OPtionalName = optionalName;
            Entered_Url          = URL;

            UserName.EnterText(UName);
            Password.EnterText(Paswd);
            OptionalName.EnterText(optionalName);
            if (provider == "others")
            {
                URL_Otherfeed.EnterText(URL);
            }
            if (Action == "Save" && UName != "" && Paswd != "")
            {
                BtnSave.WebClick();
                DuplicateFeed_Msg.Wait_ElmToBeDisplayed(30);
                DuplicateMsg_ServiceProviderDataId = DuplicateFeed_Msg.GetText();
                //bool a = DuplicateFeed_Msg.Displayed;
                // DuplicateFeed_Msg

                // PropertiesCollection.fluentWait("//div[contains(text(),'Error']", 20);
            }

            if (Action == "Cancel")
            {
                BtnCancel.WebClick();
            }
            // System.Threading.Thread.Sleep(5000);
        }
コード例 #2
0
        public void Feed_Configuration(string UName, string Paswd, string optionalName, string Action, string URL)
        {
            Entered_Username     = UName;
            Entered_Password     = Paswd;
            Entered_OPtionalName = optionalName;
            Entered_Url          = URL;
            if (provider != "others")
            {
                App_URL = Feed_URL.GetText();
            }

            Assert.AreEqual(true, UserName.Displayed, "Field Username is displayed");
            Assert.AreEqual(true, Password.Displayed, "Field Username is displayed");
            Assert.AreEqual(true, OptionalName.Displayed, "Field Username is displayed");
            Assert.AreEqual(true, BtnSave.Displayed, "Field Username is displayed");
            Assert.AreEqual(true, BtnCancel.Displayed, "Field Username is displayed");

            UserName.EnterText(UName);
            Password.EnterText(Paswd);
            OptionalName.EnterText(optionalName);
            if (provider == "others")
            {
                URL_Otherfeed.EnterText(URL);
            }

            if (Action == "Save" && UName != "" && Paswd != "")
            {
                BtnSave.WebClick();
                // bool a = Driver.FindElement(By.XPath("//div[contains(text(),'Success: Provider configuration saved'")).Displayed;
                //bool b = Driver.FindElement(By.XPath("//div[contains(text(),'Info: Added to previosly configured feeds'")).Displayed;
                // System.Threading.Thread.Sleep(5000);
            }

            if (Action == "Cancel")
            {
                BtnCancel.WebClick();
            }
            // System.Threading.Thread.Sleep(5000);

            WebDriverWait wait = new WebDriverWait(BrowserFactory.Driver, TimeSpan.FromSeconds(15));

            wait.Until(waithelper.ExpectedConditions.InvisibilityOfElementLocated(By.XPath(".//*[contains(@class,'toast-message')]")));
        }