Beispiel #1
0
        public void ShouldShowSuccessPageForValidApplication()
        {
            using (var browser = new IE("https://localhost:62727/Pages/ApplyForCreditCard.aspx"))
            {
                browser.AutoClose = false;
                BrowserDemoHelper.BringToFront(browser);
                browser.TextField(Find.ById("Name")).TypeText("Mark");
                browser.TextField(Find.ById("Age")).TypeText("30");
                browser.TextField(Find.ById("AirlineRewardNumber")).TypeText("A1234567");

                browser.Button(Find.ById("ApplyNow")).Click();

                Assert.That(browser.Url.Contains("ApplicationAccepted.aspx"));
            }
        }
        public void ShouldShowSuccessPageForValidApplication()
        {
            using (var browser =
                       new IE("http://localhost:62727/Pages/ApplyForCreditCard.aspx"))
            {
                // Leave the browser open after the test completes
                // to see what's happened for demo purposes
                browser.AutoClose = false;
                BrowserDemoHelper.BringToFront(browser);

                browser.TextField(Find.ById("Name")).TypeText("Jason");
                browser.TextField(Find.ById("Age")).TypeText("30");
                browser.TextField(Find.ById("AirlineRewardNumber")).TypeText("A1234567");

                browser.Button(Find.ById("ApplyNow")).Click();

                Assert.That(browser.Url.Contains("ApplicationAccepted.aspx"));
            }
        }
        public void ShouldShowCorrectApplicantDetailsOnSuccessPage()
        {
            using (var browser =
                       new IE("http://localhost:62727/Pages/ApplyForCreditCard.aspx"))
            {
                // Leave the browser open after the test completes
                // to see what's happened for demo purposes
                browser.AutoClose = false;
                BrowserDemoHelper.BringToFront(browser);


                browser.TextField(Find.ById("Name")).TypeText("Jason");
                browser.TextField(Find.ById("Age")).TypeText("30");
                browser.TextField(Find.ById("AirlineRewardNumber")).TypeText("A1234567");

                browser.Button(Find.ById("ApplyNow")).Click();

                var name = browser.Para(Find.ById("Name")).Text;

                Assert.That(name, Is.EqualTo("Jason"));
            }
        }