Skip to content

Commit

Permalink
Merge pull request #1509 from instructure/release/teacher-1.16.1-46
Browse files Browse the repository at this point in the history
Release Teacher 1.16.1 (46)
  • Loading branch information
hermannakos authored Feb 25, 2022
2 parents c22b161 + 909b40e commit 38b7690
Show file tree
Hide file tree
Showing 286 changed files with 2,449 additions and 414 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 = 233
versionName = '6.15.1'
versionCode = 235
versionName = '6.16.1'

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
Loading

0 comments on commit 38b7690

Please sign in to comment.