public void Register() { var homePage = registerPage.RegisterApplication("automattion122345677788999", "automation8888"); var expectedResult = new AlertsType().SignUpSuccessfullAlert; //var expectedResult = "Sign up successful."; var actualResult = registerPage.GetAlertText(); Assert.AreEqual(expectedResult, actualResult); }
public void RegisterWithUserAlreadyInDatabase() { var homePage = registerPage.RegisterApplication("automation8888", "automation8888"); var expectedResult = new AlertsType().UserAlreadyExistsAlert; //var expectedResult = "This user already exist."; var actualResult = registerPage.GetAlertText(); Assert.AreEqual(expectedResult, actualResult); }
public void Login_CorrectUsername_IncorrectPassword() { var homePage = loginPage.LoginApplication("*****@*****.**", "automationnn"); var expectedResult = new AlertsType().WrongPasswordAlert; //var expectedResult = "Wrong password."; var actualResult = loginPage.GetAlert(); Assert.AreEqual(expectedResult, actualResult); }
public void ShouldSendMessageFromContactPage() { var homePage = loginPage.LoginApplication("*****@*****.**", "automation"); contactPage = homePage.loggedInMenuItemControl.NavigateToContactPage(); contactPage.SetMessage(new AddContactElements()); var expectedResult = new AlertsType().MessageSentSuccessfully; var actualResult = contactPage.GetAlert(); Assert.AreEqual(expectedResult, actualResult); }
public void Should_Add_Product_And_Get_Order_Page() { var homePage = loginPage.LoginApplication("*****@*****.**", "automation"); productPage = homePage.loggedInMenuItemControl.SelectProductAndNavigateToProductPage(NewPhone); TotalAmount = productPage.AddProduct(); var expectedResult = new AlertsType().ProductAddedSuccessfully; var actualResult = productPage.GetAlert(); Assert.AreEqual(expectedResult, actualResult); cartPage = homePage.loggedInMenuItemControl.NavigateToCart(); Assert.IsTrue(cartPage.IsProductAddedToCart(NewPhone.ProductName)); orderPage = cartPage.PlaceOrder(); Assert.IsTrue(orderPage.IsWindowOpened()); }
public void Should_Delete_Product() { int TotalAmount = 0; var homePage = loginPage.LoginApplication("*****@*****.**", "automation"); productPage = homePage.loggedInMenuItemControl.SelectProductAndNavigateToProductPage(NewMonitor); TotalAmount = productPage.AddProduct(); var expectedResult = new AlertsType().ProductAddedSuccessfully; var actualResult = productPage.GetAlert(); Assert.AreEqual(expectedResult, actualResult); cartPage = homePage.loggedInMenuItemControl.NavigateToCart(); Assert.IsTrue(cartPage.IsProductAddedToCart(NewNotebook.ProductName)); cartPage.DeleteProduct(); Assert.IsTrue(cartPage.IsProductRemovedFromCart(NewNotebook.ProductName)); Assert.IsFalse(cartPage.IsTotalorderVisible()); }
public void DidNotFillRequiredFieldOfOrderPage() { var homePage = loginPage.LoginApplication("*****@*****.**", "automation"); productPage = homePage.loggedInMenuItemControl.SelectProductAndNavigateToProductPage(NewPhone); TotalAmount = productPage.AddProduct(); var expectedResult = "Product added."; var actualResult = productPage.GetAlert(); Assert.AreEqual(expectedResult, actualResult); cartPage = homePage.loggedInMenuItemControl.NavigateToCart(); Assert.AreEqual(expectedResult, actualResult); orderPage = cartPage.PlaceOrder(); orderPage.submitOrderPage(); var expectedResult2 = new AlertsType().EnterRequiredFields; var actualResult2 = orderPage.GetAlert(); Assert.AreEqual(expectedResult2, actualResult2); }
public void Should_Add_Products_To_Cart_Successfully() { var homePage = loginPage.LoginApplication("*****@*****.**", "automation"); var productList = GenerateProductList(NewNotebook, NewPhone); foreach (var product in productList) { productPage = homePage.loggedInMenuItemControl.SelectProductAndNavigateToProductPage(product); TotalAmount += productPage.AddProduct(); var expectedResult = new AlertsType().ProductAddedSuccessfully; var actualResult = productPage.GetAlert(); Assert.AreEqual(expectedResult, actualResult); cartPage = homePage.loggedInMenuItemControl.NavigateToCart(); Assert.IsTrue(cartPage.IsProductAddedToCart(product.ProductName)); //verificare daca suma totala corespunde Assert.AreEqual(TotalAmount, cartPage.GetTotalPrice); homePage.loggedInMenuItemControl.NavigateToHomePage(); } }
public static void ShowAlerts(AlertsType AlertsType, string AlertsText) { Alerts.AlertType = AlertsType; Alerts.AlertText = AlertsText; }