private void WaitForInitalization()
        {
            var wait      = WrappedDriver.Wait(TimeSpan.FromSeconds(10));
            var timeoutMS = wait.Timeout.TotalMilliseconds;
            var pollingMS = wait.PollingInterval.TotalMilliseconds;

            var script =
                AddTinyMCEUtilities(String.Empty) +
                "var el = {args}[0];" +
                "var editor = tinyMCEUtilities.getEditor(el);" +
                "tinyMCEUtilities.waitForInitialization(editor," +
                $"{timeoutMS}," +
                $"{pollingMS}," +
                "{resolve}," +
                "{reject});";

            script = JavaScript.RemoveComments(script);
            script = JavaScript.Clean(script);

            var waiter = new PromiseBody(WrappedDriver)
            {
                Arguments = new[] { new JavaScriptValue(WrappedElement) },
                Script    = script
            };

            // Condense the script.
            waiter.Format();

            waiter.Execute(WrappedDriver.JavaScriptExecutor());
            wait.Until(d => waiter.Finished);
            waiter.Wait(TimeSpan.FromSeconds(10));
        }
Ejemplo n.º 2
0
        public static void CreatePointAtCurrentMousePosition(this IWebDriver driver)
        {
            var js = new PromiseBody(driver)
            {
                Script = Resources.createPointAtCurrentMousePosition
            };

            js.Execute(driver.JavaScriptExecutor());

            driver.CreateActions()
            .MoveByOffset(1, 1)
            .MoveByOffset(-1, -1)
            .Perform();

            js.Wait(TimeSpan.FromSeconds(2));
        }