Пример #1
0
        public void SetUp()
        {
            var binary = new FirefoxBinary(ConfigUtils.Read("FirefoxPath"));
            // string path = ReadFirefoxProfile();
            FirefoxProfile ffprofile = new FirefoxProfile();

            driver = new FirefoxDriver(binary, ffprofile);
            //  driver = new InternetExplorerDriver(internetExplorerDriverServerDirectory: "\\srv10177\\TEMPSHTIW$\\Desktop\\SIT\\SITSmokeTests\\IEDriverServer.exe");
            driver.Manage().Cookies.DeleteAllCookies();
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(15));
            // Before each test
            wait           = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
            datafilePath   = ConfigUtils.Read("TestDataPath");
            sGMethods      = new GeneralMethods();
            intigrationmon = new MOnitorUI(driver);
            iccPortal      = new ICCBAMPageObj(driver);
        }
Пример #2
0
        public SIT_LibraryTest()
        {
            var binary = new FirefoxBinary(ConfigUtils.Read("FirefoxPath"));
            // string path = ReadFirefoxProfile();
            FirefoxProfile ffprofile = new FirefoxProfile();

            driver = new FirefoxDriver(binary, ffprofile);
            // driver.Manage().Cookies.DeleteAllCookies();
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(15));
            Thread.Sleep(1000);
            driver.Manage().Window.Maximize();
            Thread.Sleep(2000);
            // Before each test
            wait         = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
            datafilePath = System.Environment.GetEnvironmentVariable("ProjectWorkingDirectory") + ConfigUtils.Read("TestDataPath");
            libraryUi    = new SIT_Library_UI(driver);
            iccPortal    = new ICCBAMPageObj(driver);
        }
Пример #3
0
        public void SetUp()
        {
            //var binary = new FirefoxBinary(ConfigUtils.Read("FirefoxPath"));
            //// string path = ReadFirefoxProfile();
            //FirefoxProfile ffprofile = new FirefoxProfile();
            //driver = new FirefoxDriver(binary, ffprofile);
            //// driver.Manage().Cookies.DeleteAllCookies();
            //driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(15));
            //driver.Manage().Window.Maximize();
            //Thread.Sleep(1000);
            // Before each test
            //  options.BrowserExecutableLocation = ConfigUtils.Read("FirefoxPath");
            // driver = new FirefoxDriver(options);
            Thread.Sleep(1000);
            var binary = new FirefoxBinary(ConfigUtils.Read("FirefoxPath"));
            // // string path = ReadFirefoxProfile();
            FirefoxProfile ffprofile = new FirefoxProfile(ConfigUtils.Read("FirefoxPath"));

            ffprofile.SetPreference("binary", ConfigUtils.Read("FirefoxPath"));
            driver = new FirefoxDriver(binary, ffprofile);
            //  FirefoxOptions sfopt = new FirefoxOptions();
            //sfopt.Profile = ffprofile;
            // sfopt.AddAdditionalCapability("binary", binary);
            // sfopt.SetPreference("binary", ConfigUtils.Read("FirefoxPath"));
            // //  sfopt.BrowserExecutableLocation = ConfigUtils.Read("FirefoxPath");
            // // sfopt.ToCapabilities.binary=ConfigUtils.Read("FirefoxPath");
            // driver = new FirefoxDriver(sfopt);
            // driver.Manage().Cookies.DeleteAllCookies();
            // driver.Manage().Timeouts().ImplicitWait = (TimeSpan.FromSeconds(15));
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(15));
            //var x = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
            //var y = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;

            //driver.Manage().Window.Size = new System.Drawing.Size(x,y);
            //Thread.Sleep(1000);
            //// Before each test
            driver.Manage().Window.Maximize();

            wait         = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
            datafilePath = ConfigUtils.Read("TestDataPath");
            libraryUi    = new SIT_Library_UI(driver);
            iccPortal    = new ICCBAMPageObj(driver);
        }
Пример #4
0
        public void NavigateAndSearchOrder(string orderNumber)
        {
            string Tags_Url = ConfigUtils.Read("URL_Tags");

            driver.Navigate().GoToUrl(Tags_Url);
            Thread.Sleep(5000);

            generalMethods.WebLink_Click(DisplayOrders);
            Thread.Sleep(2000);

            OrderNumberTextBox.SendKeys(orderNumber);
            Thread.Sleep(2000);
            Actions builder = new Actions(driver);

            builder.SendKeys(Keys.Tab).Perform();

            generalMethods.WebButton_Click(SearchButton);
            Thread.Sleep(3000);
        }
Пример #5
0
        public OFU_SIT_Test()
        {
            var binary = new FirefoxBinary(ConfigUtils.Read("FirefoxPath"));
            // string path = ReadFirefoxProfile();
            FirefoxProfile ffprofile = new FirefoxProfile();

            //  ffprofile.SetPreference("javascript.enabled","false");
            driver = new FirefoxDriver(binary, ffprofile);
            //  driver = new InternetExplorerDriver(internetExplorerDriverServerDirectory: "\\srv10177\\TEMPSHTIW$\\Desktop\\SIT\\SITSmokeTests\\IEDriverServer.exe");
            driver.Manage().Cookies.DeleteAllCookies();
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(15));

            // Before each test
            wait           = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
            datafilePath   = System.Environment.GetEnvironmentVariable("ProjectWorkingDirectory") + ConfigUtils.Read("TestDataPath");
            sGMethods      = new GeneralMethods();
            intigrationmon = new MOnitorUI(driver);
            iccPortal      = new ICCBAMPageObj(driver);
        }
Пример #6
0
        //  [Test]
        public void TC29_Selenium_SmokeTest_OFU()
        {
            xCellFileHelper = new ExcelHelper(datafilePath, 1);
            string directive = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "SingleSignOn_Email");
            string OFU_Url   = ConfigUtils.Read("URL_OFU3");

            driver.Navigate().GoToUrl(OFU_Url);
            driver.Manage().Window.Maximize();
            Console.WriteLine("OFU");
            OFUPage OFUTest = new OFUPage(driver);

            OFUTest.EnterEmail.Click();
            OFUTest.EnterEmail.SendKeys(directive);
            OFUTest.ClickNextButton.Click();
            OFUTest.get_OFUPageLoad("Order Follow Up");
            Thread.Sleep(500);
            OFUTest.ordersearch("999945");
            // OFUTest.SearchOrder.SendKeys(Keys.Enter);
            Console.WriteLine("Clicked");
        }
