Skip to content

Commit

Permalink
Merge pull request #1508 from instructure/release/student-6.16.2-236
Browse files Browse the repository at this point in the history
Release Student 6.16.2 (236)
  • Loading branch information
hermannakos authored Feb 25, 2022
2 parents 396685a + d167378 commit ac3a5fd
Show file tree
Hide file tree
Showing 239 changed files with 1,639 additions and 330 deletions.
5 changes: 3 additions & 2 deletions apps/student/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ android {
applicationId "com.instructure.candroid"
minSdkVersion Versions.MIN_SDK
targetSdkVersion Versions.TARGET_SDK
versionCode = 235
versionName = '6.16.1'
versionCode = 236
versionName = '6.16.2'

vectorDrawables.useSupportLibrary = true
multiDexEnabled = true
Expand Down Expand Up @@ -211,6 +211,7 @@ android {
android,
new MasqueradeUITransformer('com.instructure.student.activity.NavigationActivity.class'),
new PageViewTransformer(),
new ScreenViewTransformer("student"),
new LocaleTransformer(project),
new FlutterA11yOffsetTransformer(),
new FlutterTextureDisconnectFix()
Expand Down
2 changes: 1 addition & 1 deletion apps/student/flank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gcloud:
record-video: true
timeout: 60m
test-targets:
- notAnnotation com.instructure.canvas.espresso.E2E, com.instructure.canvas.espresso.Stub
- notAnnotation com.instructure.canvas.espresso.E2E, com.instructure.canvas.espresso.Stub, com.instructure.canvas.espresso.FlakyE2E, com.instructure.canvas.espresso.KnownBug
device:
- model: NexusLowRes
version: 26
Expand Down
2 changes: 1 addition & 1 deletion apps/student/flank_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gcloud:
timeout: 60m
test-targets:
- annotation com.instructure.canvas.espresso.E2E
- notAnnotation com.instructure.canvas.espresso.Stub
- notAnnotation com.instructure.canvas.espresso.Stub, com.instructure.canvas.espresso.FlakyE2E, com.instructure.canvas.espresso.KnownBug
device:
- model: NexusLowRes
version: 26
Expand Down
25 changes: 25 additions & 0 deletions apps/student/flank_e2e_flaky.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
gcloud:
project: delta-essence-114723
# Use the next two lines to run locally
# app: ./build/outputs/apk/qa/debug/student-qa-debug.apk
# test: ./build/outputs/apk/androidTest/qa/debug/student-qa-debug-androidTest.apk
app: ./apps/student/build/outputs/apk/qa/debug/student-qa-debug.apk
test: ./apps/student/build/outputs/apk/androidTest/qa/debug/student-qa-debug-androidTest.apk
results-bucket: android-student
auto-google-login: true
use-orchestrator: true
performance-metrics: false
record-video: true
timeout: 60m
test-targets:
- annotation com.instructure.canvas.espresso.FlakyE2E
device:
- model: NexusLowRes
version: 26
locale: en_US
orientation: portrait

flank:
testShards: 1
testRuns: 1

25 changes: 25 additions & 0 deletions apps/student/flank_e2e_knownbug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
gcloud:
project: delta-essence-114723
# Use the next two lines to run locally
# app: ./build/outputs/apk/qa/debug/student-qa-debug.apk
# test: ./build/outputs/apk/androidTest/qa/debug/student-qa-debug-androidTest.apk
app: ./apps/student/build/outputs/apk/qa/debug/student-qa-debug.apk
test: ./apps/student/build/outputs/apk/androidTest/qa/debug/student-qa-debug-androidTest.apk
results-bucket: android-student
auto-google-login: true
use-orchestrator: true
performance-metrics: false
record-video: true
timeout: 60m
test-targets:
- annotation com.instructure.canvas.espresso.KnownBug
device:
- model: NexusLowRes
version: 26
locale: en_US
orientation: portrait

flank:
testShards: 1
testRuns: 1

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.instructure.student.ui.e2e.k5

import androidx.test.espresso.Espresso
import com.instructure.canvas.espresso.E2E
import com.instructure.canvas.espresso.FlakyE2E
import com.instructure.canvasapi2.utils.toApiString
import com.instructure.dataseeding.api.AssignmentsApi
import com.instructure.dataseeding.model.GradingType
Expand All @@ -28,6 +29,7 @@ import com.instructure.panda_annotations.Priority
import com.instructure.panda_annotations.TestCategory
import com.instructure.panda_annotations.TestMetaData
import com.instructure.student.R
import com.instructure.student.ui.pages.ElementaryDashboardPage
import com.instructure.student.ui.utils.StudentTest
import com.instructure.student.ui.utils.seedDataForK5
import com.instructure.student.ui.utils.tokenLoginElementary
Expand All @@ -47,6 +49,7 @@ class HomeroomE2ETest : StudentTest() {
}

@E2E
@FlakyE2E("Need to investigate why is it breaking when asserting todo text. Timezone shouldn't be a problem anymore since we run these tests at 8 PM.")
@Test
@TestMetaData(Priority.P0, FeatureCategory.K5_DASHBOARD, TestCategory.E2E)
fun homeroomE2ETest() {
Expand All @@ -66,20 +69,13 @@ class HomeroomE2ETest : StudentTest() {
val homeroomAnnouncement = data.announcementsList[0]
val nonHomeroomCourses = data.coursesList.filter { !it.homeroomCourse }

val utcTimeZone = TimeZone.getTimeZone("UTC")
val calendar = Calendar.getInstance(utcTimeZone)
val calendar = Calendar.getInstance()
calendar.set(Calendar.HOUR_OF_DAY, 23)
calendar.set(Calendar.MINUTE, 55)
calendar.set(Calendar.SECOND, 59)

calendar.set(Calendar.HOUR_OF_DAY, 10)
calendar.set(Calendar.MINUTE, 1)
calendar.set(Calendar.SECOND, 1)

val simpleDateFormat = SimpleDateFormat("EE MMM dd HH:mm:ss zzz yyyy", Locale.US)
simpleDateFormat.setTimeZone(utcTimeZone)

val missingCalendar = Calendar.getInstance()
missingCalendar.set(Calendar.HOUR_OF_DAY, 10)
missingCalendar.set(Calendar.MINUTE, 1)
missingCalendar.set(Calendar.SECOND, 1)

val testAssignment = AssignmentsApi.createAssignment(
AssignmentsApi.CreateAssignmentRequest(
Expand All @@ -104,7 +100,10 @@ class HomeroomE2ETest : StudentTest() {

// Sign in with elementary (K5) student
tokenLoginElementary(student)
homeroomPage.assertPageObjects()
elementaryDashboardPage.assertPageObjects()
elementaryDashboardPage.waitForRender()
elementaryDashboardPage.selectTab(ElementaryDashboardPage.ElementaryTabType.HOMEROOM)

homeroomPage.assertWelcomeText(student.shortName)
homeroomPage.assertAnnouncementDisplayed(
homeroomCourse.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
package com.instructure.student.ui.interaction

import androidx.test.espresso.Espresso
import androidx.test.espresso.NoMatchingViewException
import com.instructure.canvas.espresso.mockCanvas.MockCanvas
import com.instructure.canvas.espresso.mockCanvas.addAccountNotification
import com.instructure.canvas.espresso.mockCanvas.addGroupToCourse
import com.instructure.canvas.espresso.mockCanvas.addEnrollment
import com.instructure.canvas.espresso.mockCanvas.init
import com.instructure.canvasapi2.apis.EnrollmentAPI
import com.instructure.panda_annotations.FeatureCategory
import com.instructure.panda_annotations.Priority
import com.instructure.panda_annotations.TestCategory
Expand Down Expand Up @@ -155,11 +157,44 @@ class DashboardInteractionTest : StudentTest() {
// Tapping dismiss should remove the announcement. Refresh should not display it again.
val data = getToDashboard(courseCount = 1, favoriteCourseCount = 1, announcementCount = 1)
val announcement = data.accountNotifications.values.first()

dashboardPage.assertAnnouncementShowing(announcement)
dashboardPage.dismissAnnouncement() //TODO BUG: https://instructure.atlassian.net/browse/MBL-15840
dashboardPage.assertAnnouncementsGone()
dashboardPage.refresh() //need this refresh because if there are such amount of elements and the screen is scrollable, first "interaction" will scroll down somehow a bit. It works on physical device, it's just an emulator-specific issue.
dashboardPage.assertAnnouncementShowing(announcement)
dashboardPage.dismissAnnouncement()
dashboardPage.assertAnnouncementGoneAndCheckAfterRefresh()
}

@Test
@TestMetaData(Priority.P1, FeatureCategory.DASHBOARD, TestCategory.INTERACTION)
fun testDashboardInvite_accept() {
val data = getToDashboard(courseCount = 2, invitedCourseCount = 1)
val invitedCourse = data.courses.values.first { it.enrollments?.any { it.enrollmentState == EnrollmentAPI.STATE_INVITED } ?: false }

dashboardPage.assertInviteShowing(invitedCourse.name)
dashboardPage.refresh() //need this refresh because if there are such amount of elements and the screen is scrollable, first "interaction" will scroll down somehow a bit. It works on physical device, it's just an emulator-specific issue.
dashboardPage.assertInviteShowing(invitedCourse.name)
dashboardPage.acceptInvite()
dashboardPage.assertInviteAccepted()
dashboardPage.refresh()
dashboardPage.assertAnnouncementsGone()
dashboardPage.assertInviteGone(invitedCourse.name)
dashboardPage.assertDisplaysCourse(invitedCourse)
}

@Test
@TestMetaData(Priority.P1, FeatureCategory.DASHBOARD, TestCategory.INTERACTION)
fun testDashboardInvite_decline() {
val data = getToDashboard(courseCount = 2, invitedCourseCount = 1)
val invitedCourse = data.courses.values.first { it.enrollments?.any { it.enrollmentState == EnrollmentAPI.STATE_INVITED } ?: false }

dashboardPage.assertInviteShowing(invitedCourse.name)
dashboardPage.refresh() //need this refresh because if there are such amount of elements and the screen is scrollable, first "interaction" will scroll down somehow a bit. It works on physical device, it's just an emulator-specific issue.
dashboardPage.assertInviteShowing(invitedCourse.name)
dashboardPage.declineInvite()
dashboardPage.assertInviteDeclined()
dashboardPage.refresh()
dashboardPage.assertInviteGone(invitedCourse.name)
dashboardPage.assertCourseNotShown(invitedCourse)
}

@Test
Expand All @@ -168,8 +203,12 @@ class DashboardInteractionTest : StudentTest() {
// Tapping global announcement displays the content
val data = getToDashboard(courseCount = 1, favoriteCourseCount = 1, announcementCount = 1)
val announcement = data.accountNotifications.values.first()

dashboardPage.assertAnnouncementShowing(announcement)
dashboardPage.refresh() //need this refresh because if there are such amount of elements and the screen is scrollable, first "interaction" will scroll down somehow a bit. It works on physical device, it's just an emulator-specific issue.
dashboardPage.assertAnnouncementShowing(announcement)
dashboardPage.tapAnnouncementAndAssertDisplayed(announcement) //TODO bug: https://instructure.atlassian.net/browse/MBL-15843
dashboardPage.tapAnnouncement()
dashboardPage.assertAnnouncementDetailsDisplayed(announcement)
}

@Test
Expand Down Expand Up @@ -209,12 +248,15 @@ class DashboardInteractionTest : StudentTest() {

private fun getToDashboard(
courseCount: Int = 1,
invitedCourseCount: Int = 0,
pastCourseCount: Int = 0,
favoriteCourseCount: Int = 0,
announcementCount: Int = 0): MockCanvas {
announcementCount: Int = 0
): MockCanvas {
val data = MockCanvas.init(
studentCount = 1,
courseCount = courseCount,
invitedCourseCount = invitedCourseCount,
pastCourseCount = pastCourseCount,
favoriteCourseCount = favoriteCourseCount,
accountNotificationCount = announcementCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import com.instructure.canvas.espresso.mockCanvas.MockCanvas
import com.instructure.canvas.espresso.mockCanvas.addCourseWithEnrollment
import com.instructure.canvas.espresso.mockCanvas.init
import com.instructure.canvasapi2.models.Enrollment
import com.instructure.canvasapi2.utils.RemoteConfigParam
import com.instructure.canvasapi2.utils.RemoteConfigPrefs
import com.instructure.espresso.page.getStringFromResource
import com.instructure.panda_annotations.FeatureCategory
import com.instructure.panda_annotations.Priority
Expand Down Expand Up @@ -56,7 +54,7 @@ class GradesInteractionTest : StudentTest() {
@Test
@TestMetaData(Priority.P1, FeatureCategory.K5_DASHBOARD, TestCategory.INTERACTION)
fun testRefresh() {
val data = createMockData(courseCount = 3)
val data = createMockData(courseCount = 1)
goToGradesTab(data)

gradesPage.assertPageObjects()
Expand All @@ -65,11 +63,12 @@ class GradesInteractionTest : StudentTest() {
gradesPage.assertCourseShownWithGrades(it.value.name, "B+")
}

val newCourse = data.addCourseWithEnrollment(data.students[0], Enrollment.EnrollmentType.Student, 50.0)
val newCourse =
data.addCourseWithEnrollment(data.students[0], Enrollment.EnrollmentType.Student, 50.0)

gradesPage.refresh()

gradesPage.assertCourseShownWithGrades(newCourse.name, "50%")

}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ class HomeroomInteractionTest : StudentTest() {
homeroomPage.assertToDoText("2 due today | 2 missing")
}

@StubLandscape
@Test
@TestMetaData(Priority.P1, FeatureCategory.K5_DASHBOARD, TestCategory.INTERACTION)
fun testOpenAssignments() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ class ImportantDatesInteractionTest : StudentTest() {

val assignment = data.addAssignment(courseId = course.id, submissionType = Assignment.SubmissionType.ONLINE_TEXT_ENTRY)
val twoDaysFromNowEvent = data.addAssignmentCalendarEvent(course.id,
2.days.fromNow.iso8601, assignment.name!!, assignment.description!!, true, assignment)
2.days.fromNow.iso8601, "Important event two days later", "Important event two days later description", true, assignment)
val threeDaysFromNowEvent = data.addCourseCalendarEvent(course.id,
3.days.fromNow.iso8601, "Important event", "Important event description", true)
3.days.fromNow.iso8601, "Important event three days later", "Important event three days later description", true)
val todayEvent = data.addCourseCalendarEvent(course.id,
0.days.fromNow.iso8601, "Important event Today", "Important event today description", true)

Expand All @@ -193,6 +193,7 @@ class ImportantDatesInteractionTest : StudentTest() {

importantDatesPage.assertDayTextIsDisplayed(generateDayString(todayEvent.startDate))
importantDatesPage.assertDayTextIsDisplayed(generateDayString(twoDaysFromNowEvent.startDate))
importantDatesPage.swipeUp() // Need to do this because on landscape mode the last item cannot be seen on the view by default.
importantDatesPage.assertDayTextIsDisplayed(generateDayString(threeDaysFromNowEvent.startDate))
importantDatesPage.assertRecyclerViewItemCount(6) // We count both day texts and calendar events here, since both types are part of the recyclerView.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ScheduleInteractionTest : StudentTest() {
}

@Test
@StubLandscape
@StubLandscape(description = "This is intentionally stubbed on landscape mode because the item view is too narrow, but that's not a bug, it's intentional.")
@TestMetaData(Priority.P0, FeatureCategory.K5_DASHBOARD, TestCategory.INTERACTION)
fun testShowScheduledAssignments() {
setDate(2021, Calendar.AUGUST, 11)
Expand All @@ -101,7 +101,7 @@ class ScheduleInteractionTest : StudentTest() {
}

@Test
@StubLandscape
@StubLandscape(description = "This is intentionally stubbed on landscape mode because the item view is too narrow, but that's not a bug, it's intentional.")
@TestMetaData(Priority.P0, FeatureCategory.K5_DASHBOARD, TestCategory.INTERACTION)
fun testShowMissingAssignments() {
setDate(2021, Calendar.AUGUST, 11)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,53 @@ class DashboardPage : BasePage(R.id.dashboardPage) {
}

// Assumes that a single announcement is showing
fun tapAnnouncementAndAssertDisplayed(announcement: AccountNotification) {
onView(withId(R.id.tapToView)).assertDisplayed().click()
fun assertAnnouncementDetailsDisplayed(announcement: AccountNotification) {
WaitForViewWithId(R.id.canvasWebView)
// Include isDisplayed() in the matcher to differentiate from other views with this text
onView(withText(announcement.subject) + isDisplayed()).assertDisplayed()
}

fun tapAnnouncement() {
onView(withId(R.id.tapToView)).assertDisplayed().click()
}

fun dismissAnnouncement() {
onView(withId(R.id.dismissImageButton)).click()
}

fun refresh() {
onView(withId(R.id.swipeRefreshLayout) + withAncestor(R.id.dashboardPage)).swipeDown()
}

fun assertAnnouncementGoneAndCheckAfterRefresh() {
assertAnnouncementsGone()
refresh()
assertAnnouncementsGone()
}

fun assertInviteShowing(courseName: String) {
onView(withText(courseName) + withAncestor(R.id.dashboardNotifications)).assertDisplayed()
}

fun acceptInvite() {
onView(withId(R.id.acceptButtonWrapper)).click()
}

fun declineInvite() {
onView(withId(R.id.declineButtonWrapper)).click()
}

fun assertInviteAccepted() {
onView(withText("Invite accepted!") + withAncestor(R.id.dashboardNotifications)).assertDisplayed()
}

fun assertInviteDeclined() {
onView(withText("Invite declined.") + withAncestor(R.id.dashboardNotifications)).assertDisplayed()
}

fun assertInviteGone(courseName: String) {
onView(withText(courseName) + withAncestor(R.id.dashboardNotifications)).check(doesNotExist())
}
}

/**
Expand Down
Loading

0 comments on commit ac3a5fd

Please sign in to comment.