-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate StudentCourseJoinConfirmationPageE2ETest (#13008)
Co-authored-by: Wei Qing <[email protected]>
- Loading branch information
1 parent
c665348
commit 1027334
Showing
3 changed files
with
216 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
src/e2e/java/teammates/e2e/cases/sql/StudentCourseJoinConfirmationPageE2ETest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package teammates.e2e.cases.sql; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
import teammates.common.util.AppUrl; | ||
import teammates.common.util.Const; | ||
import teammates.e2e.pageobjects.CourseJoinConfirmationPage; | ||
import teammates.e2e.pageobjects.StudentHomePage; | ||
import teammates.storage.sqlentity.Student; | ||
|
||
/** | ||
* SUT: {@link Const.WebPageURIs#JOIN_PAGE}. | ||
*/ | ||
public class StudentCourseJoinConfirmationPageE2ETest extends BaseE2ETestCase { | ||
private Student newStudent; | ||
private String newStudentGoogleId; | ||
|
||
@Override | ||
protected void prepareTestData() { | ||
testData = removeAndRestoreDataBundle(loadSqlDataBundle("/StudentCourseJoinConfirmationPageE2ETestSql.json")); | ||
|
||
newStudent = testData.students.get("[email protected]"); | ||
newStudentGoogleId = testData.accounts.get("alice.tmms").getGoogleId(); | ||
} | ||
|
||
@Test | ||
@Override | ||
public void testAll() { | ||
______TS("Click join link: invalid key"); | ||
String courseId = testData.courses.get("SCJoinConf.CS2104").getId(); | ||
String invalidKey = "invalidKey"; | ||
AppUrl joinLink = createFrontendUrl(Const.WebPageURIs.JOIN_PAGE) | ||
.withRegistrationKey(invalidKey) | ||
.withCourseId(courseId) | ||
.withEntityType(Const.EntityType.STUDENT); | ||
CourseJoinConfirmationPage confirmationPage = loginToPage( | ||
joinLink, CourseJoinConfirmationPage.class, newStudentGoogleId); | ||
|
||
confirmationPage.verifyDisplayedMessage("The course join link is invalid. You may have " | ||
+ "entered the URL incorrectly or the URL may correspond to a/an student that does not exist."); | ||
|
||
______TS("Click join link: valid key"); | ||
joinLink = createFrontendUrl(Const.WebPageURIs.JOIN_PAGE) | ||
.withRegistrationKey(newStudent.getRegKey()) | ||
.withCourseId(courseId) | ||
.withEntityType(Const.EntityType.STUDENT); | ||
confirmationPage = getNewPageInstance(joinLink, CourseJoinConfirmationPage.class); | ||
|
||
confirmationPage.verifyJoiningUser(newStudentGoogleId); | ||
confirmationPage.confirmJoinCourse(StudentHomePage.class); | ||
|
||
______TS("Already joined, no confirmation page"); | ||
|
||
getNewPageInstance(joinLink, StudentHomePage.class); | ||
} | ||
} |
159 changes: 159 additions & 0 deletions
159
src/e2e/resources/data/StudentCourseJoinConfirmationPageE2ETestSql.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
{ | ||
"accounts": { | ||
"SCJoinConf.instr": { | ||
"googleId": "tm.e2e.SCJoinConf.instr", | ||
"name": "Teammates Test", | ||
"email": "[email protected]", | ||
"id": "00000000-0000-4000-8000-000000000001" | ||
}, | ||
"alice.tmms": { | ||
"googleId": "tm.e2e.SCJoinConf.alice", | ||
"name": "Alice B", | ||
"email": "[email protected]", | ||
"id": "00000000-0000-4000-8000-000000000002" | ||
} | ||
}, | ||
"accountRequests": {}, | ||
"courses": { | ||
"SCJoinConf.CS2104": { | ||
"id": "tm.e2e.SCJoinConf.CS2104", | ||
"name": "Programming Language Concepts", | ||
"timeZone": "UTC", | ||
"institute": "TEAMMATES Test Institute 1" | ||
}, | ||
"SCJoinConf.CS1101": { | ||
"id": "tm.e2e.SCJoinConf.CS1101", | ||
"name": "Programming Methodology", | ||
"timeZone": "UTC", | ||
"institute": "TEAMMATES Test Institute 1" | ||
} | ||
}, | ||
"sections": { | ||
"tm.e2e.SCJoinConf.CS2104-None": { | ||
"id": "00000000-0000-4000-8000-000000000201", | ||
"course": { | ||
"id": "tm.e2e.SCJoinConf.CS2104" | ||
}, | ||
"name": "None" | ||
}, | ||
"tm.e2e.SCJoinConf.CS1101-None": { | ||
"id": "00000000-0000-4000-8000-000000000202", | ||
"course": { | ||
"id": "tm.e2e.SCJoinConf.CS1101" | ||
}, | ||
"name": "None" | ||
} | ||
}, | ||
"teams": { | ||
"tm.e2e.SCJoinConf.CS2104-None-Team1": { | ||
"id": "00000000-0000-4000-8000-000000000301", | ||
"section": { | ||
"id": "00000000-0000-4000-8000-000000000201" | ||
}, | ||
"name": "Team 1" | ||
}, | ||
"tm.e2e.SCJoinConf.CS1101-None-Team1": { | ||
"id": "00000000-0000-4000-8000-000000000302", | ||
"section": { | ||
"id": "00000000-0000-4000-8000-000000000202" | ||
}, | ||
"name": "Team 1" | ||
} | ||
}, | ||
"deadlineExtensions": {}, | ||
"instructors": { | ||
"SCJoinConf.instr.CS2104": { | ||
"isDisplayedToStudents": true, | ||
"displayName": "Co-owner", | ||
"role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", | ||
"privileges": { | ||
"courseLevel": { | ||
"canModifyCourse": true, | ||
"canModifyInstructor": true, | ||
"canModifySession": true, | ||
"canModifyStudent": true, | ||
"canViewStudentInSections": true, | ||
"canViewSessionInSections": true, | ||
"canSubmitSessionInSections": true, | ||
"canModifySessionCommentsInSections": true | ||
}, | ||
"sectionLevel": {}, | ||
"sessionLevel": {} | ||
}, | ||
"id": "00000000-0000-4000-8000-000000000501", | ||
"course": { | ||
"id": "tm.e2e.SCJoinConf.CS2104" | ||
}, | ||
"account": { | ||
"id": "00000000-0000-4000-8000-000000000001" | ||
}, | ||
"name": "Teammates Test", | ||
"email": "[email protected]" | ||
}, | ||
"SCJoinConf.instr.CS1101": { | ||
"isDisplayedToStudents": true, | ||
"displayName": "Co-owner", | ||
"role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", | ||
"privileges": { | ||
"courseLevel": { | ||
"canModifyCourse": true, | ||
"canModifyInstructor": true, | ||
"canModifySession": true, | ||
"canModifyStudent": true, | ||
"canViewStudentInSections": true, | ||
"canViewSessionInSections": true, | ||
"canSubmitSessionInSections": true, | ||
"canModifySessionCommentsInSections": true | ||
}, | ||
"sectionLevel": {}, | ||
"sessionLevel": {} | ||
}, | ||
"courseId": "tm.e2e.SCJoinConf.CS1101", | ||
"course": { | ||
"id": "tm.e2e.SCJoinConf.CS1101" | ||
}, | ||
"account": { | ||
"id": "00000000-0000-4000-8000-000000000001" | ||
}, | ||
"name": "Teammates Test", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"students": { | ||
"[email protected]": { | ||
"comments": "This student's name is Amy Betsy", | ||
"id": "00000000-0000-4000-8000-000000000601", | ||
"courseId": "tm.e2e.SCJoinConf.CS2104", | ||
"course": { | ||
"id": "tm.e2e.SCJoinConf.CS2104" | ||
}, | ||
"team": { | ||
"id": "00000000-0000-4000-8000-000000000301" | ||
}, | ||
"name": "Amy Betsy", | ||
"email": "[email protected]" | ||
}, | ||
"[email protected]": { | ||
"comments": "This student's name is Amy Betsy", | ||
"id": "00000000-0000-4000-8000-000000000602", | ||
"courseId": "tm.e2e.SCJoinConf.CS1101", | ||
"course": { | ||
"id": "tm.e2e.SCJoinConf.CS1101" | ||
}, | ||
"account": { | ||
"id": "00000000-0000-4000-8000-000000000002" | ||
}, | ||
"team": { | ||
"id": "00000000-0000-4000-8000-000000000301" | ||
}, | ||
"name": "Amy Betsy", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"feedbackSessions": {}, | ||
"feedbackQuestions": {}, | ||
"feedbackResponses": {}, | ||
"feedbackResponseComments": {}, | ||
"notifications": {}, | ||
"readNotifications": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters