Example #1
0
        public void CheckMenuChargers()
        {
            Actions actions = new Actions(Browser.GetDriver());

            actions.MoveToElement(MenuAccesories.GetElement()).Build().Perform();
            new WebDriverWait(Browser.GetDriver(), TimeSpan.FromSeconds(10));
            actions.MoveToElement(MenuAccesories.GetElement()).MoveToElement(MenuChargers.GetElement()).Click().Build().Perform();

            /*
             * Actions builder = new Actions(Browser.GetDriver());
             * new WebDriverWait(Browser.GetDriver(), TimeSpan.FromSeconds(10));
             *
             * Actions acc = builder.MoveToElement(MenuAccesories.GetElement()).Click()
             *  .MoveToElement(MenuChargers.GetElement()).Click();
             *
             * acc.Build().Perform();
             *
             *
             *
             * /*
             * Actions charg = builder.MoveByOffset(200, -100).Click();
             * charg.Build().Perform();
             */
            //Browser.NavigateTo("http://hotline.ua/mobile/zaryadnye-ustrojstva-dlya-mobilnyh-telefonov/");
        }
        /// <summary>
        /// Gets values of form fields
        /// </summary>
        /// <returns>Message model</returns>
        public MessageData GetDraftData()
        {
            new WebDriverWait(Browser.Browser.GetDriver(), TimeSpan.FromSeconds(Browser.Browser.TimeoutForElement))
            .Until(
                condition =>
            {
                try
                {
                    var text = ((IJavaScriptExecutor)Browser.Browser.GetDriver()).ExecuteScript(
                        "return arguments[0].value;", TopicField.GetElement()).ToString();
                    return(text != "");
                }
                catch (StaleElementReferenceException)
                {
                    return(false);
                }
                catch (NoSuchElementException)
                {
                    return(false);
                }
            });
            var topic = ((IJavaScriptExecutor)Browser.Browser.GetDriver()).ExecuteScript(
                "return arguments[0].value;", TopicField.GetElement()).ToString();

            return(new MessageData()
            {
                To = new ElementWithLogger(new Element(By.CssSelector("div.oL.aDm.az9 span"), "to field")).GetText(),
                Topic = topic,
                Message = MessageArea.GetText()
            });
        }
Example #3
0
 public void GoToSignInPage()
 {
     signIn.WaitForIsVisible();
     signIn.GetElement().Click();
     Thread.Sleep(3000);
     Browser.GetDriver().SwitchTo().Frame(loginFrame.GetElement());
     loginTextField.WaitForIsVisible();
 }
Example #4
0
 public void DragEmailToTrashBin(string subject) => new BaseElement(By.XPath(String.Format(sentEmailLblTemplate, subject))).DragAndDrop(recycleBinMenuItem.GetElement());
Example #5
0
 public void ClickSubmitButtonOnFrame()
 {
     submitButtonOnFrame.WaitForIsVisible();
     submitButtonOnFrame.GetElement().Click();
     Browser.GetDriver().SwitchTo().DefaultContent();
 }
Example #6
0
 public void TypeLogin(string login)
 {
     loginTextField.WaitForIsVisible();
     loginTextField.GetElement().SendKeys(login);
 }
Example #7
0
 public void TypePassword(string password)
 {
     passwordTextField.WaitForIsVisible();
     passwordTextField.GetElement().SendKeys(password);
 }