public void ValidateAvailabilityIsDisplay() { APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); var manufacturesItems = indexPage.Header.GetManufacturerOptions(); manufacturerOption = manufacturesItems.ElementAtOrDefault(2).webElement.Text; indexPage.Header.SelectManufacturer(manufacturerOption); CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton(); catalogItemPage.AddtoCartbuttonInCatalog(); Thread.Sleep(5000); APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart(); Thread.Sleep(2000); APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut(); Thread.Sleep(2000); IDictionary <string, string> availabiltyItemsTag = checkoutPage.AvailabiltyTagGet(); Assert.IsTrue(availabiltyItemsTag.Count() > 0); }
public void Availability_OutOfStock() { APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); var manufacturesItems = indexPage.Header.GetManufacturerOptions(); manufacturerOption = manufacturesItems.ElementAtOrDefault(2).webElement.Text; indexPage.Header.SelectManufacturer(manufacturerOption); CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton(); catalogItemPage.AddtoCartbuttonInCatalog(); Thread.Sleep(5000); APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart(); Thread.Sleep(2000); APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut(); Thread.Sleep(2000); IDictionary <string, string> availabiltyItemsTag = checkoutPage.AvailabiltyTagGet(); Assert.IsNotNull(availabiltyItemsTag.FirstOrDefault(t => t.Value.Contains(AvailabiltyConstants.OutOfStockGeneral))); }
//[TestMethod] public void TestStatusColor_C1296() { var indexPage = new APIndexPage(Driver); indexPage.Init(Url); var loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); var ordersPage = indexPage.Header.ClickOnOrders(); ordersPage.SetFromDate("09/01/2018"); ordersPage.SetStatus("Shipped"); ordersPage.ClickOnSearchButton(); var orderDetailPage = ordersPage.GoToOrderDetail("51489444-00"); Assert.IsTrue(orderDetailPage.GetStatusColor("#808080"), "shipped status color is not as expected"); ////Now all orders with "processing" status does not have details //Driver.Navigate().Back(); //ordersPage.GoToOrderDetail("51411479-00"); //Assert.IsTrue(orderDetailPage.GetStatusColor("#93c562"), "processing status color is not as expected"); ////Now in the data set, no exist order with "canceled" status //Driver.Navigate().Back(); //ordersPage.GoToOrderDetail("51400472-00"); //Assert.IsTrue(orderDetailPage.GetStatusColor("#FF0006"), "canceled status color is not as expected"); }
public void ValidateOrderTrackingNumbersC1284() { var indexPage = new APIndexPage(Driver); indexPage.Init(Url); var loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); var ordersPage = indexPage.Header.ClickOnOrders(); ordersPage.SetStatus("Shipped"); ordersPage.ClickOnSearchButton(); var orderDetailPage = ordersPage.GoToOrderDetail("51489444-00"); Assert.IsNotNull(orderDetailPage, "order number not found"); Assert.IsTrue(orderDetailPage.TitleExist(), "Order detail title does not exist"); Assert.AreEqual(orderDetailPage.GetTitleText(), "Orders details"); var trackingNumber = orderDetailPage.ValidateTrackingNumbers("782972116483,782972356140"); Assert.IsTrue(string.IsNullOrEmpty(trackingNumber), $"{trackingNumber} is not found"); }
public void ValidateOrderDeatilsTotals_C1330() { var indexPage = new APIndexPage(Driver); indexPage.Init(Url); var loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); var ordersPage = indexPage.Header.ClickOnOrders(); ordersPage.SetStatus("Shipped"); ordersPage.ClickOnSearchButton(); var orderDetailPage = ordersPage.GoToOrderDetail("51489444-00"); Assert.IsNotNull(orderDetailPage, "Given order cannot be found"); Assert.AreEqual("Total Items:", orderDetailPage.GetTotalItemsLabelText(), "Total items label text is not as expected"); Assert.AreEqual("2", orderDetailPage.GetTotalItemsValue(), "Total items value is not as expected"); Assert.AreEqual(orderDetailPage.CountElementTableDetails(), orderDetailPage.GetTotalItemsValue(), "Total items value are different"); Assert.AreEqual("Item Totals", orderDetailPage.GetItemTotalsLabelText(), "Item totals label text is not as expected"); Assert.AreEqual("$51.60", orderDetailPage.GetItemTotalsValue(), "Item totals value is not as expected"); Assert.AreEqual(orderDetailPage.CalculateTableTotal(), orderDetailPage.GetItemTotalsValue(), "ItemsTotal value are different"); Assert.AreEqual("Total", orderDetailPage.GetTotalLabelText(), "Total label text is not as expected"); Assert.AreEqual("$51.60", orderDetailPage.GetTotalValue(), "Total value is not as expected"); Assert.AreEqual(orderDetailPage.GetFinalTotal(), orderDetailPage.GetTotalValue(), "Final totals are different"); }
public void ValidateWODMessage_C1339() { var indexPage = new APIndexPage(Driver); indexPage.Init(Url); var loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); var ordersPage = indexPage.Header.ClickOnOrders(); ordersPage.SetSearchBySelect("Order #"); ordersPage.SetInputForSearchBy("51489444-00"); ordersPage.SetFromDate("01/01/2018"); ordersPage.ClickOnSearchButton(); var orderDetailPage = ordersPage.GoToOrderDetail("51489444-00"); Assert.IsNotNull(orderDetailPage, "Given order cannot be found"); Assert.IsTrue(orderDetailPage.WODMessageExist(), "WOD message does not exist"); Assert.AreEqual(@"Congratulations This invoice received a Whole Order Discount. The Whole Order Discount is applied to the entire order after the contents of the entire order is added up. The discount is reflected in the Order Detail Total but not in the price of each individual line item below. Contact Customer Service if you have any further questions 1-800-332-2500.", orderDetailPage.GetWODMessage(), "WOD Message is incorrect"); Assert.IsTrue(orderDetailPage.HasDiscount(), "There is no discount"); }
public void ShippingSectionIsDisplayed_C1283() { var indexPage = new APIndexPage(Driver); indexPage.Init(Url); var loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); var ordersPage = indexPage.Header.ClickOnOrders(); ordersPage.SetStatus("Shipped"); ordersPage.ClickOnSearchButton(); var orderDetailPage = ordersPage.GoToOrderDetail("51489444-00"); Assert.IsNotNull(orderDetailPage, "order number not found"); Assert.IsTrue(orderDetailPage.TitleExist(), "Order detail title does not exist"); Assert.AreEqual(orderDetailPage.GetTitleText(), "Orders details"); Assert.IsTrue(orderDetailPage.SubtitleExist()); Assert.AreEqual(orderDetailPage.GetSubtitleText(), "Order # 51489444-00"); Assert.IsTrue(orderDetailPage.DetailSubtitleExist(), "Details subtitle does not exist"); Assert.AreEqual(orderDetailPage.GetDetailSubtitleText(), "Details"); Assert.IsTrue(orderDetailPage.ShippingSubtitleExist(), "Shipping subtitle does not exist"); Assert.AreEqual(orderDetailPage.GetShippingSubtitle(), "Shipping", "Shipping subtitle text is not correct"); }
public void ValidateAvailability_Cart_Equals_Checkout() { APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); var manufacturesItems = indexPage.Header.GetManufacturerOptions(); manufacturerOption = manufacturesItems.ElementAtOrDefault(2).webElement.Text; indexPage.Header.SelectManufacturer(manufacturerOption); CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton(); catalogItemPage.AddtoCartbuttonInCatalog(); Thread.Sleep(5000); APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart(); Thread.Sleep(5000); IDictionary <string, string> cartAvailabiltyItemsTag = CartMainPage.AvailabiltyTagGet(); APCheckoutPage checkoutPage = CartMainPage.ProceedToCheckOut(); Thread.Sleep(5000); IDictionary <string, string> checkoutAvailabiltyItemsTag = checkoutPage.AvailabiltyTagGet(); foreach (var tag in checkoutAvailabiltyItemsTag) { Assert.AreEqual(cartAvailabiltyItemsTag[tag.Key], tag.Value); } }
public void NoResultsOnSearchByDate_C1280() { var testData = new { email = TestContext.DataRow["email"].ToString(), password = TestContext.DataRow["password"].ToString(), fromDate = TestContext.DataRow["fromDate"].ToString(), toDate = TestContext.DataRow["toDate"].ToString(), expectedText = TestContext.DataRow["expectedText"].ToString() }; var indexPage = new APIndexPage(Driver); indexPage.Init(Url); var loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testData.email, testData.password); var ordersHome = indexPage.Header.ClickOnOrders(); ordersHome.SetFromDate(testData.fromDate); ordersHome.SetToDate(testData.toDate); ordersHome.ClickOnSearchButton(); Assert.IsTrue(ordersHome.TextWhenNoOrdersExist(), "Message for no results does not exist"); Assert.IsTrue(ordersHome.TextWhenNoOrdersIsCorrect(testData.expectedText), "Message for no results is incorrect"); }
public void AccountSectionNotDisplayed() { var testUser = TestDataFactory.UserWithNoTermsAsPaymentOption(); string term = "40 Net Days, cool Stuff"; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Email, testUser.Password); Assert.IsNotNull(indexPage, "Login failed"); PaymentOptionsHomePage viewPaymentsPage = indexPage.Header.ClickOnPaymentOptions(); bool accountLevelExist = viewPaymentsPage.AccountLevelExist(); Assert.IsFalse(accountLevelExist, "Account section is not hidden as expected"); //check for user: cannot have terms var paymentsInDropdown = viewPaymentsPage.GetPaymentsDropdownItems(AccessLevel.User); string termInDropdown = paymentsInDropdown.FirstOrDefault(item => item.Equals(term)); Assert.IsNull(termInDropdown, "User level cannot have terms"); viewPaymentsPage.Header.ClickOnSignOut(); }
//TODO //pending to done //[TestMethod] public void NavigateThroughMyAccountMenuOptions() { var testUser = DataFactory.Users.CreateTestUser(); APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Username, testUser.Password); //TODO //Account dashboard //Contact information //AddressesHomePage addressesPage = paymentsPage.Header.ClickOnAddresses(); //PaymentOptionsHomePage paymentsPage = indexPage.Header.ClickOnPaymentOptions(); //Password //OrdersHomePage ordersPage = addressesPage.Header.ClickOnOrders(); //Lists //TODO //validations //check page titles }
//[DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\TestData\\C1278.csv", "C1278#csv", DataAccessMethod.Sequential)] //[DeploymentItem("TestData\\C1278.csv")] public void ValidateElementsForSearch_C1278() { var indexPage = new APIndexPage(Driver); indexPage.Init(Url); var loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); var ordersPage = indexPage.Header.ClickOnOrders(); //validate the to date field Assert.IsTrue(ordersPage.ToDateSearchFieldExist(), "to date search does not exist"); //validate the from date field Assert.IsTrue(ordersPage.FromDateSearchFieldExist(), "from date search does not exist"); //validate that the to date displays a datepicker when is clicked Assert.IsTrue(ordersPage.ToDatePickerExist(), "To date picker does not exist in the page"); Assert.IsTrue(ordersPage.FromDatePickerExist(), "From date picker does not exist in the page"); //validate the 'to date' field Assert.IsTrue(ordersPage.ToDateSearchFieldExist(), "to date search doesn't exist"); //validate the button is disabled when the search dates are empty Assert.IsTrue(ordersPage.SearchButtonIsDisabledCorrectly(), "Search button is not disabled when some fields are empty"); }
public void OrdersHasAnOrderNumber_C1256() { var testData = new { email = TestContext.DataRow["email"].ToString(), password = TestContext.DataRow["password"].ToString(), columnName = TestContext.DataRow["columnName"].ToString(), fromDate = TestContext.DataRow["fromDate"].ToString(), toDate = TestContext.DataRow["toDate"].ToString() }; var indexPage = new APIndexPage(Driver); indexPage.Init(Url); var loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testData.email, testData.password); var ordersPage = indexPage.Header.ClickOnOrders(); ordersPage.SetFromDate(testData.fromDate); ordersPage.SetFromDate(testData.toDate); //Validations: //all orders has an order number Assert.IsTrue(ordersPage.AnyColumnHasEmptyValues(testData.columnName), "Theres an empty value"); //logout ordersPage.Header.ClickOnSignOut(); }
public void ClickAllMainOptionsAnonymous() { string expectedLoginPageTitle = "Login"; //string expectedTrackOrderPageTitle = "Track Order"; string expectedQuickOrderPageTitle = "QuickOrder"; string expectedCartPageTitle = "Cart"; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); Assert.AreEqual(expectedLoginPageTitle, Driver.Title); //TODO //TrackOrderPage //Assert QuickOrdersHomePage quickOrderPage = loginPage.Header.ClickOnQuickOrder(); Assert.AreEqual(expectedQuickOrderPageTitle, Driver.Title); APCartPage cartPage = quickOrderPage.Header.ClickOnViewCart(); Assert.AreEqual(expectedCartPageTitle, Driver.Title); }
public void AddItemtoDefaultList() { APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("test", "1234"); manufacturerOption = indexPage.Header.GetManufacturerDropdownOptions().ElementAtOrDefault(2); indexPage.Header.SelectManufacturer(manufacturerOption); CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton(); catalogItemPage.AddtoCartbuttonInCatalog(); Thread.Sleep(5000); APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart(); Thread.Sleep(5000); CartMainPage.ClickAddtoListLink(); CartMainPage.ClickAddtoListButton(); Assert.IsTrue(CartMainPage.SuccessMessageAdded(), "Items was not Added to any List"); CartMainPage.ClickCloseModalLink(); }
//[TestCategory(TestCategoriesConstants.NoTestData)] public void ValidateItemtoInDefaultList() { APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); manufacturerOption = indexPage.Header.GetManufacturerDropdownOptions().ElementAt(2); indexPage.Header.SelectManufacturer(manufacturerOption); CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton(); catalogItemPage.AddtoCartbuttonInCatalog(); Thread.Sleep(5000); APCartPage CartMainPage = catalogItemPage.Header.ClickOnViewCart(); Thread.Sleep(5000); CartMainPage.ClickAddtoListLink(); CartMainPage.ClickAddtoListButton(); PageObjects.ListPOM.HomePagePOM.APListHomePage listPage = CartMainPage.VisitListButton(); Assert.IsTrue(listPage.DefaultTitlePage(), "User was not redirected to List Page"); }
public void CarRefreshSFLANON_T5502() { var indexPage = new APIndexPage(Driver, Url); indexPage.Header.SelectManufacturer(2); CatalogItemsPage catalogItemPage = indexPage.Header.ClickOnSearchButton(); catalogItemPage.AddtoCartbuttonInCatalog(); catalogItemPage.WaitForAppBusy(); APCartPage cartMainPage = catalogItemPage.Header.ClickOnViewCart(); //Move items to Save For Later section cartMainPage.MovetoSFL(); //TODO //wait until save for later section has rendered Thread.Sleep(5000); Assert.IsTrue(cartMainPage.HeadsUpCartInfo(), "Cart is not Empty"); cartMainPage.SeeSFLItems(); Assert.IsTrue(cartMainPage.MovetoCartLinkEnable(), "Save For Later Section is Empty"); }
public void DesignateAccountAddressAsDefault() { var testData = TestDataFactory.UserWithAccountAddress(); APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testData.Email, testData.Password); Assert.IsNotNull(indexPage, "Login failed"); AddressesHomePage addressesHome = indexPage.Header.ClickOnAddresses(); addressesHome.ClickOnAddressInDropdown(AccessLevel.Account, testData.Address); addressesHome.ContentModal.ClickOnMakeDefault(); addressesHome.WaitForAppBusy(); addressesHome.InformationModal.ClickOnClose(); bool defaultLabelExist = addressesHome.IsDefaultLabelPresentOnDropdownItem(AccessLevel.Account); string actualDefaultAddress = addressesHome.GetDefaultTileAddressData(AccessLevel.Account); Assert.IsTrue(defaultLabelExist, "Default label does not exist"); Assert.IsTrue(actualDefaultAddress.Contains(testData.Address.street), $"street not found, {testData.Address.street}"); Assert.IsTrue(actualDefaultAddress.Contains(testData.Address.apartment), $"apartment not found, {testData.Address.apartment}"); Assert.IsTrue(actualDefaultAddress.Contains(testData.Address.country), $"country not found, {testData.Address.country}"); Assert.IsTrue(actualDefaultAddress.Contains(testData.Address.postal), $"postal not found, {testData.Address.postal}"); Assert.IsTrue(actualDefaultAddress.Contains(testData.Address.state), $"state not found, {testData.Address.state}"); bool userTileExist = addressesHome.DefaultTileExist(AccessLevel.User); Assert.IsFalse(userTileExist, "default user level tile is already present"); //addressesHome.Header.ClickOnSignOut(); }
public void AddIntlAddressSetAsDefault() { var testUser = TestDataFactory.CreateLoginAccount(); AddressModel testAddress = new AddressModel { country = "MX", CompanyName = "intl address ;)", street = "calle sexta", state = "Estado de Baja California", city = "Ensenada", postal = "22790", apartment = "12" }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Email, testUser.Password); AddressesHomePage addressesPage = indexPage.Header.ClickOnAddresses(); AddAddressPage addAddressPage = addressesPage.ClickOnAddNewAddress(); string expectedCountry = addAddressPage.GetCurrentCountryValue(); var currentCountries = addAddressPage.GetCountriesFromDropdown().ToList(); addAddressPage.SetInputValue(AddressInputs.Country, testAddress.country); addAddressPage.SetInputValue(AddressInputs.CompanyName, testAddress.CompanyName); addAddressPage.SetInputValue(AddressInputs.State, testAddress.state); addAddressPage.SetInputValue(AddressInputs.Street, testAddress.street); addAddressPage.SetInputValue(AddressInputs.City, testAddress.city); addAddressPage.SetInputValue(AddressInputs.Postal, testAddress.postal); addAddressPage.SetInputValue(AddressInputs.Apartment, testAddress.apartment); addAddressPage.SetCheckboxDefault(); addressesPage = addAddressPage.ClickOnSubmit(); addressesPage.WaitForAppBusy(); addressesPage.InformationModal.ClickOnClose(); addressesPage.WaitForAppBusy(); Thread.Sleep(1000); var dropdownItems = addressesPage.GetAddressesDropdownItems(AccessLevel.User).ToList(); bool defaultLabelExist = addressesPage.IsDefaultLabelPresentOnDropdownItem(AccessLevel.User); string actualDefaultAddress = addressesPage.GetDefaultTileAddressData(AccessLevel.User); //just created address data string createdAddress = FormatAddress(testAddress); string expectedAddress = dropdownItems.FirstOrDefault(x => x.Contains(createdAddress)); bool userLevelTileExist = addressesPage.DefaultTileExist(AccessLevel.User); Assert.IsNotNull(expectedAddress, "The just added address is not found on the dropdown"); Assert.IsTrue(defaultLabelExist, "Default label does not exist"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.street)); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.apartment)); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.country)); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.postal)); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.state)); Assert.IsTrue(userLevelTileExist, "default user level tile is already present"); }
//[TestMethod] public void OrderHistoryWithMoreThan15_C1253_() { var indexPage = new APIndexPage(Driver); indexPage.Init(Url); var loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); var ordersPage = indexPage.Header.ClickOnOrders(); Assert.IsTrue(ordersPage.OrdersTitleExist(), "Orders title does not exist"); Assert.IsTrue(ordersPage.OrdersTitleTextIsCorrect("Orders"), "Orders title is incorrect"); //Validate the default view (31 days) Assert.IsTrue(ordersPage.ValidateDefaultViewIsInRange(31), "Default view is not 31 days"); ordersPage.SetFromDate("10/03/2017"); ordersPage.SetToDate("10/01/2018"); ordersPage.ClickOnSearchButton(); //pagination bar the table has 15 rows per pagination Assert.AreEqual(ordersPage.GetTableRowsCount(), 15, "Table does not has 15 rows per pagination"); //the table has the following headers in the same order Assert.IsTrue(ordersPage.TableHasHeaders("Date,Order #,PO #,Web reference #,Status,Total"), "The table has incorrect headers"); }
public void MyAccountMenuOptionsNavigate() { APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); PaymentOptionsHomePage paymentsPage = indexPage.Header.ClickOnPaymentOptions(); AddressesHomePage addressesPage = paymentsPage.Header.ClickOnAddresses(); OrdersHomePage ordersPage = addressesPage.Header.ClickOnOrders(); ContactInfoHomePage contactInfoPage = ordersPage.Header.ClickOnContactInfo(); //pavito here //TODO: //Fix the dashboard page pls DashboardHomePage dashboardPage = contactInfoPage.Header.ClickOnDashboard(); indexPage = dashboardPage.Header.ClickOnSignOut(); Thread.Sleep(1500); }
public void EditDefaultUserLevelAddress() { var testUser = TestDataFactory.CreateLoginAccount(); AddressModel testData = new AddressModel { CompanyName = "QA Softtek", street = "Street A", apartment = "07", state = "CO", city = "Denver", country = "US", postal = "12345" }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Email, testUser.Password); Assert.IsNotNull(indexPage, "Login failed"); AddressesHomePage addressesPage = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressPage = addressesPage.ClickOnAddNewAddress(); //Fill address form createAddressPage.SetInputValue(AddressInputs.CompanyName, testData.CompanyName); createAddressPage.SetInputValue(AddressInputs.Street, testData.street); createAddressPage.SetInputValue(AddressInputs.Apartment, testData.apartment); createAddressPage.SetInputValue(AddressInputs.City, testData.city); createAddressPage.SetInputValue(AddressInputs.State, testData.state); createAddressPage.SetInputValue(AddressInputs.Postal, testData.postal); addressesPage = createAddressPage.ClickOnSubmit(); addressesPage.WaitForAppBusy(); addressesPage.InformationModal.ClickOnClose(); addressesPage.WaitForAppBusy(); //Start updating the address addressesPage.ClickOnAddressInDropdown(AccessLevel.User, testData); EditAddressPage editAddressPage = addressesPage.ContentModal.ClickOnEdit(); editAddressPage.SetCheckboxDefault(); addressesPage = editAddressPage.ClickOnSubmit(); addressesPage.WaitForAppBusy(); Thread.Sleep(1000); bool defaultLabelExist = addressesPage.IsDefaultLabelPresentOnDropdownItem(AccessLevel.User); string actualDefaultAddress = addressesPage.GetDefaultTileAddressData(AccessLevel.User); Assert.IsTrue(defaultLabelExist, "Default label does not exist"); Assert.IsTrue(actualDefaultAddress.Contains(testData.street)); Assert.IsTrue(actualDefaultAddress.Contains(testData.apartment)); Assert.IsTrue(actualDefaultAddress.Contains(testData.country)); Assert.IsTrue(actualDefaultAddress.Contains(testData.postal)); Assert.IsTrue(actualDefaultAddress.Contains(testData.state)); //addressesPage.Header.ClickOnSignOut(); }
public void ClickOnCart() { APIndexPage indexPage = new APIndexPage(Driver, Url); APCartPage cartPage = indexPage.Header.ClickOnViewCart(); Thread.Sleep(1500); }
public void SelectManufacturerByName() { APIndexPage indexPage = new APIndexPage(Driver, Url); var manufacturers = indexPage.Header.GetManufacturerDropdownOptions(); indexPage.Header.SelectManufacturer(manufacturers.ElementAt(2)); }
public void ClickOnSignInPage() { APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login("*****@*****.**", "1234"); }
public void GetManufacturerOptions() { APIndexPage indexPage = new APIndexPage(Driver, Url); var manufacturerOptions = indexPage.Header.GetManufacturerOptions(); Assert.IsNotNull(manufacturerOptions); }
public void CartEmptyHeadsUpMsg_ANON() { var indexPage = new APIndexPage(Driver, Url); APCartPage cartMainPage = indexPage.Header.ClickOnViewCart(); cartMainPage.ContentHeadsUpInfo(); }
public void DesignateAccountAddressAsDefault() { //test data TestAccountAddress testAddress = new TestAccountAddress { Apartment = "349", City = "Denver", Country = "US", CompanyName = "dfs", Postal = "80019", StateProvinceRegion = "CO", Street = "Walnut street", ExternalIdentifier = nameof(testAddress) + "C1108" }; AddressModel selectedAddress = new AddressModel { apartment = testAddress.Apartment, city = testAddress.City, country = testAddress.Country, CompanyName = testAddress.CompanyName, postal = testAddress.Postal, state = testAddress.StateProvinceRegion, street = testAddress.Street }; //this method is not ready var testUser = DataFactory.Users.CreateTestUser(); APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Username, testUser.Password); AddressesHomePage addressesHome = indexPage.Header.ClickOnAddresses(); addressesHome.ClickOnAddressInDropdown(AccessLevel.Account, selectedAddress); addressesHome.ContentModal.ClickOnMakeDefault(); //TODO //check if busy is present addressesHome.WaitForAppBusy(); addressesHome.InformationModal.ClickOnClose(); bool defaultLabelExist = addressesHome.IsDefaultLabelPresentOnDropdownItem(AccessLevel.Account); string actualDefaultAddress = addressesHome.GetDefaultTileAddressData(AccessLevel.Account); Assert.IsTrue(defaultLabelExist, "Default label does not exist"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.Street), $"street not found, {testAddress.Street}"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.Apartment), $"apartment not found, {testAddress.Apartment}"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.Country), $"country not found, {testAddress.Country}"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.Postal), $"postal not found, {testAddress.Postal}"); Assert.IsTrue(actualDefaultAddress.Contains(testAddress.StateProvinceRegion), $"state not found, {testAddress.StateProvinceRegion}"); bool userTileExist = addressesHome.DefaultTileExist(AccessLevel.User); Assert.IsFalse(userTileExist, "default user level tile is already present"); }
public void DesignateUserAddressAsDefault() { var testUser = DataFactory.Users.CreateTestUser(); AddressModel testData = new AddressModel { country = "US", street = "elm street", city = "elm city", CompanyName = "KDA", postal = "22800", state = "CO" }; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Username, testUser.Password); Assert.IsNotNull(indexPage, "login failed"); AddressesHomePage addressesHome = indexPage.Header.ClickOnAddresses(); AddAddressPage createAddressPage = addressesHome.ClickOnAddNewAddress(); //Fill address form createAddressPage.SetInputValue(AddressInputs.CompanyName, testData.CompanyName); createAddressPage.SetInputValue(AddressInputs.Street, testData.street); createAddressPage.SetInputValue(AddressInputs.City, testData.city); createAddressPage.SetInputValue(AddressInputs.State, testData.state); createAddressPage.SetInputValue(AddressInputs.Postal, testData.postal); addressesHome = createAddressPage.ClickOnSubmit(); addressesHome.InformationModal.ClickOnClose(); addressesHome.ClickOnAddressInDropdown(AccessLevel.User, testData); addressesHome.ContentModal.ClickOnMakeDefault(); //TODO //check if busy is present addressesHome.WaitForAppBusy(); addressesHome.InformationModal.ClickOnClose(); bool defaultLabelExist = addressesHome.IsDefaultLabelPresentOnDropdownItem(AccessLevel.User); string actualDefaultAddress = addressesHome.GetDefaultTileAddressData(AccessLevel.User); Assert.IsTrue(defaultLabelExist, "Default label does not exist"); Assert.IsTrue(actualDefaultAddress.Contains(testData.street)); Assert.IsTrue(actualDefaultAddress.Contains(testData.country)); Assert.IsTrue(actualDefaultAddress.Contains(testData.postal)); Assert.IsTrue(actualDefaultAddress.Contains(testData.state)); bool accountTileExist = addressesHome.DefaultTileExist(AccessLevel.Account); Assert.IsFalse(accountTileExist, "default account level tile is already present"); }
public void CheckPhoneNumber() { string expectedPhoneNumber = "1.800.332.2500"; APIndexPage homePage = new APIndexPage(Driver, Url); string actualPhoneNumber = homePage.Header.GetPhoneNumber(); Assert.AreEqual(expectedPhoneNumber, actualPhoneNumber); }