示例#1
0
文件: HomePage.cs 项目: ushade/Dart
 public void TestMainTabs(IWebElement element, string title)
 {
     BasicMethods.ClickBtn(element);
     Thread.Sleep(300);
     Validations.validateTitle(title);
     BasicMethods.ClickBtn(HomeBtn);
 }
示例#2
0
        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();
        }
示例#3
0
        public void ActiveUserTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "ActiveUserTest");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();
            var HomePage   = new HomePage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.IsActiveUserTrueTest("durga", ManageUser.UserEmailTextBox, "*****@*****.**");
            Validations.validateTitle("Manage Users - Chemical Ordering Tool");
            BasicMethods.ClickBtn(HomePage.LogOffBtn);
            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "Lost4now", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
        }
示例#4
0
        public void Testcase2()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Test Hide/Show functionality");
            var LoginPage    = new LoginPage();
            var ManageOrders = new ManageOrdersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            BasicMethods.ClickBtn(ManageOrders.ManageOrdersTab);
            BasicMethods.ClickBtn(ManageOrders.HideShowBtn);
            ManageOrders.Testcheckbox();
            //ManageOrders.HideShowFuncTest();
            // ManageOrders.HideShowFuncTest();
            Console.WriteLine("Expected text" + "\t" + ManageOrders.Table.Text);
        }
示例#5
0
文件: HomePage.cs 项目: ushade/Dart
        public void TestThirdPartyToolsLink(IWebElement element, string title)
        {
            string BaseWindow = DriverUtils.driver.CurrentWindowHandle;

            BasicMethods.ClickBtn(element);
            //switch to new window.
            DriverUtils.driver.SwitchTo().Window(DriverUtils.driver.WindowHandles.Last());
            Thread.Sleep(3000);
            DriverUtils.driver.Manage().Window.Maximize();
            Validations.validateTitle(title);
            DriverUtils.driver.Close();
            //if you want to switch back to your first window
            DriverUtils.driver.SwitchTo().Window(DriverUtils.driver.WindowHandles.First());
            Console.WriteLine("In home page now");
        }
示例#6
0
        public void InActiveUserTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Inactive user test");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();
            var HomePage   = new HomePage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.IsActiveUserFalseTest("durga", ManageUser.UserEmailTextBox, "*****@*****.**");
            Validations.validateTitle("Manage Users - Chemical Ordering Tool");
            BasicMethods.ClickBtn(HomePage.LogOffBtn);
            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "Lost4now", LoginPage.LoginInBtn, LoginPage.Welcometitle);
            BasicMethods.VerifyText(LoginPage.BlankErrorMsg, "Sorry, you are not an active user for this website.");
            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.IsActiveUserTrueTest("durga", ManageUser.UserEmailTextBox, "*****@*****.**");
        }
示例#7
0
        public void ContactPageRegressionTest()
        {
            test = extent.CreateTest("ContactPageRegressionTest", "Test includes verification of Contact Person and COT support details and validates the URL and Title");
            var LoginPage   = new LoginPage();
            var HomePage    = new HomePage();
            var ContactPage = new ContactUsPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            log.Info("Logged in Successfully");
            BasicMethods.ClickBtn(ContactPage.ContactTab);
            log.Info("In Contact Page - Test Passed");
            Validations.validateScreenByUrl("http://cos-test.psr.rd.hpicorp.net/COSWeb/Home/Contact");
            Validations.validateTitle("Contact - Chemical Ordering Tool");
            BasicMethods.VerifyText(ContactPage.COTContactPerson, "For questions regarding COS process or permissions, please contact - Farzaneh Barmaki([email protected])");
            BasicMethods.VerifyText(ContactPage.COTSupport, "To report COS database technical issues, please contact - COT Support ([email protected])");
            BasicMethods.ClickBtn(HomePage.LogOffBtn);
        }
