public void ThenTheWillBeDisplayed(string expectedPage) { string itemType = "page"; if (expectedPage == "News") { var actualHeading = News.NewsPageHeading.Text; Assert.AreEqual(expectedPage, actualHeading, TestErrorHelper.ExpectedActualPageHeadingsDoNotMatch(expectedPage, actualHeading)); } if (expectedPage == "Training") { BrowserHelper.SwitchFocusToAnotherTab(1); ProductsCollectionPagesGenericAssertions.ConfirmProductCollectionPageHasBeenLoaded(itemType, expectedPage); } if (expectedPage == "Summer Time") { BrowserHelper.SwitchFocusToAnotherTab(1); ProductsCollectionPagesGenericAssertions.ConfirmProductCollectionPageHasBeenLoaded(itemType, expectedPage); } if (expectedPage == "Water & Food Flask with Collapsible Travel Bowl" || expectedPage == "Summer Cooling Vest" || expectedPage == "Summer Cooling Scarf" || expectedPage == "Thick Fur Grooming Comb" || expectedPage == "Selection of Adjustable Non-Pull Dog Harness") { BrowserHelper.SwitchFocusToAnotherTab(1); ProductDetailsGenericAssertions.ConfirmProductDetailsPageHasBeenLoaded(itemType, expectedPage); } }
public static void ConfirmProductDetailsPageHasBeenLoaded(string itemType, string expectedHeading) { Assert.IsTrue(ProductsDetail.ProductName.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, expectedHeading)); var actualHeading = ProductsDetail.ProductName.Text; Assert.AreEqual(expectedHeading, actualHeading, TestErrorHelper.ExpectedActualPageHeadingsDoNotMatch(expectedHeading, actualHeading)); }
public static void ConfirmInformationalPageHasBeenLoaded(string itemType, string expectedItem) { Assert.IsTrue(InformationalPagesGenericItems.GenericPageHeading.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, expectedItem)); var actualHeading = InformationalPagesGenericItems.GenericPageHeading.Text; Assert.AreEqual(expectedItem, actualHeading, TestErrorHelper.ExpectedActualPageHeadingsDoNotMatch(expectedItem, actualHeading)); }
public static void ConfirmProductCollectionPageHasBeenLoaded(string itemType, string expectedHeading) { Assert.IsTrue(ProductsPagesGenericItems.ProductsGenericPageHeading.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, expectedHeading)); var actualHeading = ProductsPagesGenericItems.ProductsGenericPageHeading.Text; var actualHeadingManipulated = actualHeading.Substring(13); Assert.AreEqual(expectedHeading, actualHeadingManipulated, TestErrorHelper.ExpectedActualPageHeadingsDoNotMatch(expectedHeading, actualHeadingManipulated)); }
public void ThenCorrectArticleWillBeDisplayed(string expectedArticle) { var itemType = "heading"; Assert.IsTrue(NewsArticlesGenericItems.ArticlePageHeading.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, expectedArticle)); var actualPageHeading = NewsArticlesGenericItems.ArticlePageHeading.Text; Assert.AreEqual(expectedArticle, actualPageHeading, TestErrorHelper.ExpectedActualPageHeadingsDoNotMatch(expectedArticle, actualPageHeading)); }
public void ThenTheYourAddressesPageWillBeDisplayed() { var expectedHeading = "Your Addresses"; var itemType = "page heading"; Assert.IsTrue(YourAddresses.YourAddressesHeading.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, expectedHeading)); var actualHeading = YourAddresses.YourAddressesHeading.Text; Assert.AreEqual(expectedHeading, actualHeading, TestErrorHelper.ExpectedActualPageHeadingsDoNotMatch(expectedHeading, actualHeading)); }
public void ThenThePageWillBeDisplayed(string expectedPage) { var itemType = "page heading"; Assert.IsTrue(MyAccount.MyAccountPageHeading.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, expectedPage)); var actualHeading = MyAccount.MyAccountPageHeading.Text; Assert.AreEqual(expectedPage, actualHeading, TestErrorHelper.ExpectedActualPageHeadingsDoNotMatch(expectedPage, actualHeading)); }
public void ThenTheProductsPageWillLoad(string expectedHeading) { var itemType = "page heading"; var actualHeading = string.Empty; if (expectedHeading == "Products") { Assert.IsTrue(AllProducts.ProductsPageHeading.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, expectedHeading)); actualHeading = AllProducts.ProductsPageHeading.Text; var actualHeadingManipulated = actualHeading.Substring(13); Assert.AreEqual(expectedHeading, actualHeadingManipulated, TestErrorHelper.ExpectedActualPageHeadingsDoNotMatch(expectedHeading, actualHeadingManipulated)); } else if (expectedHeading == "Sale Items") { ThenTheProductsCollectionPageWillLoad(expectedHeading); } else if (expectedHeading == "Login") { Assert.IsTrue(LoginForm.LoginPageheader.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, expectedHeading)); actualHeading = LoginForm.LoginPageheader.Text; Assert.AreEqual(expectedHeading, actualHeading, TestErrorHelper.ExpectedActualPageHeadingsDoNotMatch(expectedHeading, actualHeading)); } else if (expectedHeading == "Your cart") { Assert.IsTrue(YourCart.YourCartPageHeading.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, expectedHeading)); actualHeading = YourCart.YourCartPageHeading.Text; Assert.AreEqual(expectedHeading, actualHeading, TestErrorHelper.ExpectedActualPageHeadingsDoNotMatch(expectedHeading, actualHeading)); } else if (expectedHeading == "News") { Assert.IsTrue(News.NewsPageHeading.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, expectedHeading)); actualHeading = News.NewsPageHeading.Text; Assert.AreEqual(expectedHeading, actualHeading, TestErrorHelper.ExpectedActualPageHeadingsDoNotMatch(expectedHeading, actualHeading)); } else { Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(expectedHeading)); } }