Пример #7
0
        // [Test]

        public void TC27_SIT_Library_Materials()
        {
            try
            {
                GeneralMethods sGMethods = new GeneralMethods();
                Thread.Sleep(10000);
                xCellFileHelper = new ExcelHelper(datafilePath, 1);
                string username = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "PDQAUSER"); //"admtempjavas";
                string password = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "PDQAPWD");  //"admtempjavas";
                string season   = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "Season");   // "7-2018";
                string office   = "CNSH";
                Thread.Sleep(1000);
                // GeneralMethods sGMethods = new GeneralMethods();
                driver.Manage().Window.Maximize();
                Thread.Sleep(1000);
                driver.Navigate().GoToUrl(ConfigUtils.Read("URL_Castor"));
                Thread.Sleep(1000);
                List <string> lswins = driver.WindowHandles.ToList();
                sGMethods.GetLatestWindow(driver);
                Castorpages castorobjs = new Castorpages(driver);
                //castorobjs.CastorLogin(
                //xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "librarianUser"),
                //xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "librarianPassword"));
                castorobjs.CastorLogin(username, password);
                Reporter.ReportEvent("Login to Application with user : "******"Login Pass", HP.LFT.Report.Status.Passed);

                Thread.Sleep(20000);

                //*******************************************************************************************
                libraryUi.Materials();
                Reporter.ReportEvent("Launch Materials", "Launch Materials Pass", HP.LFT.Report.Status.Passed);

                libraryUi.traverseContentFrame();
                libraryUi.tabFrame();
                libraryUi.get_MaterialTab("Denim").Click();
                Reporter.ReportEvent("Launch Materials Denim", "Launch Materials Denim Pass", HP.LFT.Report.Status.Passed);

                libraryUi.traverseContentFrame();
                libraryUi.tabFrame();
                // libraryUi.tabFrame();
                libraryUi.traverseToContentBodyFrameTableSettings();
                libraryUi.get_ActionLinkForDropDown().Click();
                libraryUi.get_CreateCreateFancyForDropDown().Click();
                Reporter.ReportEvent("Create new Materials", "Create new Materials Pass", HP.LFT.Report.Status.Passed);

                string libraryWindow = libraryUi.get_libraryWindow();
                libraryUi.get_NewLaunchedWindow();
                Thread.Sleep(20000);
                if (libraryUi.get_MaterialText().Displayed)
                {
                    System.Diagnostics.Debug.WriteLine("******* PASS");
                }
                sGMethods.SelectDropDownByValue(libraryUi.get_FabricTypeDropDown(), "Comfort Stretch Denim");
                libraryUi.get_txtDescriptionTextBox().Click();
                libraryUi.get_txtDescriptionTextBox().SendKeys("Automation Test");
                sGMethods.SelectDropDownByValue(libraryUi.get_OfficeIdDropDown(), office);
                sGMethods.SelectDropDownByValue(libraryUi.get_SeasonIdDropDown(), season);
                libraryUi.get_DoneButton().Click();
                Thread.Sleep(30000);
                driver.SwitchTo().Window(libraryWindow);
                Thread.Sleep(4000);
                libraryUi.traverseContentFrame();
                driver.SwitchTo().Frame("detailsDisplay");
                Reporter.ReportEvent("Create new Materials in new popup", "Create new Materials in new popup Failed", HP.LFT.Report.Status.Passed);

                libraryUi.get_EditButton().Click();
                Reporter.ReportEvent("Edit created Materials", "Edit created Materials Failed", HP.LFT.Report.Status.Passed);
                Thread.Sleep(1000);
                libraryUi.get_btnSupplier().Click();
                Thread.Sleep(1000);
                libraryWindow = libraryUi.get_libraryWindow();
                libraryUi.get_NewLaunchedWindow();
                Thread.Sleep(5000);
                driver.SwitchTo().DefaultContent();
                driver.SwitchTo().Frame("searchPane");
                sGMethods.SelectDropDownByValue(libraryUi.get_OfficeIdDropDown(), office);
                Thread.Sleep(5000);
                driver.SwitchTo().DefaultContent();
                libraryUi.get_FindButton().Click();
                Thread.Sleep(5000);
                IAlert alert = driver.SwitchTo().Alert();
                alert.Accept();
                driver.SwitchTo().Frame("listDisplay");
                Thread.Sleep(2000);
                libraryUi.get_btnSupplierCheckBox().Click();
                Thread.Sleep(2000);
                driver.SwitchTo().DefaultContent();
                Reporter.ReportEvent("Selected supplier for new Materials", "Selected supplier for new Materials Failed",
                                     HP.LFT.Report.Status.Passed);
                libraryUi.get_SubmitButton().Click();
                Thread.Sleep(2000);
                driver.SwitchTo().Window(libraryWindow);
                System.Diagnostics.Debug.WriteLine(driver.Title);
                Thread.Sleep(3000);
                libraryUi.traverseContentFrame();
                driver.SwitchTo().Frame("detailsDisplay");
                if (libraryUi.get_btnFiberContent().Displayed)
                {
                    Thread.Sleep(3000);
                }
                libraryUi.get_btnFiberContent().Click();
                Reporter.ReportEvent("Selected FiberContent for new Materials", "Selected FiberContent for new Materials Failed",
                                     HP.LFT.Report.Status.Passed);
                libraryWindow = libraryUi.get_libraryWindow();
                libraryUi.get_NewLaunchedWindow();
                driver.SwitchTo().Frame("fabricContentTable");
                driver.SwitchTo().Frame("tableContentFrame");
                driver.SwitchTo().Frame("tableBodyRight");
                libraryUi.get_materialCompositionType()[2].Click();
                libraryUi.get_materialCompositionType()[2].Clear();
                libraryUi.get_materialCompositionType()[2].SendKeys("100");
                driver.SwitchTo().DefaultContent();
                libraryUi.get_DoneButtonPopUp().Click();
                driver.SwitchTo().Window(libraryWindow);
                libraryUi.traverseContentFrame();
                driver.SwitchTo().Frame("detailsDisplay");
                libraryUi.get_btnPurchaseCost().Clear();
                libraryUi.get_btnPurchaseCost().SendKeys("4");
                sGMethods.SelectDropDownByValue(libraryUi.get_btnCurrencyId(), "EUR");
                sGMethods.SelectDropDownByValue(libraryUi.get_btnPurchaseUOMId(), "cm");
                Thread.Sleep(10000);
                libraryUi.traverseContentFrame();
                driver.SwitchTo().Frame("detailsDisplay");
                libraryUi.get_DoneButtonCastor().Click();
                libraryUi.get_Initiatedlink().Click();
                libraryWindow = libraryUi.get_libraryWindow();
                libraryUi.get_NewLaunchedWindow();
                Thread.Sleep(5000);
                driver.SwitchTo().DefaultContent();
                driver.SwitchTo().Frame("pagecontent");
                if (libraryUi.get_stateNameHighlight("Initiated").Displayed)
                {
                    System.Diagnostics.Debug.WriteLine("::::::::::::::::::::: PASS");
                }
                Reporter.ReportEvent("Status is Initiated", "Status is Initiated Pass", HP.LFT.Report.Status.Passed);
                Thread.Sleep(5000);
                driver.SwitchTo().DefaultContent();
                libraryUi.get_StatePromote().Click();
                Thread.Sleep(3000);
                driver.SwitchTo().Frame("pagecontent");
                if (libraryUi.get_stateNameHighlight("Review").Displayed)
                {
                    System.Diagnostics.Debug.WriteLine("::::::::::::::::::::: PASS");
                }
                Reporter.ReportEvent("Status is Review", "Status is Review Pass", HP.LFT.Report.Status.Passed);
                Thread.Sleep(5000);
                driver.SwitchTo().DefaultContent();
                libraryUi.get_StatePromote().Click();
                Thread.Sleep(3000);
                driver.SwitchTo().Frame("pagecontent");
                if (libraryUi.get_stateNameHighlight("Released").Displayed)
                {
                    System.Diagnostics.Debug.WriteLine("::::::::::::::::::::: PASS");
                }
                Reporter.ReportEvent("Status is Released", "Status is Released Pass", HP.LFT.Report.Status.Passed);

                driver.Close();
                driver.SwitchTo().Window(libraryWindow);

                iccPortal.LaunchICCWindow();

                try
                {
                    iccPortal.SelectValueFromApplicationDropDown("MaterialBooking_Castor");
                    iccPortal.VerifySearchResult("MaterialBooking_Castor");
                    iccPortal.VerifyPortInSearchResult("MaterialBooking.RM");
                    Reporter.ReportEvent("ICC portal 'MaterialBooking_Castor' Processed for MaterialBooking.RM",
                                         "ICC portal  'MaterialBooking_Castor' Processed for MaterialBooking.RM",
                                         HP.LFT.Report.Status.Passed);
                }
                catch
                {
                    Reporter.ReportEvent("ICC portal 'MaterialBooking_Castor' Processed for MaterialBooking.RM",
                                         "ICC portal  'MaterialBooking_Castor' Processed for MaterialBooking.RM",
                                         HP.LFT.Report.Status.Failed);
                }
            }
            catch (Exception ex)
            {
                string     stimestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss").ToString();
                string     ESSpath    = System.Environment.GetEnvironmentVariable("ProjectWorkingDirectory") + "ImagesPath\\" + stimestamp + ".Png";
                Screenshot sc         = ((ITakesScreenshot)driver).GetScreenshot();
                sc.SaveAsFile(ESSpath, ImageFormat.Png);
                System.Diagnostics.Debug.WriteLine("Message*********************" + ex.Message);
                System.Diagnostics.Debug.WriteLine("StackTrace*********************" + ex.StackTrace);
                Reporter.ReportEvent("TC27_SIT_Library_Materials script fail",
                                     "TC27_SIT_Library_Materials Script fail",
                                     HP.LFT.Report.Status.Failed, ESSpath);
            }
        }
