From b13547f60d01b2dfe59bb8dbf403d18621d30824 Mon Sep 17 00:00:00 2001 From: "kristof.deak" Date: Fri, 19 Dec 2025 00:38:15 +0100 Subject: [PATCH] Extend Conferences E2E test with testing expand/collapse. Add some copyright to some test classes. refs: MBL-19504 affects: Student release note: - --- .../ui/e2e/classic/CollaborationsE2ETest.kt | 16 ++++++++++ .../ui/e2e/classic/ConferencesE2ETest.kt | 32 ++++++++++++++++++- .../student/ui/e2e/classic/GradesE2ETest.kt | 16 ++++++++++ .../e2e/classic/PushNotificationsE2ETest.kt | 16 ++++++++++ .../ui/pages/classic/ConferenceListPage.kt | 9 ++++++ 5 files changed, 88 insertions(+), 1 deletion(-) diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/CollaborationsE2ETest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/CollaborationsE2ETest.kt index bc426faa67..d69a008025 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/CollaborationsE2ETest.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/CollaborationsE2ETest.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2019 - present Instructure, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ package com.instructure.student.ui.e2e.classic import android.util.Log diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/ConferencesE2ETest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/ConferencesE2ETest.kt index 0d4a3c27c0..bf8ed827c7 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/ConferencesE2ETest.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/ConferencesE2ETest.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2019 - present Instructure, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ package com.instructure.student.ui.e2e.classic import android.util.Log @@ -16,6 +32,7 @@ import org.junit.Test @HiltAndroidTest class ConferencesE2ETest: StudentTest() { + override fun displaysPageObjects() = Unit override fun enableAndConfigureAccessibilityChecks() = Unit @@ -72,6 +89,20 @@ class ConferencesE2ETest: StudentTest() { conferenceListPage.assertConferenceStatus(testConferenceTitle2,"Not Started") conferenceListPage.assertConferenceDescription(testConferenceTitle2, testConferenceDescription2) + Log.d(STEP_TAG, "Click on the expand/collapse button to COLLAPSE the 'New Conferences' group.") + conferenceListPage.clickExpandCollapseGroup("New Conferences") + + Log.d(ASSERTION_TAG, "Assert that both '$testConferenceTitle' and '$testConferenceTitle2' conferences are NOT displayed after collapsing the 'New Conferences' group.") + conferenceListPage.assertConferenceNotDisplayed(testConferenceTitle) + conferenceListPage.assertConferenceNotDisplayed(testConferenceTitle2) + + Log.d(STEP_TAG, "Click on the expand/collapse button to EXPAND the 'New Conferences' group.") + conferenceListPage.clickExpandCollapseGroup("New Conferences") + + Log.d(ASSERTION_TAG, "Assert that both '$testConferenceTitle' and '$testConferenceTitle2' conferences are displayed again after expanding the 'New Conferences' group.") + conferenceListPage.assertConferenceDisplayed(testConferenceTitle) + conferenceListPage.assertConferenceDisplayed(testConferenceTitle2) + Log.d(STEP_TAG, "Open '$testConferenceTitle' conference's detailer page.") conferenceListPage.openConferenceDetails(testConferenceTitle) @@ -82,7 +113,6 @@ class ConferencesE2ETest: StudentTest() { conferenceDetailsPage.assertConferenceTitleDisplayed(testConferenceTitle) conferenceDetailsPage.assertConferenceStatus("Not Started") conferenceDetailsPage.assertDescription(testConferenceDescription) - } } \ No newline at end of file diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/GradesE2ETest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/GradesE2ETest.kt index 8114133b74..625708685a 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/GradesE2ETest.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/GradesE2ETest.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2019 - present Instructure, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ package com.instructure.student.ui.e2e.classic import android.util.Log diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/PushNotificationsE2ETest.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/PushNotificationsE2ETest.kt index 7a903da517..bfe2365145 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/PushNotificationsE2ETest.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/PushNotificationsE2ETest.kt @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2024 - present Instructure, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ package com.instructure.student.ui.e2e.classic import android.util.Log diff --git a/apps/student/src/androidTest/java/com/instructure/student/ui/pages/classic/ConferenceListPage.kt b/apps/student/src/androidTest/java/com/instructure/student/ui/pages/classic/ConferenceListPage.kt index 1384001a0e..0a24974698 100644 --- a/apps/student/src/androidTest/java/com/instructure/student/ui/pages/classic/ConferenceListPage.kt +++ b/apps/student/src/androidTest/java/com/instructure/student/ui/pages/classic/ConferenceListPage.kt @@ -18,6 +18,7 @@ package com.instructure.student.ui.pages.classic import androidx.test.espresso.assertion.ViewAssertions.doesNotExist import androidx.test.espresso.matcher.ViewMatchers.hasSibling +import com.instructure.espresso.DoesNotExistAssertion import com.instructure.espresso.assertDisplayed import com.instructure.espresso.click import com.instructure.espresso.page.BasePage @@ -47,6 +48,10 @@ open class ConferenceListPage : BasePage(R.id.conferenceListPage) { onView(allOf(withId(R.id.title), withText(conferenceTitle))).assertDisplayed() } + fun assertConferenceNotDisplayed(conferenceTitle: String) { + onView(allOf(withId(R.id.title), withText(conferenceTitle))).check(DoesNotExistAssertion(5)) + } + fun assertConferenceDescription(conferenceTitle: String, expectedDescription: String) { onView(allOf(withId(R.id.subtitle), withText(expectedDescription), hasSibling(allOf(withId(R.id.title), withText(conferenceTitle))))) } @@ -75,4 +80,8 @@ open class ConferenceListPage : BasePage(R.id.conferenceListPage) { fun assertNewConferencesDisplayed() { onView(withId(R.id.title) + withText(R.string.newConferences) + withAncestor(R.id.conferenceListPage)).assertDisplayed() } + + fun clickExpandCollapseGroup(groupName: String) { + onView(withId(R.id.title) + withText(groupName)).click() + } }