public void Scope_becomes_stale_window()
        {
            VisitTestPage("InteractionTestsPage.htm");

            browser.ClickLink("Open pop up window");

            var timeToClickManuallyInIE = new Options {
                Timeout = TimeSpan.FromSeconds(10)
            };

            var popUp  = browser.FindWindow("Pop Up Window");
            var button = popUp.FindButton("scoped button", timeToClickManuallyInIE);

            Assert.That(button.Exists());
            Assert.That(popUp.HasContent("I am a pop up window"));

            CloseWindow(popUp);
            Assert.That(popUp.Missing(), "Expected popUp window to be missing");
            Assert.That(button.Missing(), "Expected button in popup to be missing");

            browser.ClickLink("Open pop up window");

            Assert.That(popUp.HasContent("I am a pop up window", timeToClickManuallyInIE));
            button.Click();
        }
Пример #2
0
        public void GivenXmanLogoSEmailAddressLxGmail_ComIsRegisteredInSystem(string firstName, string lastName, string email)
        {
            _browser.Visit("http://localhost");
            _browser.ClickLink("Register Contact");
            _browser.ClickLink("Create New");

            _browser.FillIn("FirstName").With(firstName.Replace("\"", ""));
            _browser.FillIn("LastName").With(lastName.Replace("\"", ""));
            _browser.FillIn("Email").With(email.Replace("\"", ""));
            _browser.ClickButton("Create");
        }
Пример #3
0
        public void GivenIRegisterAContactWithEmail(string emailAddress)
        {
            var addresses = emailAddress.Split(';').ToList();

            addresses.ForEach(x =>
            {
                _browser.Visit("http://localhost");
                _browser.ClickLink("Register Contact");
                _browser.ClickLink("Create New");
                _browser.FillIn("FirstName").With("1stname");
                _browser.FillIn("Email").With(x.Replace("\"", ""));
                Assert.AreEqual(x.Replace("\"", ""), _browser.FindField("Email").Value);
                _browser.ClickButton("Create");
            });
        }
Пример #4
0
 public void PrivacyTest()
 {
     browser.Visit("/");
     browser.ClickLink("Privacy", Options.First);
     Assert.True(browser.HasContent("Privacy Policy"));
     Assert.True(browser.HasContent("Use this page to detail your site's privacy policy."));
 }
Пример #5
0
        internal static void EnsureLoggedIn(this BrowserSession browser)
        {
            var loggedIn  = new State(() => browser.HasContent("Log off"));
            var loggedOut = new State(() => browser.HasContent("Login"));

            if (browser.FindState(loggedIn, loggedOut) == loggedIn)
            {
                return;
            }

            browser.ClickLink("Login");
            browser.ClickButton("Google");

            browser.FillIn("Email").With("*****@*****.**");
            browser.FillIn("Password").With(Environment.GetEnvironmentVariable("RegisterKeeperTestData"));

            browser.ClickButton("Sign in");

            if (browser.HasContent("Associate your Google account"))
            {
                browser.ClickButton("Register");
            }

            if (!browser.FindCss("div.navbar").HasContent("*****@*****.**"))
            {
                throw new Exception("Login process failed.");
            }
        }
Пример #6
0
 public void GivenISetUpTwoFavouriteGroups()
 {
     BrowserSession.Visit("/groups/results");
     BrowserSession.ClickLink("/favourites/nojs/add?slug=time-for-dance&type=group");
     BrowserSession.ClickLink("/favourites/nojs/add?slug=time-for-dance1&type=group");
     Thread.Sleep(1000);
 }
Пример #7
0
        public void Visibility_NewTwitterLogin()
        {
            browser.Visit("http://www.twitter.com");

            browser.ClickLink("Log in");
            browser.FillIn("session[username_or_email]").With("coyputester2");
            browser.FillIn("session[password]").With("Nappybara");
        }
Пример #8
0
        public void Click()
        {
            if (_more)
            {
                _browser.ClickLink("More");    // only used for header sub-options
                Thread.Sleep(1000);
            }
            element.Click();

            Thread.Sleep(2000);
        }
Пример #9
0
        public void Scope_becomes_stale_window()
        {
            VisitTestPage("InteractionTestsPage.htm");

            browser.ClickLink("Open pop up window");

            var popUp  = browser.FindWindow("Pop Up Window");
            var button = popUp.FindButton("scoped button");

            Assert.That(button.Exists());
            Assert.That(popUp.HasContent("I am a pop up window"));

            popUp.ExecuteScript("self.close()");

            Assert.That(button.Missing());

            browser.ClickLink("Open pop up window");

            Assert.That(popUp.HasContent("I am a pop up window"));
            button.Click();
        }
Пример #10
0
 public void ClickReport()
 {
     _browser.ClickLink("Report Issue");
 }
Пример #11
0
 public void TypeTweetAgain(string tweetText)
 {
     _browser.ClickLink("home timeline");
     _browser.FindId("tweet-box-home-timeline").FillInWith(tweetText);
 }
Пример #12
0
 public void ClickPerfil()
 {
     _browser.ClickLink("Profiles");
 }
Пример #13
0
 public void AbrirIssue()
 {
     _browser.FindCss("tr:nth-child(4) > td:nth-child(4) > a").Click();
     _browser.ClickLink("Print");
 }
Пример #14
0
 public void WhenIClickTheLink(string url)
 {
     BrowserSession.ClickLink(url);
     Thread.Sleep(1000);
 }