Пример #8
0
        //  [Test]

        public void TC28_SIT_Library_TransportPacking()
        {
            try
            {
                GeneralMethods sGMethods = new GeneralMethods();
                Thread.Sleep(10000);
                xCellFileHelper = new ExcelHelper(datafilePath, 1);
                string username = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "PDQAUSER"); //"admtempjavas";
                string password = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "PDQAPWD");  //"admtempjavas";
                string season   = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "Season");   // "7-2018";
                string office   = "CNSH";
                Thread.Sleep(1000);

                driver.Manage().Window.Maximize();
                Thread.Sleep(1000);
                driver.Navigate().GoToUrl(ConfigUtils.Read("URL_Castor"));
                Thread.Sleep(1000);
                List <string> lswins = driver.WindowHandles.ToList();
                sGMethods.GetLatestWindow(driver);
                Castorpages castorobjs = new Castorpages(driver);
                //castorobjs.CastorLogin(
                //xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "librarianUser"),
                //xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "librarianPassword"));

                castorobjs.CastorLogin(username, password);
                Reporter.ReportEvent("Login to Application with user : "******"Login Pass", HP.LFT.Report.Status.Passed);

                Thread.Sleep(20000);
                //  *******************************************TransportPacking******************************************************************************
                libraryUi.LaunchTransportPacking();
                Reporter.ReportEvent("Launch TransportPacking", "Launch TransportPacking Pass", HP.LFT.Report.Status.Passed);

                libraryUi.traverseContentFrame();
                libraryUi.traverseToContentBodyFrameTableSettings();
                libraryUi.get_ActionLinkForDropDown().Click();
                libraryUi.get_CreateTransportPackingForDropDown().Click();
                Reporter.ReportEvent("Create new TransportPacking", "Create new TransportPacking Pass", HP.LFT.Report.Status.Passed);

                string libraryWindow = libraryUi.get_libraryWindow();
                libraryUi.get_NewLaunchedWindow();
                Thread.Sleep(20000);
                if (libraryUi.get_CreateTransportPackingText().Displayed)
                {
                    System.Diagnostics.Debug.WriteLine("******* PASS");
                }
                driver.SwitchTo().Frame("pagecontent");
                if (libraryUi.get_showTypeSelector().Displayed)
                {
                    Thread.Sleep(3000);
                }
                libraryUi.get_showTypeSelector().Click();
                string type = libraryUi.get_libraryWindow();
                libraryUi.get_NewLaunchedWindow();
                Thread.Sleep(20000);
                libraryUi.get_TransportPackingExpand().Click();
                Thread.Sleep(2000);
                libraryUi.get_PolybagRadioButton().Click();
                libraryUi.get_SelectButton().Click();
                Thread.Sleep(10000);
                driver.SwitchTo().Window(type);
                driver.SwitchTo().Frame("pagecontent");
                libraryUi.get_txtDescription().Click();
                libraryUi.get_txtDescription().SendKeys("Automation Test");
                libraryUi.get_Concept().Click();
                libraryUi.selectSeason(season);
                driver.SwitchTo().DefaultContent();
                libraryUi.get_DoneButton().Click();
                Reporter.ReportEvent("Create new TransportPacking in new popup", "Create new TransportPacking in new popup Failed", HP.LFT.Report.Status.Passed);
                Thread.Sleep(20000);
                driver.SwitchTo().Window(libraryWindow);
                libraryUi.traverseContentFrame();


                libraryUi.switchToFrame();
                libraryUi.get_EditButton().Click();
                Reporter.ReportEvent("Edit created TransportPacking", "Edit created TransportPacking Failed", HP.LFT.Report.Status.Passed);

                libraryUi.get_btnSupplier().Click();
                libraryWindow = libraryUi.get_libraryWindow();
                libraryUi.get_NewLaunchedWindow();
                driver.SwitchTo().DefaultContent();
                driver.SwitchTo().Frame("searchPane");
                sGMethods.SelectDropDownByValue(libraryUi.get_OfficeIdDropDown(), office);
                driver.SwitchTo().DefaultContent();
                libraryUi.get_FindButton().Click();
                Thread.Sleep(2000); IAlert alert = driver.SwitchTo().Alert();
                alert.Accept();
                driver.SwitchTo().Frame("listDisplay");
                Thread.Sleep(2000);
                libraryUi.get_btnSupplierCheckBox().Click();
                Reporter.ReportEvent("Selected supplier for new TransportPacking", "Selected supplier for new TransportPacking Failed",
                                     HP.LFT.Report.Status.Passed);
                driver.SwitchTo().DefaultContent();
                libraryUi.get_SubmitButton().Click();
                driver.SwitchTo().Window(libraryWindow);
                System.Diagnostics.Debug.WriteLine(driver.Title);
                libraryUi.traverseContentFrame();
                // driver.SwitchTo().Frame("detailsDisplay");
                libraryUi.switchToFrame();
                if (libraryUi.get_DoneButtonCastor().Displayed)
                {
                    Thread.Sleep(3000);
                }
                libraryUi.get_DoneButtonCastor().Click();
                libraryUi.get_Initiatedlink().Click();
                driver.SwitchTo().DefaultContent();
                libraryWindow = libraryUi.get_libraryWindow();
                libraryUi.get_NewLaunchedWindow();
                driver.SwitchTo().DefaultContent();
                driver.SwitchTo().Frame("pagecontent");
                if (libraryUi.get_stateNameHighlight("Initiated").Displayed)
                {
                    System.Diagnostics.Debug.WriteLine("::::::::::::::::::::: PASS");
                }
                Reporter.ReportEvent("Status is Initiated", "Status is Initiated Pass", HP.LFT.Report.Status.Passed);

                driver.SwitchTo().DefaultContent();

                libraryUi.get_StatePromote().Click();
                Thread.Sleep(3000);
                driver.SwitchTo().Frame("pagecontent");
                if (libraryUi.get_stateNameHighlight("Review").Displayed)
                {
                    System.Diagnostics.Debug.WriteLine("::::::::::::::::::::: PASS");
                }
                Reporter.ReportEvent("Status is Review", "Status is Review Pass", HP.LFT.Report.Status.Passed);

                driver.SwitchTo().DefaultContent();

                libraryUi.get_StatePromote().Click();
                Thread.Sleep(3000);
                driver.SwitchTo().Frame("pagecontent"); if (libraryUi.get_stateNameHighlight("Released").Displayed)
                {
                    System.Diagnostics.Debug.WriteLine("::::::::::::::::::::: PASS");
                }
                Reporter.ReportEvent("Status is Released", "Status is Released Pass", HP.LFT.Report.Status.Passed);

                driver.Close();
                driver.SwitchTo().Window(libraryWindow);

                iccPortal.LaunchICCWindow();

                iccPortal.SelectValueFromApplicationDropDown("TransportPacking_Castor");
                iccPortal.VerifySearchResult("TransportPacking");
                iccPortal.VerifyPortInSearchResult("TransportPacking.Shredder");
                Reporter.ReportEvent("ICC portal 'PlanInformationOnArticleLevel_PLES' Processed for CDW and Fantomen",
                                     "ICC portal  PlanInformationOnArticleLevel_PLES Processed for CDW and Fantomen",
                                     HP.LFT.Report.Status.Passed);
            }
            catch (Exception ex)
            {
                string     stimestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss").ToString();
                string     ESSpath    = System.Environment.GetEnvironmentVariable("ProjectWorkingDirectory") + "ImagesPath\\" + stimestamp + ".Png";
                Screenshot sc         = ((ITakesScreenshot)driver).GetScreenshot();
                sc.SaveAsFile(ESSpath, ImageFormat.Png);
                System.Diagnostics.Debug.WriteLine("Message*********************" + ex.Message);
                System.Diagnostics.Debug.WriteLine("StackTrace*********************" + ex.StackTrace);
                Reporter.ReportEvent("TC28_SIT_Library_TransportPacking script fail",
                                     "TC28_SIT_Library_TransportPacking Script fail " + ex.Message,
                                     HP.LFT.Report.Status.Failed, ESSpath);
            }
        }
