Esempio n. 1
0
        public void ThenTheProductsPageWillLoad(string expectedHeading)
        {
            var actualHeading = string.Empty;

            if (expectedHeading == "Products")
            {
                Assert.IsTrue(AllProducts.ProductsPageHeading.Displayed, TestErrorHelper.ExpectedPageHeadingNotDisplayed());
                actualHeading = AllProducts.ProductsPageHeading.Text;
                var actualHeadingManipulated = actualHeading.Substring(13);
                Assert.AreEqual(expectedHeading, actualHeadingManipulated,
                                TestErrorHelper.ExpectedActualageHeadingsDoNotMatch(expectedHeading, actualHeadingManipulated));
            }
            else if (expectedHeading == "Sale Items")
            {
                ThenTheProductsCollectionPageWillLoad(expectedHeading);
            }
            else if (expectedHeading == "Login")
            {
                Assert.IsTrue(LoginForm.LoginPageheader.Displayed, TestErrorHelper.ExpectedPageHeadingNotDisplayed());
                actualHeading = LoginForm.LoginPageheader.Text;
                Assert.AreEqual(expectedHeading, actualHeading, TestErrorHelper.ExpectedActualageHeadingsDoNotMatch(expectedHeading, actualHeading));
            }
            else if (expectedHeading == "Your cart")
            {
                Assert.IsTrue(YourCart.YourCartPageHeading.Displayed, TestErrorHelper.ExpectedPageHeadingNotDisplayed());
                actualHeading = YourCart.YourCartPageHeading.Text;
                Assert.AreEqual(expectedHeading, actualHeading, TestErrorHelper.ExpectedActualageHeadingsDoNotMatch(expectedHeading, actualHeading));
            }
            else if (expectedHeading == "News")
            {
                Assert.IsTrue(News.NewsPageHeading.Displayed, TestErrorHelper.ExpectedPageHeadingNotDisplayed());
                actualHeading = News.NewsPageHeading.Text;
                Assert.AreEqual(expectedHeading, actualHeading, TestErrorHelper.ExpectedActualageHeadingsDoNotMatch(expectedHeading, actualHeading));
            }
            else
            {
                Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(expectedHeading));
            }
        }
Esempio n. 2
0
        public void ThenTheProductsCollectionPageWillLoad(string expectedHeading)
        {
            Assert.IsTrue(ProductsPagesGenericItems.ProductsGenericPageHeading.Displayed, TestErrorHelper.ExpectedPageHeadingNotDisplayed());

            var actualHeading = ProductsPagesGenericItems.ProductsGenericPageHeading.Text;

            var actualHeadingManipulated = actualHeading.Substring(13);

            Assert.AreEqual(expectedHeading, actualHeadingManipulated,
                            TestErrorHelper.ExpectedActualageHeadingsDoNotMatch(expectedHeading, actualHeadingManipulated));
        }
Esempio n. 3
0
        public void ThenTheInformationalPageWillLoad(string expectedHeading)
        {
            Assert.IsTrue(InformationalPagesGenericItems.GenericPageHeading.Displayed, TestErrorHelper.ExpectedPageHeadingNotDisplayed());

            var actualHeading = InformationalPagesGenericItems.GenericPageHeading.Text;

            Assert.AreEqual(expectedHeading, actualHeading,
                            TestErrorHelper.ExpectedActualageHeadingsDoNotMatch(expectedHeading, actualHeading));
        }