Skip to content

Commit e06cff9

Browse files
Extend Conferences E2E test with testing expand/collapse. (#3458)
Add some copyright to some test classes. refs: MBL-19504 affects: Student release note: -
1 parent 17da053 commit e06cff9

File tree

5 files changed

+88
-1
lines changed

5 files changed

+88
-1
lines changed

apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/CollaborationsE2ETest.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright (C) 2019 - present Instructure, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
117
package com.instructure.student.ui.e2e.classic
218

319
import android.util.Log

apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/ConferencesE2ETest.kt

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright (C) 2019 - present Instructure, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
117
package com.instructure.student.ui.e2e.classic
218

319
import android.util.Log
@@ -16,6 +32,7 @@ import org.junit.Test
1632

1733
@HiltAndroidTest
1834
class ConferencesE2ETest: StudentTest() {
35+
1936
override fun displaysPageObjects() = Unit
2037

2138
override fun enableAndConfigureAccessibilityChecks() = Unit
@@ -72,6 +89,20 @@ class ConferencesE2ETest: StudentTest() {
7289
conferenceListPage.assertConferenceStatus(testConferenceTitle2,"Not Started")
7390
conferenceListPage.assertConferenceDescription(testConferenceTitle2, testConferenceDescription2)
7491

92+
Log.d(STEP_TAG, "Click on the expand/collapse button to COLLAPSE the 'New Conferences' group.")
93+
conferenceListPage.clickExpandCollapseGroup("New Conferences")
94+
95+
Log.d(ASSERTION_TAG, "Assert that both '$testConferenceTitle' and '$testConferenceTitle2' conferences are NOT displayed after collapsing the 'New Conferences' group.")
96+
conferenceListPage.assertConferenceNotDisplayed(testConferenceTitle)
97+
conferenceListPage.assertConferenceNotDisplayed(testConferenceTitle2)
98+
99+
Log.d(STEP_TAG, "Click on the expand/collapse button to EXPAND the 'New Conferences' group.")
100+
conferenceListPage.clickExpandCollapseGroup("New Conferences")
101+
102+
Log.d(ASSERTION_TAG, "Assert that both '$testConferenceTitle' and '$testConferenceTitle2' conferences are displayed again after expanding the 'New Conferences' group.")
103+
conferenceListPage.assertConferenceDisplayed(testConferenceTitle)
104+
conferenceListPage.assertConferenceDisplayed(testConferenceTitle2)
105+
75106
Log.d(STEP_TAG, "Open '$testConferenceTitle' conference's detailer page.")
76107
conferenceListPage.openConferenceDetails(testConferenceTitle)
77108

@@ -82,7 +113,6 @@ class ConferencesE2ETest: StudentTest() {
82113
conferenceDetailsPage.assertConferenceTitleDisplayed(testConferenceTitle)
83114
conferenceDetailsPage.assertConferenceStatus("Not Started")
84115
conferenceDetailsPage.assertDescription(testConferenceDescription)
85-
86116
}
87117

88118
}

apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/GradesE2ETest.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright (C) 2019 - present Instructure, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
117
package com.instructure.student.ui.e2e.classic
218

319
import android.util.Log

apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/PushNotificationsE2ETest.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright (C) 2024 - present Instructure, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
117
package com.instructure.student.ui.e2e.classic
218

319
import android.util.Log

apps/student/src/androidTest/java/com/instructure/student/ui/pages/classic/ConferenceListPage.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package com.instructure.student.ui.pages.classic
1818

1919
import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
2020
import androidx.test.espresso.matcher.ViewMatchers.hasSibling
21+
import com.instructure.espresso.DoesNotExistAssertion
2122
import com.instructure.espresso.assertDisplayed
2223
import com.instructure.espresso.click
2324
import com.instructure.espresso.page.BasePage
@@ -47,6 +48,10 @@ open class ConferenceListPage : BasePage(R.id.conferenceListPage) {
4748
onView(allOf(withId(R.id.title), withText(conferenceTitle))).assertDisplayed()
4849
}
4950

51+
fun assertConferenceNotDisplayed(conferenceTitle: String) {
52+
onView(allOf(withId(R.id.title), withText(conferenceTitle))).check(DoesNotExistAssertion(5))
53+
}
54+
5055
fun assertConferenceDescription(conferenceTitle: String, expectedDescription: String) {
5156
onView(allOf(withId(R.id.subtitle), withText(expectedDescription), hasSibling(allOf(withId(R.id.title), withText(conferenceTitle)))))
5257
}
@@ -75,4 +80,8 @@ open class ConferenceListPage : BasePage(R.id.conferenceListPage) {
7580
fun assertNewConferencesDisplayed() {
7681
onView(withId(R.id.title) + withText(R.string.newConferences) + withAncestor(R.id.conferenceListPage)).assertDisplayed()
7782
}
83+
84+
fun clickExpandCollapseGroup(groupName: String) {
85+
onView(withId(R.id.title) + withText(groupName)).click()
86+
}
7887
}

0 commit comments

Comments
 (0)