public void ManageOrdersUITest() { test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Verify UI elements in manage users page"); var LoginPage = new LoginPage(); var ManageOrders = new ManageOrdersPage(); LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle); BasicMethods.ClickBtn(ManageOrders.ManageOrdersTab); Validations.validateTitle("Manage Orders - Chemical Ordering Tool"); Validations.validateScreenByUrl("http://cos-test.psr.rd.hpicorp.net/COSWeb/ManageOrder/ManageOrder"); Validations.validateElementIsEnabled(ManageOrders.HideShowBtn); Validations.validateElementIsPresent(ManageOrders.ExportToExcelBtn); Validations.validateElementIsPresent(ManageOrders.ManageOrderStatusBtn); BasicMethods.VerifyText(ManageOrders.ManageOrderTableHeader, "Actions Order No Requester Cost Center Requested Date Material Name Supplier Name Cost Quantity Is New Msds Status"); BasicMethods.VerifyText(ManageOrders.PendingForApprovalStatus, "Status: Pending For Approval"); BasicMethods.VerifyText(ManageOrders.WaitingforMSDSStatus, "Status: Waiting for MSDS"); BasicMethods.VerifyText(ManageOrders.RejectedStatus, "Status: Rejected"); BasicMethods.VerifyText(ManageOrders.OrderedStatus, "Status: Ordered"); BasicMethods.VerifyText(ManageOrders.ClosedStatus, "Status: Closed"); BasicMethods.VerifyText(ManageOrders.ApprovedStatus, "Status: Approved"); BasicMethods.ClickBtn(ManageOrders.WithFilterExpandButton); BasicMethods.VerifyPartialText(ManageOrders.ManageOrderTableRow, "Approved"); BasicMethods.ClickBtn(ManageOrders.HideShowBtn); ManageOrders.Testcheckbox(); }
public void SortFunc(IWebElement element, IWebElement firstrow, string ascendingmsg, string descendingmsg) { element.Click(); Console.WriteLine("Descending Order"); BasicMethods.VerifyPartialText(firstrow, descendingmsg); element.Click(); Console.WriteLine("Ascending Order"); BasicMethods.VerifyPartialText(firstrow, ascendingmsg); }
public void SearchUserFunctionalityTest() { test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Test search user functionality"); var LoginPage = new LoginPage(); var ManageUser = new ManageUsersPage(); LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle); ManageUser.SelectManageUsersTab(); Validations.validateTitle("Manage Users - Chemical Ordering Tool"); ManageUser.SearchUser(ManageUser.SearchTextBox, "Navaneeth"); BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "Admin [email protected] Navaneetha Krishnan true"); }
public void UserRoleFieldValidation() { test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Test with the available options in user role field"); var LoginPage = new LoginPage(); var ManageUser = new ManageUsersPage(); LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle); ManageUser.EditUserFunc("kumaresh", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "Kumaresh", ManageUser.LastNameField, "Govindan", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); ManageUser.SearchUser(ManageUser.SearchTextBox, "*****@*****.**"); BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "Admin [email protected]"); ManageUser.EditUserFunc("kumaresh", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 0, ManageUser.FirstNameField, "Kumaresh", ManageUser.LastNameField, "Govindan", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); ManageUser.SearchUser(ManageUser.SearchTextBox, "*****@*****.**"); BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "Requester [email protected]"); ManageUser.EditUserFunc("kumaresh", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Kumaresh", ManageUser.LastNameField, "Govindan", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); ManageUser.SearchUser(ManageUser.SearchTextBox, "*****@*****.**"); BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "EHSManager [email protected]"); }
public void EditUserFirstNameFieldErrorValidation() { test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Error validation in firstname field in EditUser popup message"); var LoginPage = new LoginPage(); var ManageUser = new ManageUsersPage(); LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle); ManageUser.EditUserFunc("kumaresh", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "", ManageUser.LastNameField, "Govindan", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); BasicMethods.VerifyText(ManageUser.firstnameerrormsg, "First Name should not be empty."); ManageUser.EditUserFunc("kumaresh", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "****", ManageUser.LastNameField, "Govindan", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); BasicMethods.VerifyText(ManageUser.firstnameerrormsg, "First Name should not contain anything except letters and spaces."); ManageUser.EditUserFunc("kumaresh", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "K", ManageUser.LastNameField, "Govindan", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); ManageUser.SearchUser(ManageUser.SearchTextBox, "kumaresh"); BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "K Govindan"); ManageUser.EditUserFunc("kumaresh", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Kumaresh ", ManageUser.LastNameField, "Govindan", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); ManageUser.SearchUser(ManageUser.SearchTextBox, "kumaresh"); BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "Kumaresh "); }
public void EditUserLastNameFieldErrorValidation() { test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Error validation in lastname field in EditUser popup message"); var LoginPage = new LoginPage(); var ManageUser = new ManageUsersPage(); LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle); ManageUser.EditUserFunc("durga", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Durga", ManageUser.LastNameField, "", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); BasicMethods.VerifyText(ManageUser.lastnameerrormsg, "Last Name should not be empty."); ManageUser.EditUserFunc("durga", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Durga", ManageUser.LastNameField, "$$$$@#@", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); BasicMethods.VerifyText(ManageUser.lastnameerrormsg, "Last Name should not contain anything except letters and spaces."); ManageUser.EditUserFunc("durga", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Durga", ManageUser.LastNameField, "Prasad", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); ManageUser.SearchUser(ManageUser.SearchTextBox, "Durga"); BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "Durga Prasad"); ManageUser.EditUserFunc("durga", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Durga", ManageUser.LastNameField, "Prasad Palukuri ", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); ManageUser.SearchUser(ManageUser.SearchTextBox, "Durga"); BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "Durga Prasad Palukuri "); ManageUser.EditUserFunc("durga", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "Durga", ManageUser.LastNameField, "**** ", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn); BasicMethods.VerifyText(ManageUser.userEmailErrorMsg, "Please enter a valid HP Email Id."); BasicMethods.VerifyText(ManageUser.lastnameerrormsg, "Last Name should not contain anything except letters and spaces."); }
public void CreateOrderUsingLinkTest() { test = extent.CreateTest("CreateOrderUsingLinkTest", "Test includes ordering chemical using chemical order request link in home page"); var NOrderPage = new NewOrderPage(); var HomePage = new HomePage(); var LoginPage = new LoginPage(); LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle); BasicMethods.ClickBtn(HomePage.COTLink); Thread.Sleep(3000); NOrderPage.InputCostCenter(NOrderPage.OrderPageCostCenter, "10"); NOrderPage.VerifyRequester(NOrderPage.OrderPageRequester); NOrderPage.VerifyRequestedDate(NOrderPage.OrderPageRequestedDate); NOrderPage.InputMaterialName(NOrderPage.OrderPageMaterialName, "Material-Name2"); NOrderPage.InputSupplierName(NOrderPage.OrderPageSupplierName, "Supplier-Name2"); NOrderPage.InputMSDS(NOrderPage.MSDS, "C:\\Users\\devaraju\\Desktop\\pdf-sample.pdf"); Thread.Sleep(5000); NOrderPage.AddBtn.ClickBtn(); NOrderPage.CASInput(NOrderPage.CAS, "123-23-2345"); NOrderPage.SupplierPhoneInput(NOrderPage.SupplierPhone, "121"); NOrderPage.SupplierURLInput(NOrderPage.SupplierURL, "https://google.co.in"); NOrderPage.MaterialURLInput(NOrderPage.MaterialURL, "https://google.co.in"); NOrderPage.ProductNumberInput(NOrderPage.ProductNumber, "Product012"); NOrderPage.ContactNameInput(NOrderPage.ContactName, "AutoUser4"); NOrderPage.ContactEmailInput(NOrderPage.ContactEmail, "*****@*****.**"); NOrderPage.ContactPhoneInput(NOrderPage.ContactPhone, "103"); NOrderPage.QuantityInput(NOrderPage.OrderPageQuantity, "20"); NOrderPage.selectQtyUnit(NOrderPage.QuantityUnit, NOrderPage.DDLQtyUnit, 5); NOrderPage.CostInput(NOrderPage.OrderPageCost, "200"); NOrderPage.SelectCostPerUnit(NOrderPage.CostPerUnit, NOrderPage.DDLCostUnit, 5); NOrderPage.InputDateNeeded(NOrderPage.DateNeeded, "2018/6/30"); NOrderPage.SelectCopyTo("Farzaneh Barmaki"); NOrderPage.SelectCopyTo("David Espinoza"); NOrderPage.InputComments(NOrderPage.Comments, "OrderLinkTestinHomePage"); NOrderPage.SubmitOrderBtn(); BasicMethods.ClickBtn(HomePage.HomeTab); BasicMethods.VerifyText(HomePage.TableHeader, "Request Number Material Name Requested Date Quantity Date Needed"); BasicMethods.VerifyPartialText(HomePage.FirstRow, "Material-Name2"); }
public void ShowFilter(IWebElement element, string value, IWebElement showfilterelement, string msg) { //element.Click(); BasicMethods.SelectDropdown(element, value); BasicMethods.VerifyPartialText(showfilterelement, msg); }