public void TestAllHeaderNavigation() { NavigationActions.NavigateLiveBetterOverviewClick(); NavigationActions.NavigateLiveBetterHealthyFamilyClick(); NavigationActions.NavigateLiveBetterActiveLifestyleClick(); NavigationActions.NavigateLiveBetterFeelGoodLookGoodClick(); NavigationActions.NavigateLiveBetterOneSimpleChangeClick(); NavigationActions.NavigateOurProductsOverViewClick(); NavigationActions.NavigateOurProductsCapsulesClick(); NavigationActions.NavigateOurProductsChewablesClick(); NavigationActions.NavigateOurProductsOmegaClick(); NavigationActions.NavigateOurProductsCompleteClick(); NavigationActions.NavigateOurProductsUpliftClick(); NavigationActions.NavigateOurProductsWhatIsJuicePlusClick(); NavigationActions.NavigateOurCommunityOverviewClick(); NavigationActions.NavigateOurCommunityBlogClick(); NavigationActions.NavigateOurCommunityGivingBackClick(); //NavigationActions.NavigateOurCommunityGoBeyondClick(); NavigationActions.NavigateJoinUsClick(); NavigationActions.NavCartIconClick(); NavigationActions.NavLoginButtonClick(); }
public static void AddBerryCapsuleToCart() { WebDriverWait waitForElement = new WebDriverWait(Driver.WebDriver, TimeSpan.FromSeconds(30)); NavigationHeaderPageObjects nav = new NavigationHeaderPageObjects(); CapsulesPageObjects caps = new CapsulesPageObjects(); LandingPageObjects lan = new LandingPageObjects(); CapsulesOrderPageObjects cpo = new CapsulesOrderPageObjects(); CartPageObjects carp = new CartPageObjects(); try { NavigationActions.NavigateOurProductsCapsulesClick(); try { Assert.IsFalse(Driver.WebDriver.PageSource.Contains("£")); // Assert.IsTrue(Driver.WebDriver.PageSource.Contains("€")); } catch (Exception e) { Console.WriteLine(e);; } Thread.Sleep(1000); lan.CookieAlertAcceptButton.Click(); caps.ClickBerryCapsuleShopNow(); try { Assert.IsTrue(Driver.WebDriver.PageSource.Contains("Berry")); } catch (Exception e) { Console.WriteLine(e);; } caps.ScrollViewport(); var NumOfProducts = cpo.NumOfProductOrderCapsules.GetAttribute("value"); try { Assert.That(NumOfProducts, Is.EqualTo("1")); } catch (Exception e) { Console.WriteLine(e); } cpo.IncrementArrowOrderCapsules.Click(); var incrProductCount = cpo.NumOfProductOrderCapsules.GetAttribute("value"); Thread.Sleep(500); try { Assert.That(incrProductCount, Is.EqualTo("2")); } catch (Exception e) { Console.WriteLine(e); } cpo.DecrementArrowOrderCapsules.Click(); var decrProductCount = cpo.NumOfProductOrderCapsules.GetAttribute("value"); try { Assert.That(decrProductCount, Is.EqualTo("1")); } catch (Exception e) { Console.WriteLine(e); } cpo.AddToCartOrderCapsules.Click(); Thread.Sleep(1000); var NumInCart = nav.CartIconCounter.Text; Console.WriteLine(NumInCart); Thread.Sleep(1000); try { Assert.That(NumInCart, Is.EqualTo("1")); } catch (Exception e) { Console.WriteLine(e);; } nav.CartIconCounter.Click(); waitForElement.Until(ExpectedConditions.ElementIsVisible(By.CssSelector(".m-icon-badge__counter"))); nav.CheckoutButton.Click(); carp.NavigateToProceedToCheckoutAndClick(); } catch (ArgumentException e) { Console.WriteLine(e); } }