Esempio n. 1
0
        public void WhenISearchForBooksByThePhrase(string searchTerm)
        {
            _navDriver.NavigateTo("Home");

            _textBoxDriver.SetTextBoxValue("searchTerm", searchTerm);
            _formDriver.SubmitForm("searchForm");
        }
Esempio n. 2
0
        public void LoadPageWithScripts(string[] scriptNames)
        {
            var request = new ScriptRequest {
                Mandatories = scriptNames.Join(",")
            };

            _navigation.NavigateTo(request);
        }
Esempio n. 3
0
        public void GoTo(string name)
        {
            // Add to ScreenFixture
            var driver = new NavigationDriver(Application);

            driver.NavigateTo(new TextModel {
                Name = name
            });
        }
Esempio n. 4
0
        public bool RunAllSpecs()
        {
            string title = "Running Jasmine specs for project at " + _input.SerenityFile;

            Console.WriteLine(title);
            string line = "".PadRight(title.Length, '-');

            Console.WriteLine(line);

            buildApplication();
            bool returnValue = true;

            resetServer();

            _driver.NavigateTo <JasminePages>(x => x.AllSpecs());

            IWebDriver browser = _applicationUnderTest.Driver;

            Wait.Until(() => browser.FindElement(By.ClassName("finished-at")).Text.IsNotEmpty(),
                       timeoutInMilliseconds: _input.TimeoutFlag * 1000);
            ReadOnlyCollection <IWebElement> failures = browser.FindElements(By.CssSelector("div.suite.failed"));

            if (_input.Mode == JasmineMode.run && _input.VerboseFlag)
            {
                browser.As <IJavaScriptExecutor>().ExecuteScript("$('#jasmine-reporter').show();");
                ReadOnlyCollection <IWebElement> logs = browser.FindElements(By.ClassName("jasmine-reporter-item"));
                logs.Each(message => Console.WriteLine(message.Text));
                browser.As <IJavaScriptExecutor>().ExecuteScript("$('#jasmine-reporter').hide();");
            }

            if (failures.Any())
            {
                returnValue = false;

                Console.WriteLine(line);
                writeFailures(failures);
            }

            Console.WriteLine();
            Console.WriteLine(line);
            writeTotals(browser);

            browser.Quit();
            browser.SafeDispose();
            _server.Dispose();

            return(returnValue);
        }
Esempio n. 5
0
        public bool RunAllSpecs()
        {
            var title = "Running Jasmine specs for project at " + _input.SerenityFile;

            Console.WriteLine(title);
            var line = "".PadRight(title.Length, '-');

            Console.WriteLine(line);

            buildApplication();
            var returnValue = true;

            _kayak = new FubuKayakApplication(_application);
            _kayak.RunApplication(_input.PortFlag, runtime =>
            {
                _driver.NavigateTo <JasminePages>(x => x.AllSpecs());

                var browser = _applicationUnderTest.Driver;
                Wait.Until(() => browser.FindElement(By.ClassName("finished-at")).Text.IsNotEmpty());
                var failures = browser.FindElements(By.CssSelector("div.suite.failed"));


                if (failures.Any())
                {
                    returnValue = false;

                    Console.WriteLine(line);
                    writeFailures(failures);
                }

                Console.WriteLine();
                Console.WriteLine(line);
                writeTotals(browser);

                browser.Quit();
                browser.SafeDispose();
                _kayak.Stop();
            });


            return(returnValue);
        }
Esempio n. 6
0
 public void OpenPage(string url)
 {
     _navigation.NavigateTo(url);
 }