示例#8
0
        public void AboutPageUITest()
        {
            test = extent.CreateTest("AboutPageRegressionTest", "Test includes verification of UI elements in About Page");
            var LoginPage = new LoginPage();
            var HomePage  = new HomePage();
            var AboutPage = new AboutPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            BasicMethods.ClickBtn(AboutPage.AboutTab);
            log.Info("In About Page Screen");
            BasicMethods.ClickBtn(AboutPage.ReleaseNotesTab);
            AboutPage.VerifyReleaseNotes();
            log.Info("clicked ReleaseNotes Tab");
            BasicMethods.ClickBtn(AboutPage.UserManualTab);
            //AboutPage.VerifyUserManual();
            log.Info("Clicked UserManual");
            BasicMethods.ClickBtn(HomePage.LogOffBtn);
        }
示例#9
0
        public void CreateOrderForExistingRawMaterialTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Functionality to test new chemcial order with an empty MSDS");
            var LoginPage  = new LoginPage();
            var HomePage   = new HomePage();
            var NOrderPage = new NewOrderPage();

            BasicMethods.CheckImage(LoginPage.HPLogo);
            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            NOrderPage.OrderTab.ClickBtn();
            NOrderPage.VerifyRequester(NOrderPage.OrderPageRequester);
            NOrderPage.VerifyRequestedDate(NOrderPage.OrderPageRequestedDate);
            NOrderPage.InputMaterialName(NOrderPage.OrderPageMaterialName, "Succinic Acid");
            BasicMethods.ClickBtn(NOrderPage.MaterialSearchBtn);
            Thread.Sleep(3000);
            BasicMethods.VerifyText(NOrderPage.FirstRowText, "Succinic acid");
            NOrderPage.FirstRowText.Click();
            Thread.Sleep(3000);
            Validations.validateTextInTextBox(NOrderPage.OrderPageSupplierName, "SIGMA-ALDRICH");
            Validations.validateTextInTextBox(NOrderPage.OrderPageMSDSUpload, "037925.pdf");
            BasicMethods.ClickBtn(NOrderPage.AddBtn);
            BasicMethods.VerifyText(NOrderPage.MaterialNameLabel, "Succinic acid");
            BasicMethods.VerifyText(NOrderPage.SupplierNameLabel, "SIGMA-ALDRICH");
            Validations.validateElementIsPresent(NOrderPage.MSDSPreviewLink);
            NOrderPage.CASInput(NOrderPage.CAS, "TA-CAS10");
            NOrderPage.SupplierPhoneInput(NOrderPage.SupplierPhone, "543456780");
            NOrderPage.SupplierURLInput(NOrderPage.SupplierURL, "https://google.co.in");
            NOrderPage.MaterialURLInput(NOrderPage.MaterialURL, "https://google.co.in");
            NOrderPage.ProductNumberInput(NOrderPage.ProductNumber, "Prod1");
            NOrderPage.ContactNameInput(NOrderPage.ContactName, "AutoUser5");
            NOrderPage.ContactEmailInput(NOrderPage.ContactEmail, "*****@*****.**");
            NOrderPage.ContactPhoneInput(NOrderPage.ContactPhone, "104789");
            NOrderPage.QuantityInput(NOrderPage.OrderPageQuantity, "5");
            NOrderPage.selectQtyUnit(NOrderPage.QuantityUnit, NOrderPage.DDLQtyUnit, 5);
            NOrderPage.CostInput(NOrderPage.OrderPageCost, "100");
            NOrderPage.SelectCostPerUnit(NOrderPage.CostPerUnit, NOrderPage.DDLCostUnit, 3);
            NOrderPage.InputDateNeeded(NOrderPage.DateNeeded, "2018/7/25");
            NOrderPage.SelectCopyTo("Farzaneh Barmaki");
            NOrderPage.SelectCopyTo("David Espinoza");
            NOrderPage.InputComments(NOrderPage.Comments, "Order Request for Existing Chemical");
            NOrderPage.SubmitOrderBtn();
        }
