Skip to content

Commit

Permalink
migrate AdminHomePageE2ETest
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricongjh committed Feb 24, 2024
1 parent fdba184 commit a17daa2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
6 changes: 4 additions & 2 deletions src/e2e/java/teammates/e2e/cases/AdminHomePageE2ETest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import org.testng.annotations.Test;

import teammates.common.datatransfer.attributes.AccountRequestAttributes;
import teammates.common.util.AppUrl;
import teammates.common.util.Const;
import teammates.e2e.pageobjects.AdminHomePage;
import teammates.storage.sqlentity.AccountRequest;

/**
* SUT: {@link Const.WebPageURIs#ADMIN_HOME_PAGE}.
Expand All @@ -16,6 +16,8 @@ public class AdminHomePageE2ETest extends BaseE2ETestCase {
protected void prepareTestData() {
testData = loadDataBundle("/AdminHomePageE2ETest.json");
removeAndRestoreDataBundle(testData);
sqlTestData = removeAndRestoreSqlDataBundle(
loadSqlDataBundle("/AdminHomePageE2ETest_SqlEntities.json"));
}

@Test
Expand Down Expand Up @@ -50,7 +52,7 @@ public void testAll() {
BACKDOOR.deleteAccountRequest(email, institute);

______TS("Failure case: Instructor is already registered");
AccountRequestAttributes registeredAccountRequest = testData.accountRequests.get("AHome.instructor1OfCourse1");
AccountRequest registeredAccountRequest = sqlTestData.accountRequests.get("AHome.instructor1OfCourse1");
homePage.queueInstructorForAdding(registeredAccountRequest.getName(),
registeredAccountRequest.getEmail(), registeredAccountRequest.getInstitute());

Expand Down
16 changes: 0 additions & 16 deletions src/e2e/resources/data/AdminHomePageE2ETest.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
{
"accounts": {
"AHome.instructor1OfCourse1": {
"googleId": "tm.e2e.AHome.inst1",
"name": "Teammates Instr1",
"email": "[email protected]"
}
},
"accountRequests": {
"AHome.instructor1OfCourse1": {
"name": "Teammates Instr1",
"email": "[email protected]",
"institute": "TEAMMATES Test Institute 1",
"createdAt": "2011-01-01T00:00:00Z",
"registeredAt": "1970-02-14T00:00:00Z"
}
},
"courses": {
"AHome.typicalCourse1": {
"createdAt": "2012-03-20T23:59:00Z",
Expand Down
19 changes: 19 additions & 0 deletions src/e2e/resources/data/AdminHomePageE2ETest_SqlEntities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"accounts": {
"AHome.instructor1OfCourse1": {
"id": "00000000-0000-4000-8000-000000000001",
"googleId": "tm.e2e.AHome.inst1",
"name": "Teammates Instr1",
"email": "[email protected]"
}
},
"accountRequests": {
"AHome.instructor1OfCourse1": {
"id": "00000000-0000-4000-8000-000000000101",
"name": "Teammates Instr1",
"email": "[email protected]",
"institute": "TEAMMATES Test Institute 1",
"registeredAt": "1970-02-14T00:00:00Z"
}
}
}

0 comments on commit a17daa2

Please sign in to comment.