From 2d539c0719413692f8537b89d226429177572411 Mon Sep 17 00:00:00 2001 From: Augusto Date: Wed, 1 Jan 2025 19:05:12 +0100 Subject: [PATCH] Removing Resource Annotation, undo changes for the flaky test --- .../functional/test/LoggedForumTest.java | 1 - .../functional/test/LoggedLinksTests.java | 1 - .../functional/test/UnLoggedLinksTests.java | 1 - .../e2e/no_elastest/functional/test/UserTest.java | 1 - .../media/FullTeachingEndToEndEChatTests.java | 1 - .../test/media/FullTeachingEndToEndRESTTests.java | 1 - .../FullTeachingLoggedVideoSessionTests.java | 15 ++++++++------- ...FullTeachingTestEndToEndVideoSessionTests.java | 1 - .../test/student/CourseStudentTest.java | 1 - .../test/teacher/CourseTeacherTest.java | 1 - 10 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/LoggedForumTest.java b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/LoggedForumTest.java index 4bff049..53dd8d4 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/LoggedForumTest.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/LoggedForumTest.java @@ -11,7 +11,6 @@ import com.fullteaching.e2e.no_elastest.utils.ParameterLoader; import com.fullteaching.e2e.no_elastest.utils.Wait; import giis.retorch.annotations.AccessMode; -import giis.retorch.annotations.Resource; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Tag; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/LoggedLinksTests.java b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/LoggedLinksTests.java index 49b5191..119a42d 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/LoggedLinksTests.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/LoggedLinksTests.java @@ -7,7 +7,6 @@ import com.fullteaching.e2e.no_elastest.common.exception.NotLoggedException; import com.fullteaching.e2e.no_elastest.utils.ParameterLoader; import giis.retorch.annotations.AccessMode; -import giis.retorch.annotations.Resource; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/UnLoggedLinksTests.java b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/UnLoggedLinksTests.java index 4edc480..bcf187f 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/UnLoggedLinksTests.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/UnLoggedLinksTests.java @@ -5,7 +5,6 @@ import com.fullteaching.e2e.no_elastest.common.SpiderNavigation; import com.fullteaching.e2e.no_elastest.utils.ParameterLoader; import giis.retorch.annotations.AccessMode; -import giis.retorch.annotations.Resource; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/UserTest.java b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/UserTest.java index 16bb09f..dc8222f 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/UserTest.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/UserTest.java @@ -7,7 +7,6 @@ import com.fullteaching.e2e.no_elastest.common.exception.NotLoggedException; import com.fullteaching.e2e.no_elastest.utils.ParameterLoader; import giis.retorch.annotations.AccessMode; -import giis.retorch.annotations.Resource; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingEndToEndEChatTests.java b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingEndToEndEChatTests.java index 92e472f..99c28ef 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingEndToEndEChatTests.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingEndToEndEChatTests.java @@ -23,7 +23,6 @@ import com.fullteaching.e2e.no_elastest.common.exception.NotLoggedException; import com.fullteaching.e2e.no_elastest.utils.ParameterLoader; import giis.retorch.annotations.AccessMode; -import giis.retorch.annotations.Resource; import org.junit.jupiter.api.*; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingEndToEndRESTTests.java b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingEndToEndRESTTests.java index f2d98bc..d6295ad 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingEndToEndRESTTests.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingEndToEndRESTTests.java @@ -23,7 +23,6 @@ import com.fullteaching.e2e.no_elastest.common.exception.NotLoggedException; import com.fullteaching.e2e.no_elastest.utils.ParameterLoader; import giis.retorch.annotations.AccessMode; -import giis.retorch.annotations.Resource; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Tag; 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 97ac5f5..d00d07a 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 @@ -10,7 +10,6 @@ import com.fullteaching.e2e.no_elastest.utils.ParameterLoader; import com.fullteaching.e2e.no_elastest.utils.Wait; import giis.retorch.annotations.AccessMode; -import giis.retorch.annotations.Resource; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -141,15 +140,17 @@ 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(date)) { // Use JavaScript to set the value of the date input + if(!actualValue.equals(invertedDate)) { // 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), date); + js.executeScript("arguments[0].value = arguments[1];", user.getDriver().findElement(SESSION_LIST_NEW_SESSION_MODAL_DATE), invertedDate); } - user.getWaiter().until(ExpectedConditions.textToBePresentInElementValue(element.findElement(SESSION_LIST_NEW_SESSION_MODAL_DATE), date)); + user.getWaiter().until(ExpectedConditions.textToBePresentInElementValue(element.findElement(SESSION_LIST_NEW_SESSION_MODAL_DATE), invertedDate)); success = true; break; // } catch (TimeoutException e) { @@ -161,7 +162,7 @@ private void introduceSessionDate(BrowserUser user, WebElement element, String d } } /** - * This method gets the current date in the format MMDDYYYY. for the video session name + * This method gets the current date in the format DDMMYYYY. for the video session name */ private String getCurrentDate() { Calendar calendar = Calendar.getInstance(); @@ -169,7 +170,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 "" +(mMonth < 10 ? "0" + mMonth : mMonth) +"/" +(mDay < 10 ? "0" + mDay : mDay) +"/"+ mYear; + return "" + (mDay < 10 ? "0" + mDay : mDay)+"-" + (mMonth < 10 ? "0" + mMonth : mMonth)+"-"+ mYear; } /** * This method gets the current time in the format HHmmA/P, where A/P indicates AM or PM for the video session name @@ -265,4 +266,4 @@ public String loadStudentsData(String path) throws IOException { return key.toString(); } -} +} \ No newline at end of file diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingTestEndToEndVideoSessionTests.java b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingTestEndToEndVideoSessionTests.java index 604633b..7fadad8 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingTestEndToEndVideoSessionTests.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/media/FullTeachingTestEndToEndVideoSessionTests.java @@ -23,7 +23,6 @@ import com.fullteaching.e2e.no_elastest.common.exception.NotLoggedException; import com.fullteaching.e2e.no_elastest.utils.ParameterLoader; import giis.retorch.annotations.AccessMode; -import giis.retorch.annotations.Resource; import org.junit.jupiter.api.*; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/student/CourseStudentTest.java b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/student/CourseStudentTest.java index 61d980c..d942c01 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/student/CourseStudentTest.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/student/CourseStudentTest.java @@ -9,7 +9,6 @@ import com.fullteaching.e2e.no_elastest.utils.ParameterLoader; import com.fullteaching.e2e.no_elastest.utils.Wait; import giis.retorch.annotations.AccessMode; -import giis.retorch.annotations.Resource; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/teacher/CourseTeacherTest.java b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/teacher/CourseTeacherTest.java index 13e00e8..5602726 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/teacher/CourseTeacherTest.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/functional/test/teacher/CourseTeacherTest.java @@ -11,7 +11,6 @@ import com.fullteaching.e2e.no_elastest.utils.ParameterLoader; import com.fullteaching.e2e.no_elastest.utils.Wait; import giis.retorch.annotations.AccessMode; -import giis.retorch.annotations.Resource; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource;