Skip to content

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
  • Loading branch information
augustocristian committed Aug 3, 2024
1 parent 3493a26 commit 7c56a69
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -63,6 +62,7 @@ public static Stream<Arguments> 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -36,14 +37,16 @@ public static Stream<Arguments> 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*//*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand All @@ -30,17 +28,19 @@ public UnLoggedLinksTests() {
}

public static Stream<Arguments> 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 = "[email protected]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,12 +35,14 @@ public static Stream<Arguments> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -25,7 +24,6 @@
import static org.junit.jupiter.api.Assertions.fail;


@ExtendWith(SeleniumJupiter.class)
class CourseStudentTest extends BaseLoggedTest {


Expand All @@ -46,6 +44,7 @@ public static Stream<Arguments> 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
Expand Down

0 comments on commit 7c56a69

Please sign in to comment.