Пример #9
0
        //  [Test]

        public void TC26_SIT_Library_License_Companies()
        {
            try
            {
                GeneralMethods sGMethods = new GeneralMethods();
                Thread.Sleep(10000);
                xCellFileHelper = new ExcelHelper(datafilePath, 1);
                string username = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "PDQAUSER"); //"admtempjavas";
                string password = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "PDQAPWD");  //"admtempjavas";
                string season   = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "Season");   // "7-2018";
                Thread.Sleep(1000);

                driver.Manage().Window.Maximize();
                Thread.Sleep(1000);
                driver.Navigate().GoToUrl(ConfigUtils.Read("URL_Castor"));
                Thread.Sleep(1000);
                List <string> lswins = driver.WindowHandles.ToList();
                sGMethods.GetLatestWindow(driver);
                Castorpages castorobjs = new Castorpages(driver);
                //castorobjs.CastorLogin(
                //xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "librarianUser"),
                //xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "librarianPassword"));

                castorobjs.CastorLogin(username, password);
                Thread.Sleep(20000);
                //  ********************************************  License Companies ****************************************************************************
                libraryUi.LaunchLicenseCompanies();
                libraryUi.traverseContentFrame();
                libraryUi.traverseToContentBodyFrame();
                string companyName = null;
                if (libraryUi.get_LicenseCompaniesTableRowRecord().Count > 0)
                {
                    libraryUi.get_Checkbox(Int32.Parse(libraryUi.get_LicenseCompaniesTableRowRecord()[1].GetAttribute("rowIndex"))).Click();
                    companyName = libraryUi.get_LicenseCompaniesTableRowRecordName()[1].Text;
                    libraryUi.traverseContentFrame();
                    libraryUi.traverseToContentBodyFrameTableSettings();
                    libraryUi.get_Activate().Click();
                    libraryUi.traverseContentFrame();
                    libraryUi.traverseToContentBodyFrame();
                    for (int i = 0; i < 20; i++)
                    {
                        if (libraryUi.get_StatusByCompanyName(companyName).Text.Equals("Active"))
                        {
                            break;
                        }
                        else
                        {
                            System.Diagnostics.Debug.WriteLine(libraryUi.get_StatusByCompanyName(companyName).Text); Thread.Sleep(1000);
                        }
                    }
                }
                else
                {
                    // no inactive compnay
                }

                //check export
                string libraryWindow = libraryUi.get_libraryWindow();
                libraryUi.get_NewLaunchedWindow();

                iccPortal.LaunchICCWindow();

                try {
                    iccPortal.SelectValueFromApplicationDropDown("LicenceCompany_Castor");
                    iccPortal.VerifySearchResult("LicenceCompany_Castor");
                    iccPortal.VerifyPortInSearchResult("OFS");
                    iccPortal.VerifyPortInSearchResult("Showroom");
                    iccPortal.VerifyPortInSearchResult("HMOrder");
                    iccPortal.VerifyPortInSearchResult("VPS");
                    Reporter.ReportEvent("ICC portal 'LicenceCompany_Castor' Processed for OFS, Showroom, HMOrder, VPS",
                                         "ICC portal  LicenceCompany_Castor Processed for OFS, Showroom, HMOrder, VPS",
                                         HP.LFT.Report.Status.Passed);
                }
                catch
                {
                    Reporter.ReportEvent("ICC portal 'LicenceCompany_Castor' Processed for OFS, Showroom, HMOrder, VPS",
                                         "ICC portal  LicenceCompany_Castor Processed for OFS, Showroom, HMOrder, VPS",
                                         HP.LFT.Report.Status.Failed);
                }
                driver.SwitchTo().Window(libraryWindow);
                // make it incative
                libraryUi.traverseContentFrame();
                libraryUi.traverseToContentBodyFrame();
                // libraryUi.get_Checkbox(Int32.Parse(libraryUi.get_RowByCompanyName(companyName).GetAttribute("rowIndex")) + 1).Click();
                //companyName = libraryUi.get_LicenseCompaniesTableRowRecordName()[1].Text;
                libraryUi.traverseContentFrame();
                libraryUi.traverseToContentBodyFrameTableSettings();
                libraryUi.get_Drop().Click();
            }
            catch (Exception ex)
            {
                string     stimestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss").ToString();
                string     ESSpath    = System.Environment.GetEnvironmentVariable("ProjectWorkingDirectory") + "ImagesPath\\" + stimestamp + ".Png";
                Screenshot sc         = ((ITakesScreenshot)driver).GetScreenshot();
                sc.SaveAsFile(ESSpath, ImageFormat.Png);
                System.Diagnostics.Debug.WriteLine("Message*********************" + ex.Message);
                System.Diagnostics.Debug.WriteLine("StackTrace*********************" + ex.StackTrace);
                Reporter.ReportEvent("TC26_SIT_Library_License_Companies script fail",
                                     "TC26_SIT_Library_License_Companies script fail- exception message: " + ex.Message,
                                     HP.LFT.Report.Status.Failed);
                Reporter.ReportEvent("TC26_SIT_Library_License_Companies script fail",
                                     "TC26_SIT_Library_License_Companies script fail- exception StackTrace " + ex.StackTrace,
                                     HP.LFT.Report.Status.Failed, ESSpath);
            }
        }
