diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingLoggedVideoSessionTests.java b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingLoggedVideoSessionTests.java index 4145e33..97ac5f5 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingLoggedVideoSessionTests.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingLoggedVideoSessionTests.java @@ -141,17 +141,15 @@ private void introduceSessionDate(BrowserUser user, WebElement element, String d for (int i = 0; i < attempts; i++) { try { user.getDriver().findElement(SESSION_LIST_NEW_SESSION_MODAL_DATE).clear(); - String[] splitDate = date.split("-"); user.getDriver().findElement(SESSION_LIST_NEW_SESSION_MODAL_DATE).sendKeys(date); - String invertedDate = splitDate[2] + "-" + splitDate[1] + "-" + splitDate[0]; String actualValue= user.getDriver().findElement(SESSION_LIST_NEW_SESSION_MODAL_DATE).getAttribute("value"); - if(!actualValue.equals(invertedDate)) { // Use JavaScript to set the value of the date input + if(!actualValue.equals(date)) { // Use JavaScript to set the value of the date input log.info("Selenium sendKeys dont working properly, using JS.."); user.getDriver().findElement(SESSION_LIST_NEW_SESSION_MODAL_DATE).clear(); JavascriptExecutor js = (JavascriptExecutor) user.getDriver(); - js.executeScript("arguments[0].value = arguments[1];", user.getDriver().findElement(SESSION_LIST_NEW_SESSION_MODAL_DATE), invertedDate); + js.executeScript("arguments[0].value = arguments[1];", user.getDriver().findElement(SESSION_LIST_NEW_SESSION_MODAL_DATE), date); } - user.getWaiter().until(ExpectedConditions.textToBePresentInElementValue(element.findElement(SESSION_LIST_NEW_SESSION_MODAL_DATE), invertedDate)); + user.getWaiter().until(ExpectedConditions.textToBePresentInElementValue(element.findElement(SESSION_LIST_NEW_SESSION_MODAL_DATE), date)); success = true; break; // } catch (TimeoutException e) { @@ -163,7 +161,7 @@ private void introduceSessionDate(BrowserUser user, WebElement element, String d } } /** - * This method gets the current date in the format DDMMYYYY. for the video session name + * This method gets the current date in the format MMDDYYYY. for the video session name */ private String getCurrentDate() { Calendar calendar = Calendar.getInstance(); @@ -171,7 +169,7 @@ private String getCurrentDate() { int mYear = calendar.get(Calendar.YEAR); int mMonth = calendar.get(Calendar.MONTH); int mDay = calendar.get(Calendar.DAY_OF_MONTH); - return "" + (mDay < 10 ? "0" + mDay : mDay)+"-" + (mMonth < 10 ? "0" + mMonth : mMonth)+"-"+ mYear; + return "" +(mMonth < 10 ? "0" + mMonth : mMonth) +"/" +(mDay < 10 ? "0" + mDay : mDay) +"/"+ mYear; } /** * This method gets the current time in the format HHmmA/P, where A/P indicates AM or PM for the video session name