public void Execute(IActor actor)
        {
            var driver = actor.Artifacts.Get <IWebDriver>();

            var element = _selector.Find(driver, driver);

            element.SendKeys(_text);
        }
Ejemplo n.º 2
0
        public void Execute(IActor actor)
        {
            if (actor == null)
            {
                throw new ArgumentNullException(nameof(actor));
            }

            var context = actor.Artifacts.Get <IWebDriver>();

            _elementSelector.Find(context, context).Submit();
        }
Ejemplo n.º 3
0
        public static IDisposable UseFrame(this IWebDriver driver, IElementSelector selector)
        {
            if (driver == null)
            {
                throw new ArgumentNullException(nameof(driver));
            }
            if (selector == null)
            {
                throw new ArgumentNullException(nameof(selector));
            }

            driver.SwitchTo().Frame(selector.Find(driver, driver));

            return(new DisposableAction(() => driver.SwitchTo().DefaultContent()));
        }
Ejemplo n.º 4
0
        public void Execute(IActor actor)
        {
            if (actor == null)
            {
                throw new ArgumentNullException(nameof(actor));
            }

            var driver = actor.Artifacts.Get <IWebDriver>();

            var element = _selector.Find(driver, driver);

            if (element == null)
            {
                throw new ExpectationException("Can't find element: " + _selector.GetElementDescription());
            }

            element.Click();
        }
Ejemplo n.º 5
0
        public void Execute(IActor actor)
        {
            if (actor == null)
            {
                throw new ArgumentNullException(nameof(actor));
            }

            var driver = actor.Artifacts.Get <IWebDriver>();

            if (_elementSelector != null)
            {
                driver.SwitchTo().Frame(_elementSelector.Find(driver, driver));
                return;
            }

            if (_useDefaultContent)
            {
                driver.SwitchTo().DefaultContent();
            }
        }