Пример #10
0
        // [Test,Order(7)]
        public void TC07_Selenium_SmokeTest_ProductPlan()
        {
            try {
                //string Directive = "02 - H&M+";
                //string season = "7-2018";
                //string ProductClassification = "Blouse - Top";
                //string ProductClassificationSub = "Long sleeve";

                //string Directive = "20 - H&M Man";
                //string season = "7-2018";
                //string ProductClassification = "Coat - Top";
                //string ProductClassificationSub = "Summer";
                //string GraphicalAppearance = "Solid";
                //string articleGraphicalAppearance = "220 - LONG WOOL";
                //string TabName = "5262 - Jacket";
                xCellFileHelper = new ExcelHelper(datafilePath, 1);
                string directive             = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "Section");
                string season                = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "Season");
                string productClassification =
                    xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "ProductType");
                // string productClassificationSub = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "ProductClassificationSub");
                string graphicalAppearance =
                    xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "GraphicalAppearance");
                string articleGraphicalAppearance =
                    xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "articleGraphicalAppearance");
                string tabName = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "TabName");
                // string market = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "Market");
                // string quantity = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "Quantity");
                // string sellPrice = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "SellPrice");
                string articalNo = xCellFileHelper.GetCellValueByRowAndColumn("Selenium_SmokeTest1", "ArticalNo");
                // 09-101
                string custCustomGr = "Women";
                string typeofConstr = "Woven";
                string Description  = "AutomationTest";

                //try
                //{
                pPlanPage = new PrePlanPage(driver);
                driver.Manage().Window.Maximize();
                Thread.Sleep(1000);
                driver.Navigate().GoToUrl(ConfigUtils.Read("URL_PPlan"));
                Thread.Sleep(1000);
                pPlanPage.waitForPageToLoad();
                pPlanPage.waitForSpinnerToDisappear();
                Thread.Sleep(4000);
                if (!pPlanPage.seasonButtonStatus.Text.Contains(season))
                {
                    sGMethods.WebButton_Click(pPlanPage.get_seasonSelectionDirectiveButton(season));
                }
                Reporter.ReportEvent("Season selected", "Season selected : " + season, HP.LFT.Report.Status.Passed);
                pPlanPage.waitForPageToLoad();
                Assert.IsTrue(pPlanPage.get_ProductNameTableHeaderElement().Displayed);
                if (!pPlanPage.SectionDirectrivesDropDownElementSelectedElement.Text.Contains(directive))
                {
                    sGMethods.SelectDropDownByValue(pPlanPage.SectionDirectrivesDropDownElement,
                                                    directive);
                }
                Reporter.ReportEvent("Directive selected from dropdown", "Directive selected from dropdown : " + directive,
                                     HP.LFT.Report.Status.Passed);
                try
                {
                    driver.FindElement(By.XPath("//button[text()='Full']")).Click();
                    pPlanPage.waitForPageToLoad();
                    pPlanPage.waitForSpinnerToDisappear();
                }
                catch
                {
                }
                if (pPlanPage.get_departmentTabElement(tabName).Displayed)
                {
                    if (!pPlanPage.DepartmentTabActivElement.Text.Contains(tabName))
                    {
                        pPlanPage.get_departmentTabElement(tabName).Click();
                        pPlanPage.waitForPageToLoad();
                        pPlanPage.waitForSpinnerToDisappear();
                    }
                }
                Reporter.ReportEvent("Tab selected", "Tab selected : " + tabName, HP.LFT.Report.Status.Passed);
                Thread.Sleep(4000);
                Assert.IsTrue(pPlanPage.get_ProductNameTableHeaderElement().Displayed);
                pPlanPage.waitForSpinnerToDisappear();
                //driver.FindElement(By.XPath(".//*[@id='center']/div/div[4]/div[1]/div/div[1]/div[5]")).Click();
                //try
                //{
                //    driver.FindElement(By.XPath(".//*[@id='center']/div/div[4]/div[3]/div/div/div[1]")).Click();


                //    List<IWebElement> scrolls = driver.FindElements(By.XPath(".//*[@id='center']/div/div[4]/div[3]/div/div/div")).ToList();
                //    Console.WriteLine(scrolls.Count);
                //    int j = 1;
                //    IJavaScriptExecutor js = driver as IJavaScriptExecutor;
                //    while (j < scrolls.Count)
                //    {
                //        if (j == (scrolls.Count) - 1)
                //        {
                //            Thread.Sleep(250);
                //        }
                //        js.ExecuteScript("arguments[0].scrollIntoView();", scrolls[j]);

                //        scrolls = driver.FindElements(By.XPath(".//*[@id='center']/div/div[4]/div[3]/div/div/div")).ToList();
                //        j = j + 1;
                //    }

                //}
                //catch
                //{


                //}
                //if cont more than one scroll
                Thread.Sleep(5000);
                pPlanPage.get_CreateProductTextBox();
                string productName = "AutoTest" + (DateTime.Now.ToString("yyyyhhmmssffff"));
                pPlanPage.CreateProductNameTextBoxElement.SendKeys(productName);
                pPlanPage.CreateProductNameTextBoxElement.SendKeys(Keys.Enter);
                Reporter.ReportEvent("Product name enter in text box", "Product name enter in text box : " + productName,
                                     HP.LFT.Report.Status.Passed);
                Thread.Sleep(5000);
                //  Assert.IsTrue(pPlanPage.get_ProductNameFromLeftColumn(productName).Displayed);
                Reporter.ReportEvent("Product Name display and created ", "Product Name display and created",
                                     HP.LFT.Report.Status.Passed);
                Thread.Sleep(2000);
                xCellFileHelper.SetCellValueByRowAndColumn("Selenium_SmokeTest1", "PPlanProduct", productName);


                pPlanPage.selectCore(productName, articalNo);
                pPlanPage.get_ProductNameFromLeftColumn(productName).Click();
                Reporter.ReportEvent("Clicked on product name", "clicked on product Name", HP.LFT.Report.Status.Passed);
                //  Assert.IsTrue(pPlanPage.get_productView_ProductName().Text.Equals(productName));

                // sGMethods.WebButton_Click(pPlanPage.get_productView_SellPrice());
                pPlanPage.get_productView_SellPrice().Click();
                Thread.Sleep(3000);
                pPlanPage.get_value_SellPrice("2").Click();
                Thread.Sleep(2000);
                sGMethods.WebButton_Click(pPlanPage.SaveButtonHeaderElement);
                pPlanPage.waitForSpinnerToDisappear();
                pPlanPage.waitForPageToLoad();
                Thread.Sleep(10000);
                Assert.IsTrue(pPlanPage.get_ProductNameFromLeftColumn(productName).Displayed);
                try
                {
                    Thread.Sleep(60000);
                    pPlanPage.TableRandomOtherColumnElement.Click();
                    pPlanPage.TableRandomOtherColumnElement.SendKeys(Keys.PageDown);
                    Thread.Sleep(5000);
                }
                catch
                {
                    Thread.Sleep(5000);
                }
                pPlanPage.get_RefreshButtonHeaderElement().Click();

                pPlanPage.waitForSpinnerToDisappear();
                Assert.IsTrue(pPlanPage.get_ProductNameFromLeftColumn(productName).Displayed);
                System.Diagnostics.Debug.WriteLine(pPlanPage.get_productView_ProductNumber().Text);
                productNumber = pPlanPage.get_productView_ProductNumber().Text;
                string[] ele = productNumber.Split(':');
                productNumber = ele[1].Trim();
                Reporter.ReportEvent("Product Number displayed", "Product Number displayed : " + productNumber,
                                     HP.LFT.Report.Status.Passed);
                xCellFileHelper.SetCellValueByRowAndColumn("Selenium_SmokeTest1", "PPlanNumber", productNumber);
                Thread.Sleep(1000);
                pPlanPage.get_WarningLink("Product Classification missing").Click();
                Thread.Sleep(2000);
                pPlanPage.productView_ProductClassification.Click();
                Reporter.ReportEvent("Stated Product Classification", "Stated Product Classification",
                                     HP.LFT.Report.Status.Passed);
                Thread.Sleep(3000);
                pPlanPage.get_value_ProductClassification(productClassification).Click();
                //try
                //{
                //    pPlanPage.productView_ProductClassificationcategories.Click();
                //    pPlanPage.get_value_ProductClassificationCategories(productClassificationSub).Click();
                //}
                //catch
                //{
                //}
                Thread.Sleep(1000);
                pPlanPage.productDescription.Click();
                Thread.Sleep(1000);
                pPlanPage.productDescription.SendKeys(Description);

                sGMethods.SelectDropDownByValue(pPlanPage.changeTypeOfConstructionIdDropDwon, typeofConstr);
                sGMethods.SelectDropDownByValue(pPlanPage.changeCustomsCustomerGroupIdDropDown, custCustomGr);
                Thread.Sleep(1000);
                //  pPlanPage.get_WarningLink("Please add Articles").Click();
                //Su  Thread.Sleep(1000);
                // pPlanPage.enterArtical(articalNo);
                Thread.Sleep(1000);
                pPlanPage.get_WarningLink("Please select ISWs").Click();
                Thread.Sleep(4000);
                Reporter.ReportEvent("Stated select ISWs", "Stated select ISWs", HP.LFT.Report.Status.Passed);
                pPlanPage.get_PleaseselectISWs(articalNo.Trim())[7].Click();
                Thread.Sleep(2000);
                pPlanPage.get_WarningLink("Article Graphical Appearance missing").Click();
                Thread.Sleep(1000);
                pPlanPage.selectarticleGraphicalAppearance(graphicalAppearance);
                Thread.Sleep(1000);
                Reporter.ReportEvent("Stated Article Graphical Appearance",
                                     "Stated Article Graphical Appearance : " + graphicalAppearance, HP.LFT.Report.Status.Passed);
                Thread.Sleep(1000);
                pPlanPage.get_WarningLink("Article Type missing").Click();
                Thread.Sleep(1000);
                pPlanPage.typeSelectarticleGraphicalAppearance(articleGraphicalAppearance);
                Thread.Sleep(1000);
                Reporter.ReportEvent("StatedArticle Type", "Stated Article Type : " + articleGraphicalAppearance,
                                     HP.LFT.Report.Status.Passed);
                Thread.Sleep(1000);
                pPlanPage.clickOnVersion();
                //market = market.Trim();
                //quantity = quantity.Trim();
                //string[] splitMarket = market.Split('|');
                //string[] splitQuantity = quantity.Split('|');
                Reporter.ReportEvent("Enter Market and Quantity", "Enter Market and Quantity", HP.LFT.Report.Status.Passed);
                //for (int i = 0; i < pPlanPage.getAllMarket().Count; i++)
                //{
                //    pPlanPage.setmarketquantity(pPlanPage.getAllMarket()[i], quantity, "1");
                //}
                Thread.Sleep(1000);

                pPlanPage.setMarketQuant("600000");

                //pPlanPage.setmarketquantity("NO-02", "999", "1");
                //pPlanPage.setmarketquantity("DK-03", "999", "1");
                sGMethods.WebButton_Click(pPlanPage.SaveButtonHeaderElement);
                Thread.Sleep(1000);
                pPlanPage.waitForSpinnerToDisappear();
                pPlanPage.waitForPageToLoad();
                Thread.Sleep(1000);
                Assert.IsTrue(pPlanPage.get_ProductNameFromLeftColumn(productName).Displayed);
                if (!pPlanPage.SaveButtonHeaderElement.GetAttribute("disabled").Equals("true"))
                {
                    sGMethods.WebButton_Click(pPlanPage.SaveButtonHeaderElement);
                    pPlanPage.waitForSpinnerToDisappear();
                    pPlanPage.waitForPageToLoad();
                }
                Thread.Sleep(5000);
                pPlanPage.verifyArticleNumberDisplays(productName);
                if (!pPlanPage.SaveButtonHeaderElement.GetAttribute("disabled").Equals("true"))
                {
                    sGMethods.WebButton_Click(pPlanPage.SaveButtonHeaderElement);
                    pPlanPage.waitForSpinnerToDisappear();
                    pPlanPage.waitForPageToLoad();
                }
                Reporter.ReportEvent("Article Number displayed", "Article Number displayed", HP.LFT.Report.Status.Passed);
                //*************************** Monitor  ****************************
                try
                {
                    intigrationmon.LaunchWindowIntegrationmonitor(productNumber, ConfigUtils.Read("URL_IMonitor"));
                    intigrationmon.SearchIntegrationmonitor(productNumber, "PlanInformationOnArticleLevel");
                    Reporter.ReportEvent("Search Integration monitor 'PlanInformationOnArticleLevel' Processed",
                                         "Search Integration monitor 'PlanInformationOnArticleLevel' Processed",
                                         HP.LFT.Report.Status.Passed);
                    intigrationmon.SearchIntegrationmonitor(productNumber, "PlanExternalArticleInfo");
                    Reporter.ReportEvent("Search Integration monitor 'PlanExternalArticleInfo' Processed",
                                         "Search Integration monitor 'PlanExternalArticleInfo' Processed", HP.LFT.Report.Status.Passed);
                    intigrationmon.SearchIntegrationmonitor(productNumber, "ProductSellPrice");
                    Reporter.ReportEvent("Search Integration monitor 'ProductSellPrice' Processed",
                                         "Search Integration monitor 'ProductSellPrice' Processed", HP.LFT.Report.Status.Passed);
                    intigrationmon.SearchIntegrationmonitor(productNumber, "PlanExternalArticleInfo");
                    Reporter.ReportEvent("Search Integration monitor 'PlanExternalArticleInfo' Processed",
                                         "Search Integration monitor 'PlanExternalArticleInfo' Processed", HP.LFT.Report.Status.Passed);
                    intigrationmon.SearchIntegrationmonitor(productNumber, "PlanInformationOnMarketLevel");
                    Reporter.ReportEvent("Search Integration monitor 'PlanInformationOnMarketLevel' Processed",
                                         "Search Integration monitor 'PlanInformationOnMarketLevel' Processed", HP.LFT.Report.Status.Passed);
                    intigrationmon.SearchIntegrationmonitor(productNumber, "PlanExternalMarketInfo");
                    Reporter.ReportEvent("Search Integration monitor 'PlanExternalMarketInfo' Processed",
                                         "Search Integration monitor 'PlanExternalMarketInfo' Processed", HP.LFT.Report.Status.Passed);
                    intigrationmon.SearchIntegrationmonitor(productNumber, "WeekPlanOnMarketLevel");
                    Reporter.ReportEvent("Search Integration monitor 'WeekPlanOnMarketLevel' Processed",
                                         "Search Integration monitor 'WeekPlanOnMarketLevel' Processed", HP.LFT.Report.Status.Passed);
                    intigrationmon.CloseIntegrationmonitorAndBackToPp();
                }
                catch (Exception ex)
                {
                    Reporter.ReportEvent("Fail to verify intigration monitor Section",
                                         "Fail to verify intigration monitor Section Exception  : " + ex.StackTrace,
                                         HP.LFT.Report.Status.Passed);
                }

                //*************************** ICC  ****************************
                try
                {
                    iccPortal.LaunchICCWindow();

                    /// iccPortal.LaunchWindowICC("Acc2010", ConfigUtils.Read("URL_ICC"));
                    ///
                    try
                    {
                        iccPortal.SelectValueFromApplicationDropDown(productNumber, "PlanInformationOnArticleLevel_PLES");
                        iccPortal.VerifySearchResult("PlanInformationOnArticleLevel_PLES");
                        iccPortal.VerifyPortInSearchResult("CDW");
                        iccPortal.VerifyPortInSearchResult("Fantomen");
                        Reporter.ReportEvent("ICC portal 'PlanInformationOnArticleLevel_PLES' Processed for CDW and Fantomen",
                                             "ICC portal  PlanInformationOnArticleLevel_PLES Processed for CDW and Fantomen",
                                             HP.LFT.Report.Status.Passed);
                    }
                    catch
                    {
                        Reporter.ReportEvent("ICC portal 'PlanInformationOnArticleLevel_PLES' Processed for CDW and Fantomen",
                                             "ICC portal  PlanInformationOnArticleLevel_PLES Processed for CDW and Fantomen",
                                             HP.LFT.Report.Status.Failed);
                    }
                    try
                    {
                        iccPortal.SelectValueFromApplicationDropDown(productNumber, "PlanInformationOnMarketLevel_PLES");
                        iccPortal.VerifySearchResult("PlanInformationOnMarketLevel_PLES");
                        iccPortal.VerifyPortInSearchResult("CDW");
                        iccPortal.VerifyPortInSearchResult("Fantomen");
                        Reporter.ReportEvent("ICC portal 'PlanInformationOnMarketLevel_PLES' Processed for CDW and Fantomen",
                                             "ICC portal  PlanInformationOnMarketLevel_PLES Processed for CDW and Fantomen",
                                             HP.LFT.Report.Status.Passed);
                    }
                    catch
                    {
                        Reporter.ReportEvent("ICC portal 'PlanInformationOnMarketLevel_PLES' Processed for CDW and Fantomen",
                                             "ICC portal  PlanInformationOnMarketLevel_PLES Processed for CDW and Fantomen",
                                             HP.LFT.Report.Status.Failed);
                    }
                    try
                    {
                        iccPortal.SelectValueFromApplicationDropDown(productNumber, "PlanInformationOnProductLevel_PLES");
                        iccPortal.VerifySearchResult("PlanInformationOnProductLevel_PLES");
                        iccPortal.VerifyPortInSearchResult("CDW");
                        iccPortal.VerifyPortInSearchResult("Fantomen");
                        Reporter.ReportEvent("ICC portal 'PlanInformationOnProductLevel_PLES' Processed for CDW and Fantomen",
                                             "ICC portal  PlanInformationOnProductLevel_PLES Processed for CDW and Fantomen",
                                             HP.LFT.Report.Status.Passed);
                    }
                    catch
                    {
                        Reporter.ReportEvent("ICC portal 'PlanInformationOnProductLevel_PLES' Processed for CDW and Fantomen",
                                             "ICC portal  PlanInformationOnProductLevel_PLES Processed for CDW and Fantomen",
                                             HP.LFT.Report.Status.Failed);
                    }
                    try
                    {
                        iccPortal.SelectValueFromApplicationDropDown(productNumber, "PlanExternalArticleInfo_PLES");
                        iccPortal.VerifySearchResult("PlanExternalArticleInfo_PLES");
                        iccPortal.VerifyPortInSearchResult("MWS");
                        iccPortal.VerifyPortInSearchResult("PRA");
                        Reporter.ReportEvent("ICC portal 'PlanExternalArticleInfo_PLES' Processed for MWS and PRA",
                                             "ICC portal 'PlanExternalArticleInfo_PLES' Processed for MWS and PRA", HP.LFT.Report.Status.Passed);
                    }
                    catch
                    {
                        Reporter.ReportEvent("ICC portal 'PlanExternalArticleInfo_PLES' Processed for MWS and PRA",
                                             "ICC portal 'PlanExternalArticleInfo_PLES' Processed for MWS and PRA", HP.LFT.Report.Status.Failed);
                    }
                    try
                    {
                        iccPortal.SelectValueFromApplicationDropDown(productNumber, "PlanExternalMarketInfo_PLES");
                        iccPortal.VerifySearchResult("PlanExternalMarketInfo_PLES");
                        iccPortal.VerifyPortInSearchResult("MWS");
                        iccPortal.VerifyPortInSearchResult("PRA");
                        Reporter.ReportEvent("ICC portal 'PlanExternalMarketInfo_PLES' Processed for MWS and PRA",
                                             "ICC portal 'PlanExternalMarketInfo_PLES' Processed for MWS and PRA", HP.LFT.Report.Status.Passed);
                    }
                    catch
                    {
                        Reporter.ReportEvent("ICC portal 'PlanExternalMarketInfo_PLES' Processed for MWS and PRA",
                                             "ICC portal 'PlanExternalMarketInfo_PLES' Processed for MWS and PRA", HP.LFT.Report.Status.Failed);
                    }
                    try
                    {
                        iccPortal.SelectValueFromApplicationDropDown(productNumber, "PlanExternalProductInfo_PLES");
                        iccPortal.VerifySearchResult("PlanExternalProductInfo_PLES");
                        iccPortal.VerifyPortInSearchResult("MWS");
                        iccPortal.VerifyPortInSearchResult("PRA");
                        Reporter.ReportEvent("ICC portal 'PlanExternalProductInfo_PLES' Processed for MWS and PRA",
                                             "ICC portal 'PlanExternalProductInfo_PLES' Processed for MWS and PRA", HP.LFT.Report.Status.Passed);
                    }
                    catch
                    {
                        Reporter.ReportEvent("ICC portal 'PlanExternalProductInfo_PLES' Processed for MWS and PRA",
                                             "ICC portal 'PlanExternalProductInfo_PLES' Processed for MWS and PRA", HP.LFT.Report.Status.Failed);
                    }

                    intigrationmon.CloseIntegrationmonitorAndBackToPp();
                }
                catch (Exception ex)
                {
                    intigrationmon.CloseIntegrationmonitorAndBackToPp();
                    Reporter.ReportEvent("Fail to verify ICC portal Section",
                                         "Fail to verify ICC portal Section Exception  : " + ex.StackTrace, HP.LFT.Report.Status.Failed);
                }

                //*****************************************************************
                pPlanPage.get_SelectPlanBtn().Click();
                Reporter.ReportEvent("Clicked on Selecte plan button", "Clicked on Selecte plan button",
                                     HP.LFT.Report.Status.Passed);
                pPlanPage.get_ISWCheckbox().Click();
                pPlanPage.get_ByAllPmButton().Click();
                Reporter.ReportEvent("Clicked on All PM button", "Clicked on All Plan button", HP.LFT.Report.Status.Passed);
                pPlanPage.waitForPageToLoad();
                pPlanPage.waitForSpinnerToDisappear();
                pPlanPage.get_ReadyToOrderButton().Click();
                pPlanPage.waitForPageToLoad();
                pPlanPage.waitForSpinnerToDisappear();
                for (int i = 0; i < 30; i++)
                {
                    if (pPlanPage.get_SelectPlanBtn().GetAttribute("class").Contains("disabled-popup"))
                    {
                        break;
                    }
                }
                Assert.IsTrue((pPlanPage.get_productView_SellPrice().Displayed));
                System.Diagnostics.Debug.WriteLine(pPlanPage.get_orderNumber().GetAttribute("data-content"));
                orderNumber = pPlanPage.get_OderNumberFromUI();
                Reporter.ReportEvent("Order number created", "Order Number created :" + orderNumber,
                                     HP.LFT.Report.Status.Passed);
                xCellFileHelper.SetCellValueByRowAndColumn("Selenium_SmokeTest1", "OrderNumber", orderNumber);
                try
                {
                    intigrationmon.LaunchWindowIntegrationmonitor(orderNumber, ConfigUtils.Read("URL_IMonitor"));
                    intigrationmon.SearchIntegrationmonitor(orderNumber, "BoardcardPlan");
                    Reporter.ReportEvent("Search Integration monitor 'BoardcardPlan' Processed",
                                         "Search Integration monitor 'BoardcardPlan' Processed", HP.LFT.Report.Status.Passed);
                    intigrationmon.CloseIntegrationmonitorAndBackToPp();
                }
                catch (Exception ex)
                {
                    Reporter.ReportEvent("Fail to verify intigration monitor Section",
                                         "Fail to verify intigration monitor Section Exception  : " + ex.StackTrace,
                                         HP.LFT.Report.Status.Failed);
                }
                try
                {
                    iccPortal.LaunchICCWindow();

                    iccPortal.SelectValueFromApplicationDropDownForBoardCard(orderNumber, "BoardcardPlan_PLES");
                    try
                    {
                        iccPortal.VerifySearchResult("BoardcardPlan_PLES");
                        iccPortal.VerifyPortInSearchResult("HMOrder");
                        Reporter.ReportEvent("ICC portal 'BoardcardPlan_PLES' Processed for HMOrder",
                                             "ICC portal 'BoardcardPlan_PLES' Processed for HMOrder", HP.LFT.Report.Status.Passed);
                    }
                    catch
                    {
                        Reporter.ReportEvent("ICC portal 'BoardcardPlan_PLES' Processed for HMOrder",
                                             "ICC portal 'BoardcardPlan_PLES' Processed for HMOrder", HP.LFT.Report.Status.Failed);
                    }



                    intigrationmon.CloseIntegrationmonitorAndBackToPp();
                }
                catch (Exception ex)
                {
                    intigrationmon.CloseIntegrationmonitorAndBackToPp();
                    Reporter.ReportEvent("Fail to verify ICC portal Section",
                                         "Fail to verify ICC portal Section Exception  : " + ex.StackTrace, HP.LFT.Report.Status.Failed);
                }
            }catch (Exception exp)
            {
                string     stimestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss").ToString();
                string     ESSpath    = System.Environment.GetEnvironmentVariable("ProjectWorkingDirectory") + "ImagesPath\\" + stimestamp + ".Png";
                Screenshot sc         = ((ITakesScreenshot)driver).GetScreenshot();
                sc.SaveAsFile(ESSpath, ImageFormat.Png);
                Reporter.ReportEvent("Product Plan Script Execution failed",
                                     "Product Plan Script Execution failed Exception  : " + exp.StackTrace, HP.LFT.Report.Status.Failed, ESSpath);
                System.Diagnostics.Debug.WriteLine("***************** message :" + exp.Message);
                System.Diagnostics.Debug.WriteLine("***************** stack :" + exp.StackTrace);
                Assert.IsTrue(2 == 3);
            }
        }
Пример #11
0
 public LeanFtTest2()
 {
     appModel     = new HMOrderObject();
     datafilePath = System.Environment.GetEnvironmentVariable("ProjectWorkingDirectory") + ConfigUtils.Read("TestDataPath");
 }