public void GivenIAmLoggedIntoTheMOLSite() { overviewPage = new LoginPage(DriverFactory.Driver).Login(ScenarioContextData.Current.Username, ScenarioContextData.Current.Password); ScenarioContextData.Current.CurrentMemberPage = overviewPage; overviewPage.PrintCookies(); overviewPage.RefreshBalanceIfNeeded(5); }
public void Setup() { //To open the browser browserDriver = new ChromeDriver(); //Go to the website browserDriver.Navigate().GoToUrl("https://www.saucedemo.com/"); //Maximize the navigator browserDriver.Manage().Window.Maximize(); //Login first LoginPage loginPage = new LoginPage(browserDriver); //**Test cases for every user with correct password loginPage.Login("standard_user", "secret_sauce"); //loginPage.Login("locked_out_user", "secret_sauce"); //loginPage.Login("problem_user", "secret_sauce"); //loginPage.Login("performance_glitch_user", "secret_sauce"); //loginPage.Login(" ", "secret_sauce"); //**Test cases for any user with a wrong password //loginPage.Login("standard_user", "secret_password"); //loginPage.Login("standard_user", " "); //Adding six items to the cart InventoryPage inventoryPage = new InventoryPage(browserDriver); var i = 0; do { inventoryPage.ClickAddToCart(); i++; } while (i < 6); //Verify cart button and click it Assert.That(inventoryPage.CartButtonExist, Is.True); inventoryPage.Cart(); //Verify Checkout button and click it CartPage cartPage = new CartPage(browserDriver); Assert.That(cartPage.CheckoutButtonExist, Is.True); cartPage.Checkout(); PersonalInfoPage personalInfoPage = new PersonalInfoPage(browserDriver); personalInfoPage.Continue("MyName", "MySurname", "SLM911"); OverviewPage overviewPage = new OverviewPage(browserDriver); overviewPage.Finish(); }
public void PersonalInfo() { PersonalInfoPage personalInfoPage = new PersonalInfoPage(browserDriver); //Positive Case personalInfoPage.Continue("Jorge", "Acosta", "SLM911"); //Negative Cases //personalInfoPage.Continue("", "MySurname", "SLM911"); //personalInfoPage.Continue("MyName", "", "SLM911"); //personalInfoPage.Continue("MyName", "MySurname", ""); OverviewPage overviewPage = new OverviewPage(browserDriver); Assert.That(overviewPage.CheckoutSummaryExist, Is.True); }
public void ThenICanSeeMyBalanceSummaryOnTheOverviewPage() { overviewPage = (OverviewPage)ScenarioContextData.Current.CurrentMemberPage; var isDbdWithAccumBalance = ScenarioContextData.Current.AccountType.StartsWith("Defined") && !apiBalancesDetails.AccumulationAmount.Equals("$0.00"); var balances = overviewPage.GetBalanceData(isDbdWithAccumBalance); Assert.That(balances.AccountBalanceAmount, Is.EqualTo(apiBalancesDetails.AccountBalanceAmount), "Account Balances doesn't match"); if (isDbdWithAccumBalance) { Assert.That(balances.AccumulationAmount, Is.EqualTo(apiBalancesDetails.AccumulationAmount), "Accumulation Balances doesn't match"); Assert.That(balances.DefinedBenefitAmount, Is.EqualTo(apiBalancesDetails.DefinedBenefitAmount), "DBD Balances doesn't match"); } Assert.That(overviewPage.GetAccountBalanceEffectiveDate(), Is.EqualTo(apiBalanceEffectiveDate.ToString("dd MMMM yyyy")), "Account Balance Effective Date doesn't match"); }
public OverviewSteps(OverviewPage overviewPage) { this.overviewPage = overviewPage; }
public void WhenINavigateToTheOverviewPage() { overviewPage = ScenarioContextData.Current.CurrentMemberPage.GoToOverviewPage(); ScenarioContextData.Current.CurrentMemberPage = overviewPage; }
private void changePage(string page) { if (object.Equals(FrameSource, null).Equals(false)) { if (FrameSource.GetType().Equals(typeof(LteInfoPage))) { LteInfoModel lte = Application.Current.FindResource("LteInfoModel") as LteInfoModel; lte.StopTimer(); } if (FrameSource.GetType().Equals(typeof(DslPage))) { DslPageModel dsl = Application.Current.FindResource("DslPageModel") as DslPageModel; dsl.StopTimer(); } } if (page.Equals("login")) { FrameSource = new LoginPage(); } else if (page.Equals("status")) { FrameSource = new StatusPage(); } else if (page.Equals("overview")) { FrameSource = new OverviewPage(); } else if (page.Equals("dsl")) { FrameSource = new DslPage(); } else if (page.Equals("lte")) { FrameSource = new LteInfoPage(); } else if (page.Equals("syslog")) { FrameSource = new SyslogPage(); } else if (page.Equals("tr181")) { FrameSource = new TR181Page(); } else if (page.Equals("phone")) { FrameSource = new PhonePage(); } else if (page.Equals("lan")) { FrameSource = new LanPage(); } else if (page.Equals("interface")) { FrameSource = new InterfacePage(); } else if (page.Equals("controls")) { FrameSource = new ControlsPage(); } else if (page.Equals("about")) { FrameSource = new AboutPage(); } changeColor(page); }