Ejemplo n.º 1
0
        public void CreateJobOrder()
        {
            WindowsActions.KillEllisProcesses();
            App = EllisHome.LaunchEllisAsCSRUser();

            var datarows = ExcelReader.ImportSpreadsheet(ExcelFileNames.JobOrder);

            foreach (var dataRow in datarows.Where(x => x.ItemArray[1].ToString().Equals("CreateJobOrder")))
            {
                //Console.WriteLine(dataRow.ItemArray[1]);
                var jobOrderCreated = JobOrderWindow.CreateNewJobOrder(dataRow);
                Factory.AssertIsTrue(jobOrderCreated, "Job order not saved successfully");
                JobOrderWindow.CloseJobOrderProfileWindow();
            }
        }
        public void DispatchSearch()
        {
            var datarows = Initialize();

            foreach (var datarow in datarows.Where(datarow => datarow.ItemArray[4].ToString().Equals("Dispatch")))
            {
                Console.WriteLine(datarow.ItemArray[3]);
                SearchWindow.SelectSearchElements(datarow.ItemArray[5].ToString(), "Dispatch",
                                                  SearchWindow.SearchTypeConstants.Simple);
                SearchWindow.SelectJobOrderFromResults();

                Factory.AssertIsTrue(JobOrderWindow.VerifyDispatchStatusDisplayed(), "Dispatch status is not displayed for selected job order");
                JobOrderWindow.CloseJobOrderProfileWindow();
                SimpleSearchWindow.CloseResultsWindow();
            }
            Cleanup();
        }
Ejemplo n.º 3
0
        public void CancelNewJobOrder()
        {
            try
            {
                var runStatus = string.Empty;
                var datarows  = EllisHome.Initialize(ExcelFileNames.JobOrder);
                foreach (var dataRow in datarows.Where(x => x.ItemArray[1].Equals("CreateJobOrder")))
                {
                    //Data in "CancelJobOrderNotes" field is mandetory in TestData
                    if (dataRow.ItemArray[77].ToString() != String.Empty &&
                        dataRow.ItemArray[78].ToString() != String.Empty)
                    {
                        var jobOrderCreated = JobOrderWindow.CreateNewJobOrder(dataRow);
                        Factory.AssertIsTrue(jobOrderCreated, "Job order not saved successfully");
                        //Get job Order Number
                        Playback.Wait(3000);
                        Globals.JobOrderNo = JobOrderWindow.GetJobOrderNumber();
                        JobOrderWindow.CloseJobOrderProfileWindow();
                        //Cancel newly created job order
                        LandingPage.SelectFromToolbar("Job Orders");
                        TableActions.OpenRecordFromTable(EllisWindow, "_grdJobOrders", "Job Order #", Globals.JobOrderNo);
                        var joprofile = OpenJobOrder.JobOrderProfileWindowProperties();
                        if (joprofile.Exists)
                        {
                            MouseActions.ClickButton(joprofile, "btnCancelJobOrder");
                            //CancelJobOrder.CancelNewJobOrder();
                            CancelJobOrder.EnterJobOrderNotes(dataRow.ItemArray[77].ToString(), dataRow.ItemArray[78].ToString());
                            var cancelStatus = CancelJobOrder.HandleAlertWindow();
                            Factory.AssertIsTrue(cancelStatus, "Job Order not canceled");

                            //Closing the newly created job order window
                            JobOrderWindow.CloseJobOrderProfileWindow();
                        }
                    }
                }
            }
            finally
            {
                Cleanup();
            }
        }
