Ejemplo n.º 1
0
        public void CreateOrderWithNewMSDSTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Functionality to test new chemcial order with 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.InputCostCenter(NOrderPage.OrderPageCostCenter, "Cost2");
            NOrderPage.InputMaterialName(NOrderPage.OrderPageMaterialName, "Acid");
            NOrderPage.InputSupplierName(NOrderPage.OrderPageSupplierName, "TASupplier");
            NOrderPage.InputMSDS(NOrderPage.MSDS, "C:\\Users\\devaraju\\Desktop\\pdf-sample.pdf");
            NOrderPage.AddBtn.ClickBtn();
            NOrderPage.CASInput(NOrderPage.CAS, "TA-CAS111");
            NOrderPage.SupplierPhoneInput(NOrderPage.SupplierPhone, "1001000121");
            NOrderPage.SupplierURLInput(NOrderPage.SupplierURL, "https://google.co.in");
            NOrderPage.MaterialURLInput(NOrderPage.MaterialURL, "https://google.co.in");
            NOrderPage.ProductNumberInput(NOrderPage.ProductNumber, "Product2");
            NOrderPage.ContactNameInput(NOrderPage.ContactName, "AUser2");
            NOrderPage.ContactEmailInput(NOrderPage.ContactEmail, "*****@*****.**");
            NOrderPage.ContactPhoneInput(NOrderPage.ContactPhone, "104789");
            NOrderPage.QuantityInput(NOrderPage.OrderPageQuantity, "10");
            NOrderPage.selectQtyUnit(NOrderPage.QuantityUnit, NOrderPage.DDLQtyUnit, 5);
            NOrderPage.CostInput(NOrderPage.OrderPageCost, "200");
            NOrderPage.SelectCostPerUnit(NOrderPage.CostPerUnit, NOrderPage.DDLCostUnit, 3);
            NOrderPage.InputDateNeeded(NOrderPage.DateNeeded, "2018/7/22");
            NOrderPage.SelectCopyTo("Farzaneh Barmaki");
            NOrderPage.SelectCopyTo("David Espinoza");
            NOrderPage.InputComments(NOrderPage.Comments, "WithMSDSTest");
            NOrderPage.SubmitOrderBtn();
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
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");
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        public void CreateMultipleOrdersTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Functionality to test with multiple orders");
            var LoginPage  = new LoginPage();
            var HomePage   = new HomePage();
            var NOrderPage = new NewOrderPage();
            //Declaring column names
            String MaterialName;
            String SupplierName;
            String MSDS;
            String CAS;
            String SupplierPhone;
            String SupplierURL;
            String MaterialURL;
            String ProductNumber;
            String ContactName;
            String ContactEmail;
            String ContactPhone;
            String Quantity;
            String QuantityUnit;
            String Cost;
            String CostUnit;
            String Date;

            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, "TestCenter");

            //To locate table.

            // Creates excel application
            excel.Application x1appln = new excel.Application();
            //Creates excel workbook object for specified file
            excel.Workbook wb = x1appln.Workbooks.Open(@"C:\\UshaDevaraj\\C#Project\\ATF\\ATF\\DataFile\\COTDataSheet.xlsx");
            //Creates excel work sheet object for sheet 1
            excel.Worksheet ws = wb.Sheets[3];
            //Creates excel work sheet object for sheet name
            //excel.Worksheet ws = wb.Sheets["DataSet"];
            //Gets used range of excel file. This will get currently how many rows occupied in sheet.
            excel.Range range    = ws.UsedRange;
            int         xlRowCnt = 1;

            // To get all rows values we have iterate through all rows one by one in for loop
            for (xlRowCnt = 2; xlRowCnt <= range.Rows.Count; xlRowCnt++)
            {
                MaterialName  = Convert.ToString(range.Cells[xlRowCnt, 1].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 1].Value2);
                SupplierName  = Convert.ToString(range.Cells[xlRowCnt, 2].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 2].Value2);
                MSDS          = Convert.ToString(range.Cells[xlRowCnt, 3].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 3].Value2);
                CAS           = Convert.ToString(range.Cells[xlRowCnt, 4].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 4].Value2);
                SupplierPhone = Convert.ToString(range.Cells[xlRowCnt, 5].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 5].Value2);
                SupplierURL   = Convert.ToString(range.Cells[xlRowCnt, 6].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 6].Value2);
                MaterialURL   = Convert.ToString(range.Cells[xlRowCnt, 7].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 7].Value2);
                ProductNumber = Convert.ToString(range.Cells[xlRowCnt, 8].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 8].Value2);
                ContactName   = Convert.ToString(range.Cells[xlRowCnt, 9].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 9].Value2);
                ContactEmail  = Convert.ToString(range.Cells[xlRowCnt, 10].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 10].Value2);
                ContactPhone  = Convert.ToString(range.Cells[xlRowCnt, 11].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 11].Value2);
                Quantity      = Convert.ToString(range.Cells[xlRowCnt, 12].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 12].Value2);
                QuantityUnit  = Convert.ToString(range.Cells[xlRowCnt, 13].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 13].Value2);
                Cost          = Convert.ToString(range.Cells[xlRowCnt, 14].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 14].Value2);
                CostUnit      = Convert.ToString(range.Cells[xlRowCnt, 15].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 15].Value2);
                Date          = Convert.ToString(range.Cells[xlRowCnt, 16].Value2) == null ? "" : Convert.ToString(range.Cells[xlRowCnt, 16].Value2);

                //Calls Orderpage methods
                NOrderPage.InputMaterialName(NOrderPage.OrderPageMaterialName, MaterialName);
                NOrderPage.InputSupplierName(NOrderPage.OrderPageSupplierName, SupplierName);
                NOrderPage.InputMSDS(NOrderPage.MSDS, MSDS);
                NOrderPage.AddBtn.ClickBtn();
                NOrderPage.InputCAS(xlRowCnt - 1, CAS);
                NOrderPage.InputSupplierPhone(xlRowCnt - 1, SupplierPhone);
                NOrderPage.InputSupplierURL(xlRowCnt - 1, SupplierURL);
                NOrderPage.InputMaterialURL(xlRowCnt - 1, MaterialURL);
                NOrderPage.InputProductNumber(xlRowCnt - 1, ProductNumber);
                NOrderPage.InputContactName(xlRowCnt - 1, ContactName);
                NOrderPage.InputContactEmail(xlRowCnt - 1, ContactEmail);
                NOrderPage.InputContactPhone(xlRowCnt - 1, ContactPhone);
                NOrderPage.InputQuantity(xlRowCnt - 1, Quantity);
                NOrderPage.selectQtyUnit(xlRowCnt - 1, Convert.ToInt32(QuantityUnit));
                NOrderPage.InputCost(xlRowCnt - 1, Cost);
                NOrderPage.SelectCostPerUnit(xlRowCnt - 1, Convert.ToInt32(CostUnit));
                NOrderPage.selectDateNeeded(xlRowCnt - 1, Date);
            }
            NOrderPage.SelectCopyTo("Farzaneh Barmaki");
            NOrderPage.SelectCopyTo("David Espinoza");
            NOrderPage.InputComments(NOrderPage.Comments, "MultipleOrdersTest");
            // NOrderPage.SubmitOrderBtn();
            wb.Close();
            x1appln.Quit();
        }