public void WhenIClickTheHeaderOption(string headerOption) { switch (headerOption) { case "On Sale": _headerNavigation.ToSaleItems(); break; case "All Products": _headerNavigation.ToAllProducts(); break; case "Login": _headerNavigation.ToLoginForm(); break; case "Your Cart": _headerNavigation.ToYourCart(); break; case "News": _headerNavigation.ToNews(); break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(headerOption)); break; } }
public void WhenIClickTheOptionOnTheDropDownList(string collectionsDropDown) { switch (collectionsDropDown) { case "Beds & Blankets": _headerNavigation.ToBedsBlankets(); break; case "Bowls & Food": _headerNavigation.ToBowlsFood(); break; case "Grooming": _headerNavigation.ToGrooming(); break; case "Collars & Leads": _headerNavigation.ToCollarsLeads(); break; case "Health Care": _headerNavigation.ToHealthCare(); break; case "Training": _headerNavigation.ToTraining(); break; case "Small Dogs & Puppy": _headerNavigation.ToSmallDogsPuppy(); break; case "Large Dogs": _headerNavigation.ToLargeDogs(); break; case "Toys & Games": _headerNavigation.ToToysGames(); break; case "On the go": _headerNavigation.ToOnTheGo(); break; case "Summer Time": _headerNavigation.ToSummerTime(); break; case "Winter Time": _headerNavigation.ToWinterTime(); break; default: Console.WriteLine( TestErrorHelper.CaseValueNotRecognised(collectionsDropDown)); break; } }
public void WhenIClickTheInTheCollectionsFrame(string collectionsLink) { switch (collectionsLink) { case "Beds & Blankets": _homepageNavigation.ToCollectionsBedsBlankets(); break; case "Bowls & Food": _homepageNavigation.ToCollectionsBowlsFood(); break; case "Grooming": _homepageNavigation.ToCollectionsGrooming(); break; case "Collars & Leads": _homepageNavigation.ToCollectionsCollarsLeads(); break; case "Health Care": _homepageNavigation.ToCollectionsHealthCare(); break; case "Training": _homepageNavigation.ToCollectionsTraining(); break; case "Small Dogs & Puppy": _homepageNavigation.ToCollectionsSmallDogsPuppies(); break; case "Large Dogs": _homepageNavigation.ToCollectionsLargeDogs(); break; case "Toys & Games": _homepageNavigation.ToCollectionsToysGames(); break; case "On the go": _homepageNavigation.ToCollectionsOnTheGo(); break; case "Summer Time": _homepageNavigation.ToCollectionsSummerTime(); break; case "Winter Time": _homepageNavigation.ToCollectionsWinterTime(); break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(collectionsLink)); break; } }
public void GivenTheLinkIsPresent(string hyperLink) { var itemType = "hyperLink"; switch (hyperLink) { case "return policy link": Assert.IsTrue(Faq.ReturnPolicyLink.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, hyperLink)); break; case "homepage link one": Assert.IsTrue(PrivacyPolicy.PoochWarehouseHyperlinkOne.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, hyperLink)); break; case "homepage link two": Assert.IsTrue(PrivacyPolicy.PoochWarehouseHyperlinkOne.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, hyperLink)); break; case "all about cookies link": Assert.IsTrue(PrivacyPolicy.AllAboutCookiesLink.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, hyperLink)); break; case "shopify link": Assert.IsTrue(PrivacyPolicy.ShopifyLegalLink.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, hyperLink)); break; case "google privacy link": Assert.IsTrue(PrivacyPolicy.GooglePrivacy.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, hyperLink)); break; case "google opt out link": Assert.IsTrue(PrivacyPolicy.GoogleOptOut.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, hyperLink)); break; case "facebook advertising link": Assert.IsTrue(PrivacyPolicy.FacebookAdvertising.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, hyperLink)); break; case "contact us link": Assert.IsTrue(ReturnsPolicy.ContactUsLink.Displayed, TestErrorHelper.ExpectedItemNotDisplayed(itemType, hyperLink)); break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(hyperLink)); break; } }
public void ThenThePageWillBeLoaded(string expectedPage) { var itemType = "page heading"; if (expectedPage == "Returns Policy" || expectedPage == "Contact Us" || expectedPage == "Home Page") { if (expectedPage == "Returns Policy" || expectedPage == "Contact Us") { InformationalPageAssertions.ConfirmInformationalPageHasBeenLoaded(itemType, expectedPage); } else if (expectedPage == "Home Page") { HomepageAssertions.ConfirmHomePageHasBeenLoaded(); } } else { switch (expectedPage) { case "All About Cookies": InformationalPageAssertions.ConfirmInformationalPageHyperLinksToExternalSitesAreCorrect(Urls.ExternalAllAboutCookies); break; case "Shopify Privacy": InformationalPageAssertions.ConfirmInformationalPageHyperLinksToExternalSitesAreCorrect(Urls.ExternalShopify); break; case "Google Privacy": InformationalPageAssertions.ConfirmInformationalPageHyperLinksToExternalSitesAreCorrect(Urls.ExternalGooglePrivacy); break; case "Google Opt Out": InformationalPageAssertions.ConfirmInformationalPageHyperLinksToExternalSitesAreCorrect(Urls.ExternalGoogleOptOut); break; case "Facebook Data Policy": InformationalPageAssertions.ConfirmInformationalPageHyperLinksToExternalSitesAreCorrect(Urls.ExternalFacebookAdvertising); break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(expectedPage)); break; } } }
public void WhenIClickTheOption(string homePageNavigationType) { switch (homePageNavigationType) { case "Homepage header": _headerNavigation.ToHomePage(); break; case "PoochWarehouse logo": _headerNavigation.ToHomePageViaLogo(); break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(homePageNavigationType)); break; } }
public void ThenTheButtonWillBeDisabled(string navigationButton) { switch (navigationButton) { case "previous": Assert.IsFalse(AllProducts.PreviousPageButtonDisabled.Enabled, "The previous button should have been disabled."); break; case "next": Assert.IsFalse(AllProducts.NextPageButtonDisabled.Enabled, "The next button should have been disabled."); break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(navigationButton)); break; } }
public void WhenIClickTheButton(string navigationButton) { switch (navigationButton) { case "next": AllProductsNavigation.ClickNextPage(); break; case "previous": AllProductsNavigation.ClickPreviousPage(); break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(navigationButton)); break; } }
public void WhenIClickThe(string hyperLink) { switch (hyperLink) { case "return policy link": Faq.ReturnPolicyLink.Click(); break; case "homepage link one": PrivacyPolicy.PoochWarehouseHyperlinkOne.Click(); break; case "homepage link two": PrivacyPolicy.PoochWarehouseHyperlinkTwo.Click(); break; case "all about cookies link": PrivacyPolicy.AllAboutCookiesLink.Click(); break; case "shopify link": PrivacyPolicy.ShopifyLegalLink.Click(); break; case "google privacy link": PrivacyPolicy.GooglePrivacy.Click(); break; case "google opt out link": PrivacyPolicy.GoogleOptOut.Click(); break; case "facebook advertising link": PrivacyPolicy.FacebookAdvertising.Click(); break; case "contact us link": ReturnsPolicy.ContactUsLink.Click(); break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(hyperLink)); break; } }
public void WhenISelectThe(string hyperLink) { switch (hyperLink) { case "Back To News Button": NewsArticleGenericNavigation.BackToNewsButton(); break; case "Summer Collection Image": NewsArticleSummerHereNavigation.ClickSummerCollectionImage(); break; case "Travel Flask": NewsArticleSummerHereNavigation.ClickTravelFlaskLink(); break; case "Summer Cooling Vest": NewsArticleSummerHereNavigation.ClickSummerCoolingVestLink(); break; case "Summer Cooling Scarf": NewsArticleSummerHereNavigation.ClickSummerCoolingScarfLink(); break; case "Thick Fur Grooming Comb": NewsArticleSummerHereNavigation.ClickThickFurGroomingCombLink(); break; case "Harnesses": NewsArticleWhyHarnessesNavigation.SelectHarnessesLink(); break; case "Positive Reinforcement": NewsArticleWhyHarnessesNavigation.SelectPositiveReinforcementLink(); break; case "Harnesses Two": NewsArticleWhyHarnessesNavigation.SelectHarnessesLinkTwo(); break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(hyperLink)); break; } }
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)); } }
public void WhenIClickTheInTheWebsiteFooter(string linkName) { switch (linkName) { case "About Us": _footerNavigation.ToAboutUs(); break; case "FAQ": _footerNavigation.ToFaq(); break; case "Delivery & Shipping": _footerNavigation.ToDeliveryAndShipping(); break; case "Returns Policy": _footerNavigation.ToReturnsPolicy(); break; case "Privacy Policy": _footerNavigation.ToPrivacyPolicy(); break; case "Terms Of Use": _footerNavigation.ToTermsOfUse(); break; case "Contact Us": _footerNavigation.ToContactUs(); break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(linkName)); break; } }
public string SetUrl(string webPage) { string url; switch (webPage) { case "sale-items": url = Urls.SaleItemsUrl; break; case "all-products": url = Urls.AllProductsUrlPgOne; break; case "beds-blankets": url = Urls.BedsBlanketsUrl; break; case "bowls-food": url = Urls.BowlsFoodUrl; break; case "health-grooming": url = Urls.HealthGroomingUrl; break; case "collars-leads": url = Urls.CollarsLeadsUrl; break; case "health-care": url = Urls.HealthCareUrl; break; case "training": url = Urls.TrainingUrl; break; case "small-dogs": url = Urls.SmallDogsUrl; break; case "large-dogs": url = Urls.LargeDogsUrl; break; case "toys-games": url = Urls.ToysGamesUrl; break; case "on-the-go": url = Urls.OnTheGoUrl; break; case "summer-collection": url = Urls.SummerCollectionUrl; break; case "winter-collection": url = Urls.WinterCollectionUrl; break; case "login": url = Urls.LoginUrl; break; case "your-cart": url = Urls.YourCartUrl; break; case "about-us": url = Urls.AboutUsUrl; break; case "faq": url = Urls.FaqUrl; break; case "delivery-shipping": url = Urls.DeliveryShippingUrl; break; case "returns-policy": url = Urls.ReturnsPolicyUrl; break; case "privacy-policy": url = Urls.PrivacyPolicyUrl; break; case "terms-of-use": url = Urls.TermsOfUseUrl; break; case "contact-us": url = Urls.ContactUsUrl; break; case "News & Blog": url = Urls.NewsUrl; break; case "Summer Is Here": url = Urls.NewsArticleSummerUrl; break; case "Pooch Car Safety": url = Urls.NewsArticlePoochTravel; break; case "Why Use a Harness?": url = Urls.NewsArticleWhyHarness; break; case "1": url = Urls.AllProductsUrlPgOne; break; case "2": url = Urls.AllProductsUrlPgTwo; break; case "3": url = Urls.AllProductsUrlPgThree; break; case "register": url = Urls.CreateAccount; break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(webPage)); url = null; break; } return(url); }
public void GivenIAccessThePoochwarehousePage(string webPage) { switch (webPage) { case "sale-items": _site.InitialiseChromeDriver(Urls.SaleItemsUrl); break; case "all-products": _site.InitialiseChromeDriver(Urls.AllProductsUrl); break; case "beds-blankets": _site.InitialiseChromeDriver(Urls.BedsBlanketsUrl); break; case "bowls-food": _site.InitialiseChromeDriver(Urls.BowlsFoodUrl); break; case "health-grooming": _site.InitialiseChromeDriver(Urls.HealthGroomingUrl); break; case "collars-leads": _site.InitialiseChromeDriver(Urls.CollarsLeadsUrl); break; case "health-care": _site.InitialiseChromeDriver(Urls.HealthCareUrl); break; case "training": _site.InitialiseChromeDriver(Urls.TrainingUrl); break; case "small-dogs": _site.InitialiseChromeDriver(Urls.SmallDogsUrl); break; case "large-dogs": _site.InitialiseChromeDriver(Urls.LargeDogsUrl); break; case "toys-games": _site.InitialiseChromeDriver(Urls.ToysGamesUrl); break; case "on-the-go": _site.InitialiseChromeDriver(Urls.OnTheGoUrl); break; case "summer-collection": _site.InitialiseChromeDriver(Urls.SummerCollectionUrl); break; case "winter-collection": _site.InitialiseChromeDriver(Urls.WinterCollectionUrl); break; case "login": _site.InitialiseChromeDriver(Urls.LoginUrl); break; case "your-cart": _site.InitialiseChromeDriver(Urls.YourCartUrl); break; case "about-us": _site.InitialiseChromeDriver(Urls.AboutUsUrl); break; case "faq": _site.InitialiseChromeDriver(Urls.FaqUrl); break; case "delivery-shipping": _site.InitialiseChromeDriver(Urls.DeliveryShippingUrl); break; case "returns-policy": _site.InitialiseChromeDriver(Urls.ReturnsPolicyUrl); break; case "privacy-policy": _site.InitialiseChromeDriver(Urls.PrivacyPolicyUrl); break; case "terms-of-use": _site.InitialiseChromeDriver(Urls.TermsOfUseUrl); break; case "contact-us": _site.InitialiseChromeDriver(Urls.ContactUsUrl); break; case "news": _site.InitialiseChromeDriver(Urls.NewsUrl); break; default: Assert.Inconclusive(TestErrorHelper.CaseValueNotRecognised(webPage)); break; } }