示例#10
0
        public void HomepageUITest()
        {
            test = extent.CreateTest("HomepageUITest", "Test includes verification of UI elements in Home Page");
            var LoginPage    = new LoginPage();
            var HomePage     = new HomePage();
            var ContactPage  = new ContactUsPage();
            var AboutPage    = new AboutPage();
            var NOrderPage   = new NewOrderPage();
            var ManageUser   = new ManageUsersPage();
            var ManageOrders = new ManageOrdersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            BasicMethods.ClickBtn(HomePage.HomeTab);
            log.Info("In Home Page Screen");
            //  BasicMethods.GetLocation(HomePage.COTLink);
            // BasicMethods.GetSize(HomePage.COTLink);
            Validations.validateTitle("Home - Chemical Ordering Tool");
            BasicMethods.CheckImage(HomePage.HomePageMyLogo);
            BasicMethods.checkWebsite();
            BasicMethods.VerifyText(HomePage.COTBanner1, "Welcome To The");
            BasicMethods.VerifyText(HomePage.COTBanner2, "Chemical Ordering Tool");
            BasicMethods.VerifyText(HomePage.Last10RequestsHeader, "Last 10 Requests");
            HomePage.TestThirdPartyToolsLink(HomePage.DolphinBtn, "Comply Plus");
            HomePage.TestThirdPartyToolsLink(HomePage.SigmaAldrichBtn, "MilliporeSigma | United States");
            HomePage.TestThirdPartyToolsLink(HomePage.FedexBtn, "Tracking | FedEx Canada");
            HomePage.TestThirdPartyToolsLink(HomePage.FisherScientificBtn, "Fisher Scientific: Lab Equipment and Supplies");
            HomePage.TestThirdPartyToolsLink(HomePage.GoogleSearchBtn, "Google");
            HomePage.TestThirdPartyToolsLink(HomePage.ClassWWToolBtn, "WW-Class - Classification Online Request Form");
            HomePage.TestMainTabs(NOrderPage.OrderTab, "Order Request - Chemical Ordering Tool");
            HomePage.TestMainTabs(ManageOrders.ManageOrdersTab, "Manage Orders - Chemical Ordering Tool");
            ManageUser.SelectManageUsersTab();
            BasicMethods.ClickBtn(HomePage.HomeBtn);
            HomePage.TestMainTabs(HomePage.HomeTab, "Home - Chemical Ordering Tool");
            HomePage.TestMainTabs(AboutPage.AboutTab, "About - Chemical Ordering Tool");
            HomePage.TestMainTabs(ContactPage.ContactTab, "Contact - Chemical Ordering Tool");
            HomePage.TestThirdPartyToolsLink(HomePage.ChemicalWasteCollectionRequestFormLink, "HP San Diego - Chemical Waste Collection and Container Request Form - Formstack");
            HomePage.TestThirdPartyToolsLink(HomePage.InkChemicalRequestFormLink, "HP San Diego - Ink Pour, Chemical, Gas, Nitrogen Request Form - Formstack");
            HomePage.TestThirdPartyToolsLink(HomePage.ReturnToStockFormLink, "HP San Diego - Return to Stock or Scrap Form - Formstack");
            HomePage.TestThirdPartyToolsLink(HomePage.InventoryRequestFormLink, "HP San Diego - Inventory Request Form - Formstack");
        }
示例#11
0
        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");
        }
