-
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.
Browse files
Browse the repository at this point in the history
* Migrate StudentCourseDetailsPageE2ETest * Add StudentCourseDetailsPageE2ETest to sql xml --------- Co-authored-by: Wei Qing <[email protected]>
- Loading branch information
1 parent
0a0e7c9
commit 10e96cb
Showing
4 changed files
with
235 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/e2e/java/teammates/e2e/cases/sql/StudentCourseDetailsPageE2ETest.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,43 @@ | ||
package teammates.e2e.cases.sql; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
import teammates.common.util.AppUrl; | ||
import teammates.common.util.Const; | ||
import teammates.e2e.pageobjects.StudentCourseDetailsPage; | ||
import teammates.storage.sqlentity.Instructor; | ||
import teammates.storage.sqlentity.Student; | ||
|
||
/** | ||
* SUT: {@link Const.WebPageURIs#STUDENT_COURSE_DETAILS_PAGE}. | ||
*/ | ||
public class StudentCourseDetailsPageE2ETest extends BaseE2ETestCase { | ||
|
||
@Override | ||
protected void prepareTestData() { | ||
testData = removeAndRestoreDataBundle( | ||
loadSqlDataBundle("/StudentCourseDetailsPageE2ETestSql.json")); | ||
} | ||
|
||
@Test | ||
@Override | ||
public void testAll() { | ||
|
||
AppUrl url = createFrontendUrl(Const.WebPageURIs.STUDENT_COURSE_DETAILS_PAGE) | ||
.withCourseId("tm.e2e.SCDet.CS2104"); | ||
StudentCourseDetailsPage detailsPage = loginToPage(url, StudentCourseDetailsPage.class, | ||
testData.accounts.get("SCDet.alice").getGoogleId()); | ||
|
||
______TS("verify loaded data"); | ||
Instructor[] instructors = { testData.instructors.get("SCDet.instr"), | ||
testData.instructors.get("SCDet.instr2") }; | ||
Student[] teammates = { testData.students.get("SCDet.benny"), | ||
testData.students.get("SCDet.charlie") }; | ||
|
||
detailsPage.verifyCourseDetails(testData.courses.get("SCDet.CS2104")); | ||
detailsPage.verifyInstructorsDetails(instructors); | ||
detailsPage.verifyStudentDetails(testData.students.get("SCDet.alice")); | ||
detailsPage.sortTeammatesByName(); | ||
detailsPage.verifyTeammatesDetails(teammates); | ||
} | ||
} |
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
152 changes: 152 additions & 0 deletions
152
src/e2e/resources/data/StudentCourseDetailsPageE2ETestSql.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,152 @@ | ||
{ | ||
"accounts": { | ||
"SCDet.instr": { | ||
"googleId": "tm.e2e.SCDet.instr", | ||
"name": "Instructor", | ||
"email": "[email protected]", | ||
"id": "00000000-0000-4000-8000-000000000001" | ||
}, | ||
"SCDet.alice": { | ||
"googleId": "tm.e2e.SCDet.alice", | ||
"email": "[email protected]", | ||
"name": "Alice Betsy", | ||
"id": "00000000-0000-4000-8000-000000000002" | ||
} | ||
}, | ||
"accountRequests": {}, | ||
"courses": { | ||
"SCDet.CS2104": { | ||
"id": "tm.e2e.SCDet.CS2104", | ||
"name": "Programming Language Concepts", | ||
"timeZone": "UTC", | ||
"institute": "TEAMMATES Test Institute 1", | ||
"createdAt": "2012-04-02T11:00:00Z" | ||
} | ||
}, | ||
"sections": { | ||
"tm.e2e.SCDet.CS2104-None": { | ||
"id": "00000000-0000-4000-8000-000000000201", | ||
"course": { | ||
"id": "tm.e2e.SCDet.CS2104" | ||
}, | ||
"name": "None" | ||
} | ||
}, | ||
"teams": { | ||
"tm.e2e.SCDet.CS2104-None-Team1": { | ||
"id": "00000000-0000-4000-8000-000000000301", | ||
"section": { | ||
"id": "00000000-0000-4000-8000-000000000201" | ||
}, | ||
"name": "Team 1" | ||
} | ||
}, | ||
"deadlineExtensions": {}, | ||
"instructors": { | ||
"SCDet.instr": { | ||
"isDisplayedToStudents": true, | ||
"displayName": "Instructor", | ||
"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", | ||
"courseId": "tm.e2e.SCDet.CS2104", | ||
"course": { | ||
"id": "tm.e2e.SCDet.CS2104" | ||
}, | ||
"account": { | ||
"id": "00000000-0000-4000-8000-000000000001" | ||
}, | ||
"name": "Teammates Test", | ||
"email": "[email protected]" | ||
}, | ||
"SCDet.instr2": { | ||
"isDisplayedToStudents": true, | ||
"displayName": "Instructor", | ||
"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-000000000502", | ||
"courseId": "tm.e2e.SCDet.CS2104", | ||
"course": { | ||
"id": "tm.e2e.SCDet.CS2104" | ||
}, | ||
"name": "Teammates Test 2", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"students": { | ||
"SCDet.alice": { | ||
"comments": "This student's name is Alice Betsy", | ||
"id": "00000000-0000-4000-8000-000000000601", | ||
"courseId": "tm.e2e.SCDet.CS2104", | ||
"course": { | ||
"id": "tm.e2e.SCDet.CS2104" | ||
}, | ||
"team": { | ||
"id": "00000000-0000-4000-8000-000000000301" | ||
}, | ||
"account": { | ||
"id": "00000000-0000-4000-8000-000000000002" | ||
}, | ||
"name": "Alice Betsy", | ||
"email": "[email protected]" | ||
}, | ||
"SCDet.benny": { | ||
"comments": "This student's name is Benny Charles", | ||
"id": "00000000-0000-4000-8000-000000000602", | ||
"courseId": "tm.e2e.SCDet.CS2104", | ||
"course": { | ||
"id": "tm.e2e.SCDet.CS2104" | ||
}, | ||
"team": { | ||
"id": "00000000-0000-4000-8000-000000000301" | ||
}, | ||
"name": "Benny Charles", | ||
"email": "[email protected]" | ||
}, | ||
"SCDet.charlie": { | ||
"comments": "This student's name is Charlie Davis", | ||
"id": "00000000-0000-4000-8000-000000000603", | ||
"courseId": "tm.e2e.SCDet.CS2104", | ||
"course": { | ||
"id": "tm.e2e.SCDet.CS2104" | ||
}, | ||
"team": { | ||
"id": "00000000-0000-4000-8000-000000000301" | ||
}, | ||
"name": "Charlie Davis", | ||
"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