Ejemplo n.º 4
0
        public void CancelExistingJobOrder()
        {
            try
            {
                var dataRows = EllisHome.Initialize(ExcelFileNames.JobOrder);

                foreach (var data in dataRows.Where(dataRow => dataRow.ItemArray[1].ToString().Equals("CancelJobOrder")))
                {
                    if (data.ItemArray[77].ToString() != "" && data.ItemArray[78].ToString() != "")
                    {
                        LandingPage.SelectFromToolbar("Job Orders");
                        var recordStatus = CopyJobOrder.OpenAnyJobOrder();

                        if (recordStatus)
                        {
                            var joprofile = OpenJobOrder.JobOrderProfileWindowProperties();
                            MouseActions.ClickButton(joprofile, "btnCancelJobOrder");
                            CancelJobOrder.CancelNewJobOrder();
                            CancelJobOrder.EnterJobOrderNotes(data.ItemArray[77].ToString(), data.ItemArray[78].ToString());
                            var cancelStatus = CancelJobOrder.HandleAlertWindow();
                            Factory.AssertIsTrue(cancelStatus, "Job Order not canceled");

                            //Closing the newly created job order window
                            JobOrderWindow.CloseJobOrderProfileWindow();
                        }
                        else
                        {
                            Console.WriteLine("No Job order found.");
                        }
                    }
                }
            }
            finally
            {
                Cleanup();
            }
        }
Ejemplo n.º 5
0
        public void CopyAndCreateJobOrder()
        {
            try
            {
                //Create job order from a copied details
                var datarows = EllisHome.Initialize(ExcelFileNames.JobOrder);
                foreach (var dataRow in datarows.Where(dataRow => dataRow.ItemArray[1].ToString().Equals("CopyJobOrder")))
                {
                    LandingPage.SelectFromToolbar("Job Orders");
                    //TableActions.OpenRecordFromTable(EllisWindow, "_grdJobOrders", "Job Order #", dataRow.ItemArray[2].ToString());
                    CopyJobOrder.OpenAnyJobOrder();
                    //Copy Job Order Details from opened job order
                    var status = CopyJobOrder.CopyJobOrderDetails();

                    if (status)
                    {
                        //Console.WriteLine(dataRow.ItemArray[1]);
                        //JobOrderWindow.EnterJobOrderData(dataRow);
                        //JobOrderWindow.ClickOnButton("Search");

                        //Playback.Wait(3000);
                        JobOrderWindow.ClickOnContinueBtn();
                        Windows.CustomerWindow.CustomerProfileWindow.CloseWarningWindow();
                        //// Find Quote Tab/Window
                        //Playback.Wait(3000);
                        //JobOrderFindQuoteWindow.EnterJobOrderFindQuoteData(dataRow);
                        //JobOrderFindQuoteWindow.ClickOnButton("GO");
                        Playback.Wait(2000);
                        JobOrderWindow.ClickOnContinueBtn();

                        // Enter Basic Job Order Details
                        BasicJobInformationWindow.EnterBasicJobInformationWindowData(dataRow);
                        BasicJobInformationWindow.ClickOnContinueBtn();

                        status = PreQualifyingQuestionsWindow.HandleAlertWindow();
                        if (status)
                        {
                            Factory.AssertIsFalse(status, "Job Order alredy exist for this customer");
                        }
                        else
                        {
                            // Enter Schedule And Additional Charges Details
                            ScheduleAndAdditionalChargesWindow.EnterDataInScheduleAndAdditionalChargesWindow(dataRow);
                            ScheduleAndAdditionalChargesWindow.ClickOnAddNotesBtn();

                            // Enter Order Notes in Schedule And Additional Charges window
                            ScheduleAndAdditionalChargesWindow.EnterDataInJobOrderNotesWindow(dataRow);

                            // Focus back to Schedule And Additional Charges window
                            ScheduleAndAdditionalChargesWindow.ClickOnContinueBtn();

                            //Enter data in Requirements window
                            RequirementsWindow.EnterDatainRequirementsWindow(dataRow);
                            RequirementsWindow.ClickOnButton("Continue >");
                            Playback.Wait(3000);

                            //Enter data in Pre-Qualifying Requirements Window

                            PreQualifyingQuestionsWindow.ClickonSaveButton();
                            PreQualifyingQuestionsWindow.HandleChooseLocationWindow();
                            PreQualifyingQuestionsWindow.HandleWorkLocationWindow();
                            Playback.Wait(3000);
                            status = PreQualifyingQuestionsWindow.HandleAlertWindow();
                            Factory.AssertIsTrue(status, "Job order not saved successfully");
                            JobOrderWindow.CloseJobOrderProfileWindow();
                            JobOrderWindow.CloseJobOrderProfileWindow();
                        }
                    }
                }
            }
            finally
            {
                Cleanup();
            }
        }