示例#12
0
        public void OrderPageErrorValidationTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Order Page UI test");
            var LoginPage  = new LoginPage();
            var HomePage   = new HomePage();
            var NOrderPage = new NewOrderPage();

            BasicMethods.CheckImage(LoginPage.HPLogo);
            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            NOrderPage.OrderTab.ClickBtn();
            NOrderPage.VerifyRequester(NOrderPage.OrderPageRequester);
            NOrderPage.VerifyRequestedDate(NOrderPage.OrderPageRequestedDate);
            NOrderPage.InputCostCenter(NOrderPage.OrderPageCostCenter, "");
            BasicMethods.ClickBtn(NOrderPage.OrderSubmitBtn);
            BasicMethods.VerifyText(NOrderPage.txtCostCenterError, "Cost Center should not be empty.");
            NOrderPage.InputCostCenter(NOrderPage.OrderPageCostCenter, "IN20000830");
            NOrderPage.InputMaterialName(NOrderPage.OrderPageMaterialName, "");
            NOrderPage.InputSupplierName(NOrderPage.OrderPageSupplierName, "");
            BasicMethods.ClickBtn(NOrderPage.AddBtn);
            BasicMethods.VerifyText(NOrderPage.txtMaterialError, "Material Name should not be empty.");
            BasicMethods.VerifyText(NOrderPage.txtSupplierError, "Supplier Name should not be empty.");
            BasicMethods.ClickBtn(NOrderPage.OrderSubmitBtn);
            BasicMethods.VerifyText(NOrderPage.TableNoRowError, "No Records added.");
            NOrderPage.InputMaterialName(NOrderPage.OrderPageMaterialName, "test");
            NOrderPage.InputSupplierName(NOrderPage.OrderPageSupplierName, "test");
            BasicMethods.ClickBtn(NOrderPage.AddBtn);
            BasicMethods.ClickBtn(NOrderPage.OrderSubmitBtn);
            BasicMethods.VerifyText(NOrderPage.TableError, "Some of the mandatory fields are empty.");
            NOrderPage.SelectCopyTo("Farzaneh Barmaki");
            NOrderPage.SelectCopyTo("Usha Devaraj");
            NOrderPage.SelectCopyTo("Navaneetha Krishnan");
            NOrderPage.SelectCopyTo("David Espinoza");
            BasicMethods.ClickBtn(NOrderPage.OrderSubmitBtn);
            BasicMethods.VerifyText(NOrderPage.approverError, "Copy To should not be empty.");
            NOrderPage.InputMSDS(NOrderPage.MSDS, "C:\\UshaDevaraj\\Documents\\COS\\COS\\COT-ReleaseNotes.docx");
            BasicMethods.VerifyText(NOrderPage.MSDSUploadError, "Please upload pdf only.");
            BasicMethods.ClickBtn(NOrderPage.InfoCloseBtn);
        }
示例#13
0
        public void OrderPageUITest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Order Page UI test");
            var LoginPage  = new LoginPage();
            var HomePage   = new HomePage();
            var NOrderPage = new NewOrderPage();

            BasicMethods.CheckImage(LoginPage.HPLogo);
            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            NOrderPage.OrderTab.ClickBtn();
            NOrderPage.VerifyRequester(NOrderPage.OrderPageRequester);
            NOrderPage.VerifyRequestedDate(NOrderPage.OrderPageRequestedDate);
            Validations.validateElementIsPresent(NOrderPage.MaterialSearchBtn);
            Validations.validateElementIsEnabled(NOrderPage.OrderPageMaterialName);
            Validations.validateElementIsEnabled(NOrderPage.OrderPageSupplierName);
            Validations.validateElementIsEnabled(NOrderPage.OrderPageMSDSUpload);
            Validations.validateElementIsEnabled(NOrderPage.AddBtn);
            NOrderPage.InputMaterialName(NOrderPage.OrderPageMaterialName, "test");
            NOrderPage.InputSupplierName(NOrderPage.OrderPageSupplierName, "test");
            BasicMethods.ClickBtn(NOrderPage.AddBtn);
            Validations.validateElementNotPresent(NOrderPage.MSDSPreviewLink);
            Validations.validateElementIsEnabled(NOrderPage.Comments);
            Validations.validateElementIsEnabled(NOrderPage.OrderSubmitBtn);
        }