public void FillSubTask(SubTaskEnum subTask, string assignee = "", string estimatedHour = "1h", bool checkBox = false, string fixversion = "", string component = "") { if (fixversion.Length > 0) { FixedVersionValue = fixversion; } if (component.Length > 0) { componentValue = component; } webElement = WaitUntilElementIsPresent(By.Id(subtaskSummaryId)); EnterText(webElement, GetSubTask(subTask)); webElement = WaitUntilElementIsPresent(By.Id(fixesVersionId)); EnterText(webElement, FixedVersionValue); webElement = WaitUntilElementIsPresent(By.Id(componentId)); EnterText(webElement, componentValue); if (assignee.Length <= 0) { webElement = WaitUntilElementIsPresent(By.Id(assignToMeId)); webElement.Click(); } else { webElement = WaitUntilElementIsPresent(By.Id(assigneeInputId)); EnterText(webElement, assignee); } webElement = WaitUntilElementIsPresent(By.Id(timetrackingId)); EnterText(webElement, estimatedHour); webElement = WaitUntilElementIsPresent(By.Id(createAnotherId)); if (checkBox) { if (!webElement.Selected) { webElement.Click(); } } else { if (webElement.Selected) { webElement.Click(); } } webElement = WaitUntilElementIsPresent(By.Id(submitSubTaskId)); webElement.Submit(); System.Console.WriteLine($"SubTask: {GetSubTask(subTask)} created!"); Waits(1); }
public string GetSubTask(SubTaskEnum subTask) { string task = ""; switch (subTask) { case SubTaskEnum.Analysis: task = "Analysis"; break; case SubTaskEnum.Coding: task = "Coding"; break; case SubTaskEnum.UnitTesting: task = "Unit Testing"; break; case SubTaskEnum.CodeReview: task = "Code review"; break; case SubTaskEnum.Recoding: task = "Re-coding (Code changes done after review)"; break; case SubTaskEnum.BugFixing: task = "Bug Fixing"; break; case SubTaskEnum.Documentation: task = "Documentation"; break; default: task = subTask.ToString(); break; } return(task); }