public bool selectDate(String strDate) { try { By arrowNext = By.XPath("//div[@class='monthBlock last']//a[@class='nextMonth ']"); By locMonth = By.XPath("//div[@class='monthBlock first']//div[@class='title']"); DateTime locDate = DateTime.ParseExact(strDate, "dd/MM/yyyy", CultureInfo.InvariantCulture); int day = locDate.Day; int month = locDate.Month; int year = locDate.Year; MONTH MonthName = (MONTH)(month - 1); String currentMonth = objBaseTest.getObjDriver().FindElement(locMonth).Text; while (!currentMonth.Contains(MonthName.ToString())) { objBaseTest.getObjDriver().FindElement(arrowNext).Click(); Console.WriteLine("Click on next arrow"); break; } By date = By.XPath("//div[@class='monthBlock first']//div[@class='title']/parent::div/following-sibling::table/tbody/tr/td/a[text()='" + day + "']"); objBaseTest.getObjDriver().FindElement(date).Click(); return(true); } catch (Exception e) { Console.WriteLine(e); return(false); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testApplicationCsvDurationReportByMonth() public virtual void testApplicationCsvDurationReportByMonth() { Response response = given().queryParam("reportType", "duration").queryParam("periodUnit", "month").accept("application/csv").then().expect().statusCode(Status.OK.StatusCode).contentType("application/csv").header("Content-Disposition", "attachment; filename=process-instance-report.csv").when().get(HISTORIC_PROCESS_INSTANCE_REPORT_URL); string responseContent = response.asString(); assertTrue(responseContent.Contains(ReportResultToCsvConverter.DURATION_HEADER)); assertTrue(responseContent.Contains(MONTH.ToString())); assertTrue(responseContent.Contains(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_AVG.ToString())); assertTrue(responseContent.Contains(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MIN.ToString())); assertTrue(responseContent.Contains(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MAX.ToString())); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testDurationReportByMonth() public virtual void testDurationReportByMonth() { Response response = given().queryParam("periodUnit", "month").queryParam("reportType", "duration").then().expect().statusCode(Status.OK.StatusCode).contentType(ContentType.JSON).when().get(HISTORIC_PROCESS_INSTANCE_REPORT_URL); string content = response.asString(); IList <string> reports = from(content).getList(""); Assert.assertEquals("There should be one report returned.", 1, reports.Count); Assert.assertNotNull("The returned report should not be null.", reports[0]); long returnedAvg = from(content).getLong("[0].average"); long returnedMax = from(content).getLong("[0].maximum"); long returnedMin = from(content).getLong("[0].minimum"); int returnedPeriod = from(content).getInt("[0].period"); string returnedPeriodUnit = from(content).getString("[0].periodUnit"); Assert.assertEquals(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_AVG, returnedAvg); Assert.assertEquals(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MAX, returnedMax); Assert.assertEquals(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_MIN, returnedMin); Assert.assertEquals(EXAMPLE_HISTORIC_PROC_INST_DURATION_REPORT_PERIOD, returnedPeriod); Assert.assertEquals(MONTH.ToString(), returnedPeriodUnit); }
public void selectDate(String strDate) { By arrowNext = By.XPath("//div[@class='monthBlock last']//a[@class='nextMonth ']"); By locMonth = By.XPath("//div[@class='monthBlock first']//div[@class='title']"); DateTime locDate = DateTime.ParseExact(strDate, "dd/MM/yyyy", CultureInfo.InvariantCulture); int day = locDate.Day; Console.WriteLine("Day" + day); int month = locDate.Month; Console.WriteLine("Month" + month); int year = locDate.Year; Console.WriteLine("year" + year); MONTH MonthName = (MONTH)(month - 1); Console.WriteLine("Month name " + MonthName.ToString()); String currentMonth = objBaseTestClass.GetObjdriver().FindElement(locMonth).Text; while (!currentMonth.Contains(MonthName.ToString()) && !currentMonth.Contains(year.ToString())) { this.clickOnElement(arrowNext); objBaseTestClass.GetObjdriver().FindElement(arrowNext).Click(); Console.WriteLine("Click on next arrow"); break; } By date = By.XPath("//div[@class='monthBlock first']//div[@class='title']/parent::div/following-sibling::table/tbody/tr/td/a[text()='" + day + "']"); this.clickOnElement(date); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testTaskDurationReportByMonth() public virtual void testTaskDurationReportByMonth() { given().queryParam("periodUnit", "month").queryParam("reportType", "duration").then().expect().statusCode(Status.OK.StatusCode).contentType(ContentType.JSON).body("[0].average", equalTo((int)EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_AVG)).body("[0].maximum", equalTo((int)EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_MAX)).body("[0].minimum", equalTo((int)EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_MIN)).body("[0].period", equalTo(EXAMPLE_HISTORIC_TASK_INST_DURATION_REPORT_PERIOD)).body("[0].periodUnit", equalTo(MONTH.ToString())).when().get(TASK_REPORT_URL); verify(mockedReportQuery).duration(PeriodUnit.MONTH); verifyNoMoreInteractions(mockedReportQuery); }