Exemple #1
0
        public void WhenIClickOnSomeOfTheBooksOnResultsPage()
        {
            // Get second result
            var link = ResultsPage.GetResult(1);

            // Store info about this result in sceanrio context
            var book = new Book();

            book.ID    = link.HRef.Replace("book", "").Replace("/", "");
            book.Title = link.Title;
            ScenarioContext.Current.AddOrUpdate("book", book);

            // Click the link
            link.Click();
        }
Exemple #2
0
        public void ThenBookDetailsPageForThisBookIsCorrect()
        {
            var expectedBook = ScenarioContext.Current["book"] as BookDetails;

            GivenIMOnITEBooksHomePage();
            WhenISeach(expectedBook.Title, "Title");

            var link = ResultsPage.GetResult(expectedBook.Title);

            link.Click();
            DetailsPage.BookInfo.Wait.ForVisible();

            Assert.AreEqual(expectedBook.Title, DetailsPage.BookTitle, "Book title is wrong.");
            Assert.AreEqual(expectedBook.SubTitle, DetailsPage.BookSubTitle, "Book sub title is wrong.");
        }
Exemple #3
0
        public void ThenResultContainsBook(string BookTitle)
        {
            var result = ResultsPage.GetResult(BookTitle);

            Assert.IsNotNull(result, "{0} is not found", BookTitle);
        }