diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/common/BaseLoggedTest.java b/src/test/java/com/fullteaching/e2e/no_elastest/common/BaseLoggedTest.java index 02a1d81..68377ba 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/common/BaseLoggedTest.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/common/BaseLoggedTest.java @@ -111,7 +111,7 @@ void setup(TestInfo info) { //65 lines log.info("##### Start test: {}" , info.getDisplayName()); TJOB_NAME = System.getProperty("dirtarget"); - teacher = setupBrowser("chrome", TJOB_NAME + "_" + info.getDisplayName()+"-TEACHER", userMail, WAIT_SECONDS); + teacher = setupBrowser("chrome", TJOB_NAME + "_" + info.getDisplayName(), "Teacher", WAIT_SECONDS); driver = teacher.getDriver(); 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 74fa4d9..1521fa6 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 @@ -12,7 +12,6 @@ import giis.retorch.annotations.AccessMode; import giis.retorch.annotations.Resource; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Tag; import org.junit.jupiter.params.ParameterizedTest; @@ -63,6 +62,7 @@ public static Stream data() throws IOException { @AccessMode(resID = "OpenVidu", concurrency = 10, sharing = true, accessMode = "NOACCESS") @Resource(resID = "Course", replaceable = {"Forum"}) @AccessMode(resID = "Course", concurrency = 10, sharing = true, accessMode = "READONLY") + @DisplayName("studentCourseMainTest") @ParameterizedTest @MethodSource("data") void forumLoadEntriesTest(String mail, String password, String role) { //47lines +115 +28 set up +13 lines teardown =203 @@ -131,6 +131,7 @@ void forumLoadEntriesTest(String mail, String password, String role) { //47lines @AccessMode(resID = "OpenVidu", concurrency = 10, sharing = true, accessMode = "NOACCESS") @Resource(resID = "Course", replaceable = {"Forum"}) @AccessMode(resID = "Course", concurrency = 1, sharing = false, accessMode = "READWRITE") + @DisplayName("studentCourseMainTest") @ParameterizedTest @MethodSource("data") void forumNewEntryTest(String mail, String password, String role) {// 48+ 104 + 28 set up +13 lines teardown =193 @@ -208,6 +209,7 @@ void forumNewEntryTest(String mail, String password, String role) {// 48+ 104 + @AccessMode(resID = "OpenVidu", concurrency = 10, sharing = true, accessMode = "NOACCESS") @Resource(resID = "Course", replaceable = {"Forum"}) @AccessMode(resID = "Course", concurrency = 1, sharing = false, accessMode = "READWRITE") + @DisplayName("forumNewCommentTest") @ParameterizedTest @MethodSource("data") void forumNewCommentTest(String mail, String password, String role) { // 69+142 + 28 set up +13 lines teardown =252 @@ -296,15 +298,17 @@ void forumNewCommentTest(String mail, String password, String role) { // 69+142 * previously created, go to the first and replies to the same comment.After it, we check * that the comment was correctly published. */ - @Disabled - @ParameterizedTest - @MethodSource("data") + + @Resource(resID = "LoginService", replaceable = {}) @AccessMode(resID = "LoginService", concurrency = 10, sharing = true, accessMode = "READONLY") @Resource(resID = "OpenVidu", replaceable = {"OpenViduMock"}) @AccessMode(resID = "OpenVidu", concurrency = 10, sharing = true, accessMode = "NOACCESS") @Resource(resID = "Course", replaceable = {"Forum"}) @AccessMode(resID = "Course", concurrency = 1, sharing = false, accessMode = "READWRITE") + @DisplayName("forumNewReply2CommentTest") + @ParameterizedTest + @MethodSource("data") void forumNewReply2CommentTest(String mail, String password, String role) { // 63+137+ 28 set up +13 lines teardown = 242 this.slowLogin(teacher, mail, password);//24 lines Calendar calendar = Calendar.getInstance(); 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 4f81e9b..df9a7cb 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 @@ -6,6 +6,7 @@ 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; import org.junit.jupiter.params.provider.MethodSource; @@ -36,14 +37,16 @@ public static Stream data() throws IOException { * that the response of the rest service was KO* */ - @ParameterizedTest - @MethodSource("data") + @Resource(resID = "LoginService", replaceable = {}) @AccessMode(resID = "LoginService", concurrency = 10, sharing = true, accessMode = "READONLY") @Resource(resID = "OpenVidu", replaceable = {"OpenViduMock"}) @AccessMode(resID = "OpenVidu", concurrency = 10, sharing = true, accessMode = "NOACCESS") @Resource(resID = "Course", replaceable = {}) @AccessMode(resID = "Course", concurrency = 15, sharing = true, accessMode = "READWRITE") + @ParameterizedTest + @MethodSource("data") + @DisplayName("spiderLoggedTest") void spiderLoggedTest(String mail, String password, String role) { //140 + 28 set up +13 lines teardown = 181 this.slowLogin(teacher, mail, password); //*navigate from home*//* 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 d3ae0a7..0bd33fe 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 @@ -6,11 +6,11 @@ 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; import org.junit.jupiter.params.provider.MethodSource; import org.openqa.selenium.WebElement; -import org.slf4j.Logger; import java.io.IOException; import java.util.ArrayList; @@ -19,9 +19,7 @@ import java.util.Map; import java.util.stream.Stream; -import static java.lang.invoke.MethodHandles.lookup; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.slf4j.LoggerFactory.getLogger; class UnLoggedLinksTests extends BaseLoggedTest { @@ -30,17 +28,19 @@ public UnLoggedLinksTests() { } public static Stream data() throws IOException { - return ParameterLoader.getTestUsers(); + return ParameterLoader.getTestTeachers(); } - @ParameterizedTest - @MethodSource("data") + @Resource(resID = "LoginService", replaceable = {}) @AccessMode(resID = "LoginService", concurrency = 10, sharing = true, accessMode = "READONLY") @Resource(resID = "OpenVidu", replaceable = {"OpenViduMock"}) @AccessMode(resID = "OpenVidu", concurrency = 10, sharing = true, accessMode = "NOACCESS") @Resource(resID = "Course", replaceable = {}) @AccessMode(resID = "Course", concurrency = 15, sharing = true, accessMode = "READWRITE") + @ParameterizedTest + @MethodSource("data") + @DisplayName("spiderUnloggedTest") void spiderUnloggedTest(String mail, String password, String role) { //125 lines + 28 set up +13 lines teardown = 166 userMail = "nonloged@gmail.com"; 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 7c8f3cf..d4d7529 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 @@ -9,6 +9,7 @@ import giis.retorch.annotations.AccessMode; import giis.retorch.annotations.Resource; import io.github.bonigarcia.seljup.SeleniumJupiter; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -34,12 +35,14 @@ public static Stream data() throws IOException { * was logged correctly */ - @ParameterizedTest - @MethodSource("data") + @Resource(resID = "LoginService", replaceable = {}) @AccessMode(resID = "LoginService", concurrency = 10, sharing = true, accessMode = "READONLY") @Resource(resID = "OpenVidu", replaceable = {"OpenViduMock"}) @AccessMode(resID = "OpenVidu", concurrency = 10, sharing = true, accessMode = "NOACCESS") + @ParameterizedTest + @MethodSource("data") + @DisplayName("loginTest") void loginTest(String mail, String password, String role) { //22 +85 +28 set up +13 lines teardown =148 try { this.slowLogin(teacher, mail, password); //24 lines 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 75c6923..12100a9 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 @@ -8,8 +8,7 @@ import com.fullteaching.e2e.no_elastest.utils.Wait; import giis.retorch.annotations.AccessMode; import giis.retorch.annotations.Resource; -import io.github.bonigarcia.seljup.SeleniumJupiter; -import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -25,7 +24,6 @@ import static org.junit.jupiter.api.Assertions.fail; -@ExtendWith(SeleniumJupiter.class) class CourseStudentTest extends BaseLoggedTest { @@ -46,6 +44,7 @@ public static Stream data() throws IOException { @AccessMode(resID = "LoginService", concurrency = 10, sharing = true, accessMode = "READONLY") @Resource(resID = "OpenVidu", replaceable = {"OpenViduMock"}) @AccessMode(resID = "OpenVidu", concurrency = 10, sharing = true, accessMode = "NOACCESS") + @DisplayName("studentCourseMainTest") @ParameterizedTest @MethodSource("data") void studentCourseMainTest(String userMail, String password, String role) {//45+ 107+28 set up +13 lines teardown =193