From f65b15a5499238bb8ab4beb179fa7994ab85c609 Mon Sep 17 00:00:00 2001 From: WeeJean Date: Mon, 26 Jan 2026 19:08:28 +0800 Subject: [PATCH 01/11] Add E2E Sql test class --- ...tructorStudentActivityLogsPageE2ETest.java | 97 +++++++++++++++++++ src/e2e/resources/testng-unstable-e2e-sql.xml | 1 + 2 files changed, 98 insertions(+) create mode 100644 src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java diff --git a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java new file mode 100644 index 000000000000..f571d71fb91f --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java @@ -0,0 +1,97 @@ +package teammates.e2e.cases.sql; + +import java.time.Instant; +import java.time.ZoneId; +import java.time.temporal.ChronoUnit; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.FeedbackSubmitPageSql; +import teammates.e2e.pageobjects.InstructorStudentActivityLogsPage; +import teammates.storage.sqlentity.Course; +import teammates.storage.sqlentity.FeedbackQuestion; +import teammates.storage.sqlentity.FeedbackResponse; +import teammates.storage.sqlentity.FeedbackSession; +import teammates.storage.sqlentity.Instructor; +import teammates.storage.sqlentity.Student; +import teammates.ui.output.FeedbackQuestionData; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_STUDENT_ACTIVITY_LOGS_PAGE}. + */ +public class InstructorStudentActivityLogsPageE2ETest extends BaseE2ETestCase { + private Instructor instructor; + private Course course; + private FeedbackSession feedbackSession; + private FeedbackQuestion feedbackQuestion; + private Student student; + + @Override + protected void prepareTestData() { + testData = removeAndRestoreDataBundle( + loadSqlDataBundle("/InstructorStudentActivityLogsPageE2ETestSql.json")); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + student = testData.students.get("alice.tmms@ISActLogs.CS2104"); + feedbackQuestion = testData.feedbackQuestions.get("qn1"); + feedbackSession = testData.feedbackSessions.get("openSession"); + } + + @Test + @Override + public void testAll() { + AppUrl url = createFrontendUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_ACTIVITY_LOGS_PAGE) + .withCourseId("tm.e2e.ISActLogs.CS2104"); + InstructorStudentActivityLogsPage studentActivityLogsPage = + loginToPage(url, InstructorStudentActivityLogsPage.class, instructor.getGoogleId()); + + ______TS("verify default datetime"); + String currentLogsFromDate = studentActivityLogsPage.getLogsFromDate(); + String currentLogsToDate = studentActivityLogsPage.getLogsToDate(); + String currentLogsFromTime = studentActivityLogsPage.getLogsFromTime(); + String currentLogsToTime = studentActivityLogsPage.getLogsToTime(); + + studentActivityLogsPage.setLogsFromDateTime( + Instant.now().minus(1, ChronoUnit.DAYS), + ZoneId.of(course.getTimeZone()).getId()); + studentActivityLogsPage.setLogsToDateTime(Instant.now(), ZoneId.of(course.getTimeZone()).getId()); + + assertEquals(currentLogsFromDate, studentActivityLogsPage.getLogsFromDate()); + assertEquals(currentLogsToDate, studentActivityLogsPage.getLogsToDate()); + assertEquals(currentLogsFromTime, "23:59H"); + assertEquals(currentLogsToTime, "23:59H"); + + ______TS("verify logs output"); + logout(); + AppUrl studentSubmissionPageUrl = createFrontendUrl(Const.WebPageURIs.STUDENT_SESSION_SUBMISSION_PAGE) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getName()); + FeedbackSubmitPageSql studentSubmissionPage = loginToPage(studentSubmissionPageUrl, + FeedbackSubmitPageSql.class, student.getGoogleId()); + + Student receiver = testData.students.get("benny.tmms@ISActLogs.CS2104"); + FeedbackQuestionData question = getFeedbackQuestion( + course.getId(), feedbackSession.getName(), feedbackQuestion.getQuestionNumber()); + + FeedbackTextResponseDetails details = new FeedbackTextResponseDetails("Response"); + FeedbackResponse response = FeedbackResponse.makeResponse( + feedbackQuestion, student.getEmail(), student.getSection(), + receiver.getEmail(), receiver.getSection(), details); + + studentSubmissionPage.fillTextResponse(1, receiver.getName(), response); + studentSubmissionPage.clickSubmitQuestionButton(1); + + logout(); + studentActivityLogsPage = loginToPage(url, InstructorStudentActivityLogsPage.class, + instructor.getGoogleId()); + studentActivityLogsPage.setActivityType("session access and submission"); + studentActivityLogsPage.waitForPageToLoad(); + studentActivityLogsPage.startSearching(); + + assertTrue(studentActivityLogsPage.isLogPresentForSession(feedbackSession.getName())); + } +} diff --git a/src/e2e/resources/testng-unstable-e2e-sql.xml b/src/e2e/resources/testng-unstable-e2e-sql.xml index f3b03c0294e9..2679c12e6085 100644 --- a/src/e2e/resources/testng-unstable-e2e-sql.xml +++ b/src/e2e/resources/testng-unstable-e2e-sql.xml @@ -6,6 +6,7 @@ + From e6e97a373e08b466986131fe00af17d89f34d8c6 Mon Sep 17 00:00:00 2001 From: WeeJean Date: Mon, 26 Jan 2026 19:09:51 +0800 Subject: [PATCH 02/11] Add Sql json --- ...ctorStudentActivityLogsPageE2ETestSql.json | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 src/e2e/resources/data/InstructorStudentActivityLogsPageE2ETestSql.json diff --git a/src/e2e/resources/data/InstructorStudentActivityLogsPageE2ETestSql.json b/src/e2e/resources/data/InstructorStudentActivityLogsPageE2ETestSql.json new file mode 100644 index 000000000000..0ac044b55592 --- /dev/null +++ b/src/e2e/resources/data/InstructorStudentActivityLogsPageE2ETestSql.json @@ -0,0 +1,175 @@ +{ + "accounts": { + "instructorWithSessions": { + "id": "00000000-0000-4000-8000-000000000001", + "googleId": "tm.e2e.ISActLogs.instructor", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt" + }, + "alice.tmms@ISActLogs.CS2104": { + "id": "00000000-0000-4000-8000-000000000002", + "googleId": "tm.e2e.ISActLogs.alice.tmms", + "name": "Alice Betsy", + "email": "alice.b.tmms@gmail.tmt" + }, + "benny.tmms@ISActLogs.CS2104": { + "id": "00000000-0000-4000-8000-000000000003", + "googleId": "tm.e2e.ISActLogs.benny.tmms", + "name": "Benny Charles", + "email": "benny.tmms@gmail.tmt" + } + }, + "courses": { + "course": { + "id": "tm.e2e.ISActLogs.CS2104", + "name": "Programming Language Concepts", + "institute": "TEAMMATES Test Institute 1", + "timeZone": "Africa/Johannesburg" + } + }, + "sections": { + "section1": { + "id": "00000000-0000-4000-8000-000000000101", + "course": { + "id": "tm.e2e.ISActLogs.CS2104" + }, + "name": "Section 1" + } + }, + "teams": { + "team1": { + "id": "00000000-0000-4000-8000-000000000201", + "section": { + "id": "00000000-0000-4000-8000-000000000101" + }, + "name": "Team 1" + } + }, + "instructors": { + "instructor": { + "id": "00000000-0000-4000-8000-000000000301", + "account": { + "id": "00000000-0000-4000-8000-000000000001" + }, + "course": { + "id": "tm.e2e.ISActLogs.CS2104" + }, + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "INSTRUCTOR_PERMISSION_ROLE_COOWNER", + "isDisplayedToStudents": true, + "displayName": "Co-owner", + "privileges": { + "courseLevel": { + "canViewStudentInSections": true, + "canSubmitSessionInSections": true, + "canModifySessionCommentsInSections": true, + "canModifyCourse": true, + "canViewSessionInSections": true, + "canModifySession": true, + "canModifyStudent": true, + "canModifyInstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@ISActLogs.CS2104": { + "id": "00000000-0000-4000-8000-000000000401", + "account": { + "id": "00000000-0000-4000-8000-000000000002" + }, + "course": { + "id": "tm.e2e.ISActLogs.CS2104" + }, + "section": { + "id": "00000000-0000-4000-8000-000000000101" + }, + "team": { + "id": "00000000-0000-4000-8000-000000000201" + }, + "name": "Alice Betsy", + "email": "alice.b.tmms@gmail.tmt", + "comments": "This student's name is Alice Betsy" + }, + "benny.tmms@ISActLogs.CS2104": { + "id": "00000000-0000-4000-8000-000000000402", + "account": { + "id": "00000000-0000-4000-8000-000000000003" + }, + "course": { + "id": "tm.e2e.ISActLogs.CS2104" + }, + "section": { + "id": "00000000-0000-4000-8000-000000000101" + }, + "team": { + "id": "00000000-0000-4000-8000-000000000201" + }, + "name": "Benny Charles", + "email": "benny.tmms@gmail.tmt", + "comments": "This student's name is Benny Charles" + } + }, + "feedbackSessions": { + "openSession": { + "id": "00000000-0000-4000-8000-000000000501", + "name": "First Session", + "course": { + "id": "tm.e2e.ISActLogs.CS2104" + }, + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for first session

", + "startTime": "2012-04-01T22:00:00Z", + "endTime": "2026-04-30T22:00:00Z", + "sessionVisibleFromTime": "2012-04-01T22:00:00Z", + "resultsVisibleFromTime": "2026-05-01T22:00:00Z", + "gracePeriod": 10, + "isOpenedEmailEnabled": true, + "isClosingSoonEmailEnabled": true, + "isPublishedEmailEnabled": true, + "isOpeningSoonEmailSent": false, + "isOpenedEmailSent": false, + "isClosingSoonEmailSent": false, + "isClosedEmailSent": false, + "isPublishedEmailSent": false + } + }, + "feedbackQuestions": { + "qn1": { + "id": "00000000-0000-4000-8000-000000000601", + "feedbackSession": { + "id": "00000000-0000-4000-8000-000000000501" + }, + "questionDetails": { + "questionType": "TEXT", + "questionText": "Testing question text" + }, + "description": "

Testing description

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "STUDENTS", + "numOfEntitiesToGiveFeedbackTo": 2, + "showResponsesTo": [ + "STUDENTS", + "INSTRUCTORS", + "OWN_TEAM_MEMBERS", + "RECEIVER" + ], + "showGiverNameTo": [ + "STUDENTS", + "INSTRUCTORS", + "OWN_TEAM_MEMBERS", + "RECEIVER" + ], + "showRecipientNameTo": [ + "STUDENTS", + "INSTRUCTORS", + "OWN_TEAM_MEMBERS", + "RECEIVER" + ] + } + } +} From e4704927b859d687f6899f15b8c03d528f56abab Mon Sep 17 00:00:00 2001 From: WeeJean Date: Sun, 1 Feb 2026 12:03:04 +0800 Subject: [PATCH 03/11] Fix InstructorStudentActivityLogsPage E2ETest timing and logic issues --- ...tructorStudentActivityLogsPageE2ETest.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java index f571d71fb91f..ae200ffe7aa4 100644 --- a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java @@ -4,6 +4,7 @@ import java.time.ZoneId; import java.time.temporal.ChronoUnit; +import org.openqa.selenium.By; import org.testng.annotations.Test; import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; @@ -86,12 +87,27 @@ public void testAll() { studentSubmissionPage.clickSubmitQuestionButton(1); logout(); - studentActivityLogsPage = loginToPage(url, InstructorStudentActivityLogsPage.class, - instructor.getGoogleId()); + studentActivityLogsPage = loginToPage(url, InstructorStudentActivityLogsPage.class, instructor.getGoogleId()); + + studentActivityLogsPage.setLogsFromDateTime(Instant.now().minus(24, ChronoUnit.HOURS), "UTC"); + studentActivityLogsPage.setLogsToDateTime(Instant.now().plus(1, ChronoUnit.HOURS), "UTC"); studentActivityLogsPage.setActivityType("session access and submission"); + studentActivityLogsPage.setSessionDropdown(feedbackSession.getName()); + studentActivityLogsPage.waitForPageToLoad(); studentActivityLogsPage.startSearching(); - - assertTrue(studentActivityLogsPage.isLogPresentForSession(feedbackSession.getName())); + studentActivityLogsPage.waitForElementPresence(By.id("logs-output")); + + if (!studentActivityLogsPage.getLogsOutputText().contains("First Session")) { + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + studentActivityLogsPage.startSearching(); + studentActivityLogsPage.waitForElementPresence(By.id("logs-output")); + } + + assertTrue(studentActivityLogsPage.getLogsOutputText().contains("First Session")); } } From 76f8ab76a1bf2dae6219afbfa30ee08d009f65b3 Mon Sep 17 00:00:00 2001 From: WeeJean Date: Sun, 1 Feb 2026 12:03:29 +0800 Subject: [PATCH 04/11] Fix typo in activity logs Page Object --- .../e2e/pageobjects/InstructorStudentActivityLogsPage.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentActivityLogsPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentActivityLogsPage.java index 33f4b78dd06d..3a3bf4b3d0bd 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentActivityLogsPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentActivityLogsPage.java @@ -107,7 +107,7 @@ public void setStudentName(String studentName) { } public void setLogsFromDateTime(Instant instant, String timeZone) { - setDateTime(logsFromDatepicker, logsToTimepicker, instant, timeZone); + setDateTime(logsFromDatepicker, logsFromTimepicker, instant, timeZone); } public void setLogsToDateTime(Instant instant, String timeZone) { @@ -131,4 +131,8 @@ private void setDateTime(WebElement dateBox, WebElement timeBox, Instant startIn selectDropdownOptionByText(timeBox.findElement(By.tagName("select")), getTimeString(startInstant, timeZone)); } + + public String getLogsOutputText() { + return logsOutput.getText(); + } } From 456ba1bc9054ad40bf5a8520d53ce4b779705b3b Mon Sep 17 00:00:00 2001 From: WeeJean Date: Sun, 1 Feb 2026 12:09:50 +0800 Subject: [PATCH 05/11] Fix Lint --- .../cases/sql/InstructorStudentActivityLogsPageE2ETest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java index ae200ffe7aa4..d68de8510b8a 100644 --- a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java @@ -18,7 +18,6 @@ import teammates.storage.sqlentity.FeedbackSession; import teammates.storage.sqlentity.Instructor; import teammates.storage.sqlentity.Student; -import teammates.ui.output.FeedbackQuestionData; /** * SUT: {@link Const.WebPageURIs#INSTRUCTOR_STUDENT_ACTIVITY_LOGS_PAGE}. @@ -75,8 +74,6 @@ public void testAll() { FeedbackSubmitPageSql.class, student.getGoogleId()); Student receiver = testData.students.get("benny.tmms@ISActLogs.CS2104"); - FeedbackQuestionData question = getFeedbackQuestion( - course.getId(), feedbackSession.getName(), feedbackQuestion.getQuestionNumber()); FeedbackTextResponseDetails details = new FeedbackTextResponseDetails("Response"); FeedbackResponse response = FeedbackResponse.makeResponse( From f9d046772e148431bb51bd4053ba0783d47fd5c7 Mon Sep 17 00:00:00 2001 From: WeeJean Date: Sun, 1 Feb 2026 12:21:50 +0800 Subject: [PATCH 06/11] Refactor e2etest access to selenium API into page object --- .../cases/sql/InstructorStudentActivityLogsPageE2ETest.java | 2 +- .../e2e/pageobjects/InstructorStudentActivityLogsPage.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java index d68de8510b8a..b4a064034835 100644 --- a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java @@ -102,7 +102,7 @@ public void testAll() { e.printStackTrace(); } studentActivityLogsPage.startSearching(); - studentActivityLogsPage.waitForElementPresence(By.id("logs-output")); + studentActivityLogsPage.waitForLogsToLoad(); } assertTrue(studentActivityLogsPage.getLogsOutputText().contains("First Session")); diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentActivityLogsPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentActivityLogsPage.java index 3a3bf4b3d0bd..3e17bccb153a 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentActivityLogsPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentActivityLogsPage.java @@ -135,4 +135,8 @@ private void setDateTime(WebElement dateBox, WebElement timeBox, Instant startIn public String getLogsOutputText() { return logsOutput.getText(); } + + public void waitForLogsToLoad() { + waitForElementPresence(By.id("logs-output")); + } } From 02979ffa798bd6c18de72c466b100c4abedfb401 Mon Sep 17 00:00:00 2001 From: WeeJean Date: Sun, 1 Feb 2026 12:31:50 +0800 Subject: [PATCH 07/11] Refactor e2etest access to selenium API into page object V2 --- .../cases/sql/InstructorStudentActivityLogsPageE2ETest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java index b4a064034835..49944658616a 100644 --- a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java @@ -4,7 +4,6 @@ import java.time.ZoneId; import java.time.temporal.ChronoUnit; -import org.openqa.selenium.By; import org.testng.annotations.Test; import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; @@ -93,7 +92,7 @@ public void testAll() { studentActivityLogsPage.waitForPageToLoad(); studentActivityLogsPage.startSearching(); - studentActivityLogsPage.waitForElementPresence(By.id("logs-output")); + studentActivityLogsPage.waitForLogsToLoad(); if (!studentActivityLogsPage.getLogsOutputText().contains("First Session")) { try { From 5e69c3be302385a630741b302de633fc2bd410f4 Mon Sep 17 00:00:00 2001 From: WeeJean Date: Wed, 4 Feb 2026 18:43:48 +0800 Subject: [PATCH 08/11] Remove thread usage from InstructorStudentActivityLogsPageE2ETest --- .../sql/InstructorStudentActivityLogsPageE2ETest.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java index 49944658616a..5bb25f52c940 100644 --- a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java @@ -94,16 +94,6 @@ public void testAll() { studentActivityLogsPage.startSearching(); studentActivityLogsPage.waitForLogsToLoad(); - if (!studentActivityLogsPage.getLogsOutputText().contains("First Session")) { - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - studentActivityLogsPage.startSearching(); - studentActivityLogsPage.waitForLogsToLoad(); - } - assertTrue(studentActivityLogsPage.getLogsOutputText().contains("First Session")); } } From be63f7f0d671d6d0c5fcc1de57ced3e969f13466 Mon Sep 17 00:00:00 2001 From: Ming Yuan Date: Thu, 5 Feb 2026 22:24:14 +0800 Subject: [PATCH 09/11] Base attempt --- .../cases/sql/InstructorStudentActivityLogsPageE2ETest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java index 5bb25f52c940..4226a97f19a8 100644 --- a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java @@ -85,8 +85,6 @@ public void testAll() { logout(); studentActivityLogsPage = loginToPage(url, InstructorStudentActivityLogsPage.class, instructor.getGoogleId()); - studentActivityLogsPage.setLogsFromDateTime(Instant.now().minus(24, ChronoUnit.HOURS), "UTC"); - studentActivityLogsPage.setLogsToDateTime(Instant.now().plus(1, ChronoUnit.HOURS), "UTC"); studentActivityLogsPage.setActivityType("session access and submission"); studentActivityLogsPage.setSessionDropdown(feedbackSession.getName()); @@ -94,6 +92,6 @@ public void testAll() { studentActivityLogsPage.startSearching(); studentActivityLogsPage.waitForLogsToLoad(); - assertTrue(studentActivityLogsPage.getLogsOutputText().contains("First Session")); + assertTrue(studentActivityLogsPage.isLogPresentForSession(feedbackSession.getName())); } } From e8e4e68f7eb0cc98965dc9286b9a0d9973723d8d Mon Sep 17 00:00:00 2001 From: Ming Yuan Date: Thu, 5 Feb 2026 23:02:09 +0800 Subject: [PATCH 10/11] attempt 2 --- .../sql/InstructorStudentActivityLogsPageE2ETest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java index 4226a97f19a8..0c78d73dec6d 100644 --- a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java @@ -36,8 +36,8 @@ protected void prepareTestData() { instructor = testData.instructors.get("instructor"); course = testData.courses.get("course"); student = testData.students.get("alice.tmms@ISActLogs.CS2104"); - feedbackQuestion = testData.feedbackQuestions.get("qn1"); feedbackSession = testData.feedbackSessions.get("openSession"); + feedbackQuestion = testData.feedbackQuestions.get("qn1"); } @Test @@ -56,8 +56,8 @@ public void testAll() { studentActivityLogsPage.setLogsFromDateTime( Instant.now().minus(1, ChronoUnit.DAYS), - ZoneId.of(course.getTimeZone()).getId()); - studentActivityLogsPage.setLogsToDateTime(Instant.now(), ZoneId.of(course.getTimeZone()).getId()); + ZoneId.systemDefault().getId()); + studentActivityLogsPage.setLogsToDateTime(Instant.now(), ZoneId.systemDefault().getId()); assertEquals(currentLogsFromDate, studentActivityLogsPage.getLogsFromDate()); assertEquals(currentLogsToDate, studentActivityLogsPage.getLogsToDate()); @@ -73,6 +73,8 @@ public void testAll() { FeedbackSubmitPageSql.class, student.getGoogleId()); Student receiver = testData.students.get("benny.tmms@ISActLogs.CS2104"); + feedbackQuestion = testData.feedbackQuestions.get("qn1"); + FeedbackTextResponseDetails details = new FeedbackTextResponseDetails("Response"); FeedbackResponse response = FeedbackResponse.makeResponse( @@ -86,7 +88,7 @@ public void testAll() { studentActivityLogsPage = loginToPage(url, InstructorStudentActivityLogsPage.class, instructor.getGoogleId()); studentActivityLogsPage.setActivityType("session access and submission"); - studentActivityLogsPage.setSessionDropdown(feedbackSession.getName()); + // studentActivityLogsPage.setSessionDropdown(feedbackSession.getName()); studentActivityLogsPage.waitForPageToLoad(); studentActivityLogsPage.startSearching(); From 35c3e75601861d580ab652ee2d6eb523dfbb68fa Mon Sep 17 00:00:00 2001 From: Ming Yuan Date: Thu, 5 Feb 2026 23:12:45 +0800 Subject: [PATCH 11/11] attempt 3 --- .../cases/sql/InstructorStudentActivityLogsPageE2ETest.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java index 0c78d73dec6d..98544aa8c5c3 100644 --- a/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/sql/InstructorStudentActivityLogsPageE2ETest.java @@ -75,7 +75,6 @@ public void testAll() { Student receiver = testData.students.get("benny.tmms@ISActLogs.CS2104"); feedbackQuestion = testData.feedbackQuestions.get("qn1"); - FeedbackTextResponseDetails details = new FeedbackTextResponseDetails("Response"); FeedbackResponse response = FeedbackResponse.makeResponse( feedbackQuestion, student.getEmail(), student.getSection(), @@ -88,12 +87,9 @@ public void testAll() { studentActivityLogsPage = loginToPage(url, InstructorStudentActivityLogsPage.class, instructor.getGoogleId()); studentActivityLogsPage.setActivityType("session access and submission"); - // studentActivityLogsPage.setSessionDropdown(feedbackSession.getName()); - studentActivityLogsPage.waitForPageToLoad(); studentActivityLogsPage.startSearching(); - studentActivityLogsPage.waitForLogsToLoad(); - assertTrue(studentActivityLogsPage.isLogPresentForSession(feedbackSession.getName())); + assertTrue(studentActivityLogsPage.isLogPresentForSession(feedbackQuestion.getFeedbackSessionName())); } }