public void CopyFromCreateJobOrder() { try { var datarows = EllisHome.Initialize(ExcelFileNames.JobOrder); foreach ( var dataRow in datarows.TakeWhile(dataRow => dataRow.ItemArray[1].ToString().Equals("CreateJobOrder"))) { if (dataRow.ItemArray[1].ToString().Equals("CreateJobOrder")) { //Console.WriteLine(dataRow.ItemArray[1]); var jobOrderCreated = JobOrderWindow.CreateNewJobOrder(dataRow); Factory.AssertIsTrue(jobOrderCreated, "Job order not saved successfully"); //Copy Job Order Details from opened job order var status = CopyJobOrder.CopyJobOrderDetails(); if (status) { OpenJobOrder.CloseJobOrderProfile(); } JobOrderWindow.ClickOnButton("Cancel"); Factory.AssertIsTrue(status, "Job Order not copied successfully"); } } } finally { Cleanup(); } }
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 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(); } }