Skip to content

Commit

Permalink
Merge pull request #1714 from instructure/release/student-6.20.0-243
Browse files Browse the repository at this point in the history
Release Student 6.20.0 (243)
  • Loading branch information
hermannakos authored Sep 20, 2022
2 parents 5506b50 + 9979c2f commit 1746bc3
Show file tree
Hide file tree
Showing 351 changed files with 8,973 additions and 3,572 deletions.
16 changes: 16 additions & 0 deletions PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- edit or delete this section ---
## Screenshots

<table>
<tr><th>Before</th><th>After</th></tr>
<tr>
<td><img src="" maxHeight=500></td>
<td><img src="" maxHeight=500></td>
</tr>
</table>

## Checklist

- [ ] Follow-up e2e test ticket created or not needed
- [ ] A11y checked
- [ ] Approve from product or not needed
13 changes: 13 additions & 0 deletions apps/flutter_parent/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ android {
shrinkResources false // Must be false, otherwise resources we need are erroneously stripped out
proguardFiles 'proguard-rules.pro'
}
applicationVariants.all{
variant ->
variant.outputs.each{
output->
project.ext { appName = 'parent' }
def dateTimeStamp = new Date().format('yyyy-MM-dd-HH-mm-ss')
def newName = output.outputFile.name
newName = newName.replace("app-", "$project.ext.appName-")
newName = newName.replace("-debug", "-dev-debug-" + dateTimeStamp)
newName = newName.replace("-release", "-prod-release")
output.outputFileName = newName
}
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion apps/flutter_parent/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
2 changes: 1 addition & 1 deletion apps/flutter_parent/lib/network/api/enrollments_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class EnrollmentsApi {
final dio = canvasDio(forceRefresh: forceRefresh);
final params = {
'state[]': ['active', 'completed'], // current_and_concluded state not supported for observers
//'user_id': studentId, <-- add this back when the api is fixed
'user_id': studentId,
if (gradingPeriodId?.isNotEmpty == true)
'grading_period_id': gradingPeriodId,
};
Expand Down
20 changes: 5 additions & 15 deletions apps/flutter_parent/lib/network/utils/analytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import 'package:device_info/device_info.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_parent/utils/debug_flags.dart';
Expand Down Expand Up @@ -79,28 +78,27 @@ class AnalyticsParamConstants {
}

class Analytics {
FirebaseAnalytics get _analytics => FirebaseAnalytics();

/// Set the current screen in Firebase Analytics
/// Set the current screen in analytics
void setCurrentScreen(String screenName) async {
if (kReleaseMode) {
await _analytics.setCurrentScreen(screenName: screenName);

}

if (DebugFlags.isDebug) {
print('currentScreen: $screenName');
}
}

/// Log an event to Firebase analytics (only in release mode).
/// Log an event to analytics (only in release mode).
/// If isDebug, it will also print to the console
///
/// Params
/// * [event] should be one of [AnalyticsEventConstants]
/// * [extras] a map of keys [AnalyticsParamConstants] to values. Use sparingly, we only get 25 unique parameters
void logEvent(String event, {Map<String, dynamic> extras = const {}}) async {
if (kReleaseMode) {
await _analytics.logEvent(name: event, parameters: extras);

}

if (DebugFlags.isDebug) {
Expand All @@ -122,14 +120,6 @@ class Analytics {

/// Sets environment properties such as the build type and SDK int. This only needs to be called once per session.
void setEnvironmentProperties() async {
var androidInfo = await DeviceInfoPlugin().androidInfo;
await _analytics.setUserProperty(
name: AnalyticsEventConstants.USER_PROPERTY_BUILD_TYPE,
value: kReleaseMode ? 'release' : 'debug',
);
await _analytics.setUserProperty(
name: AnalyticsEventConstants.USER_PROPERTY_OS_VERSION,
value: androidInfo.version.sdkInt.toString(),
);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ class CourseDetailsModel extends BaseModel {
final enrollmentsFuture = _interactor()
.loadEnrollmentsForGradingPeriod(courseId, student.id, _nextGradingPeriod?.id, forceRefresh: forceRefresh)
?.then((enrollments) {
enrollments = enrollments
.where((element) => element.userId == student.id).toList();
return enrollments.length > 0 ? enrollments.first : null;
})?.catchError((_) => null); // Some 'legacy' parents can't read grades for students, so catch and return null

Expand Down
4 changes: 2 additions & 2 deletions apps/flutter_parent/lib/utils/crash_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class CrashUtils {
FirebaseCrashlytics firebase = locator<FirebaseCrashlytics>();

FlutterError.onError = (error) async {
await firebase
.setUserIdentifier('domain: ${ApiPrefs.getDomain() ?? 'null'} user_id: ${ApiPrefs.getUser()?.id ?? 'null'}');
// We don't know how the crashlytics stores the userId so we just set it to empty to make sure we don't log it.
await firebase.setUserIdentifier('');
firebase.recordFlutterError(error);
};

Expand Down
28 changes: 0 additions & 28 deletions apps/flutter_parent/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -337,34 +337,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.0"
firebase:
dependency: transitive
description:
name: firebase
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.2"
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
url: "https://pub.dartlang.org"
source: hosted
version: "8.3.4"
firebase_analytics_platform_interface:
dependency: transitive
description:
name: firebase_analytics_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
firebase_analytics_web:
dependency: transitive
description:
name: firebase_analytics_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0+1"
firebase_core:
dependency: "direct main"
description:
Expand Down
1 change: 0 additions & 1 deletion apps/flutter_parent/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ dependencies:
sdk: flutter
flutter_localizations:
sdk: flutter
firebase_analytics: ^8.3.4
firebase_remote_config: ^0.11.0+2
firebase_core: ^1.8.0
firebase_crashlytics: ^2.2.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ void main() {
// Initial setup
final termEnrollment = Enrollment((b) => b
..id = '10'
..enrollmentState = 'active'
..userId = _studentId);
..enrollmentState = 'active');
final gradingPeriods = [
GradingPeriod((b) => b
..id = '123'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@ void main() {
];
final enrollment = Enrollment((b) => b
..enrollmentState = 'active'
..grades = _mockGrade(currentScore: 1.2345)
..userId = _studentId);
..grades = _mockGrade(currentScore: 1.2345));

final model = CourseDetailsModel(_student, _courseId);
model.course = _mockCourse();
Expand All @@ -351,8 +350,7 @@ void main() {
];
final enrollment = Enrollment((b) => b
..enrollmentState = 'active'
..grades = _mockGrade(currentGrade: grade)
..userId = _studentId);
..grades = _mockGrade(currentGrade: grade));
final model = CourseDetailsModel(_student, _courseId);
model.course = _mockCourse();
when(interactor.loadAssignmentGroups(_courseId, _studentId, null)).thenAnswer((_) async => groups);
Expand Down
16 changes: 9 additions & 7 deletions apps/student/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ android {
applicationId "com.instructure.candroid"
minSdkVersion Versions.MIN_SDK
targetSdkVersion Versions.TARGET_SDK
versionCode = 242
versionName = '6.19.0'
versionCode = 243
versionName = '6.20.0'

vectorDrawables.useSupportLibrary = true
multiDexEnabled = true
Expand Down Expand Up @@ -271,12 +271,11 @@ dependencies {
testImplementation Libs.ANDROIDX_CORE_TESTING

/* Firebase */
implementation platform(Libs.FIREBASE_BOM)
implementation platform(Libs.FIREBASE_BOM) {
exclude group: 'com.google.firebase', module: 'firebase-analytics'
}
implementation Libs.FIREBASE_MESSAGING
implementation Libs.FIREBASE_CRASHLYTICS_NDK
implementation (Libs.FIREBASE_ANALYTICS) {
transitive = true
}
implementation (Libs.FIREBASE_CRASHLYTICS) {
transitive = true
}
Expand Down Expand Up @@ -308,7 +307,6 @@ dependencies {
implementation Libs.ANDROIDX_CONSTRAINT_LAYOUT
implementation Libs.ANDROIDX_DESIGN
implementation Libs.ANDROIDX_RECYCLERVIEW
implementation Libs.PLAY_SERVICES_ANALYTICS
implementation Libs.ANDROIDX_PALETTE
implementation Libs.PLAY_CORE

Expand All @@ -332,6 +330,10 @@ dependencies {
kaptAndroidTestQa Libs.HILT_TESTING_COMPILER

androidTestImplementation Libs.UI_AUTOMATOR

/* WorkManager */
implementation Libs.ANDROIDX_WORK_MANAGER
implementation Libs.ANDROIDX_WORK_MANAGER_KTX
}

// Comment out this line if the reporting logic starts going wonky.
Expand Down
26 changes: 26 additions & 0 deletions apps/student/flank_e2e_lowres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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.E2E
- notAnnotation com.instructure.canvas.espresso.Stub, com.instructure.canvas.espresso.FlakyE2E, com.instructure.canvas.espresso.KnownBug
device:
- model: NexusLowRes
version: 26
locale: en_US
orientation: portrait

flank:
testShards: 1
testRuns: 1

8 changes: 4 additions & 4 deletions apps/student/flank_multi_api_level.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ 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.StubMultiAPILevel, com.instructure.canvas.espresso.FlakyE2E, com.instructure.canvas.espresso.KnownBug
device:
- model: Nexus6P
- model: NexusLowRes
version: 27
locale: en_US
orientation: portrait
- model: Nexus6P
- model: NexusLowRes
version: 28
locale: en_US
orientation: portrait
- model: Nexus6P
- model: NexusLowRes
version: 29
locale: en_US
orientation: portrait
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,9 @@ class AssignmentsE2ETest: StudentTest() {
assignmentDetailsPage.goToSubmissionDetails()
submissionDetailsPage.openComments()

// MBL-13604: This does not work on FTL, so we're commenting it out for now.
// You could also break this out to a separate E2E test and annotate it with
// @Stub, so that we can run it locally but it doesn't run as part of our CI suite.
// send video comment
//submissionDetailsPage.addAndSendVideoComment()
//sleep(3000) // wait for video comment submission to propagate
//submissionDetailsPage.assertVideoCommentDisplayed()
submissionDetailsPage.addAndSendVideoComment()
sleep(3000) // wait for video comment submission to propagate
submissionDetailsPage.assertVideoCommentDisplayed()

Log.d(STEP_TAG,"Send an audio comment.")
submissionDetailsPage.addAndSendAudioComment()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package com.instructure.student.ui.e2e

import android.util.Log
import com.instructure.canvas.espresso.E2E
import com.instructure.canvas.espresso.Stub
import com.instructure.canvas.espresso.refresh
import com.instructure.dataseeding.api.ConferencesApi
import com.instructure.panda_annotations.FeatureCategory
import com.instructure.panda_annotations.Priority
import com.instructure.panda_annotations.TestCategory
import com.instructure.panda_annotations.TestMetaData
import com.instructure.student.ui.pages.ConferencesPage
import com.instructure.student.ui.utils.StudentTest
import com.instructure.student.ui.utils.seedData
import com.instructure.student.ui.utils.tokenLogin
Expand All @@ -32,15 +32,15 @@ class ConferencesE2ETest: StudentTest() {
// Re-stubbing for now because the interface has changed from webview to native
// and this test no longer passes. MBL-14127 is being tracked to re-write this
// test against the new native interface.
@Stub
@E2E
@Test
@TestMetaData(Priority.MANDATORY, FeatureCategory.CONFERENCES, TestCategory.E2E, true)
@TestMetaData(Priority.MANDATORY, FeatureCategory.CONFERENCES, TestCategory.E2E)
fun testConferencesE2E() {

Log.d(PREPARATION_TAG,"Seeding data.")
val data = seedData(students = 1, teachers = 1, courses = 1)
val student = data.studentsList[0]
val teacher = data.teachersList[0]
val course = data.coursesList[0]

Log.d(STEP_TAG,"Login with user: ${student.name}, login id: ${student.loginId} , password: ${student.password}")
Expand All @@ -51,13 +51,38 @@ class ConferencesE2ETest: StudentTest() {
dashboardPage.selectCourse(course)
courseBrowserPage.selectConferences()

val title = "Awesome Conference!"
var description = "Awesome! Spectacular! Mind-blowing!"
Log.d(STEP_TAG,"Create a new conference with $title title and $description description.")
ConferencesPage.createConference(title, description)
Log.d(STEP_TAG,"Assert that the empty view is displayed since we did not make any conference yet.")
conferenceListPage.assertEmptyView()

val testConferenceTitle = "E2E test conference"
val testConferenceDescription = "Nightly E2E Test conference description"
Log.d(PREPARATION_TAG,"Create a conference with '$testConferenceTitle' title and '$testConferenceDescription' description.")
ConferencesApi.createCourseConference(teacher.token,
testConferenceTitle, testConferenceDescription,"BigBlueButton",false,70,
listOf(student.id),course.id)

val testConferenceTitle2 = "E2E test conference 2"
val testConferenceDescription2 = "Nightly E2E Test conference description 2"
ConferencesApi.createCourseConference(teacher.token,
testConferenceTitle2, testConferenceDescription2,"BigBlueButton",true,120,
listOf(student.id),course.id)

Log.d(STEP_TAG,"Refresh the page. Assert that $testConferenceTitle conference is displayed on the Conference List Page with the corresponding status.")
refresh()
conferenceListPage.assertConferenceDisplayed(testConferenceTitle)
conferenceListPage.assertConferenceStatus(testConferenceTitle,"Not Started")

Log.d(STEP_TAG,"Assert that $testConferenceTitle2 conference is displayed on the Conference List Page with the corresponding status.")
conferenceListPage.assertConferenceDisplayed(testConferenceTitle2)
conferenceListPage.assertConferenceStatus(testConferenceTitle2,"Not Started")

Log.d(STEP_TAG,"Open '$testConferenceTitle' conference details page.")
conferenceListPage.openConferenceDetails(testConferenceTitle)

Log.d(STEP_TAG,"Assert that the proper conference title '$testConferenceTitle', status and description '$testConferenceDescription' are displayed.")
conferenceDetailsPage.assertConferenceTitleDisplayed()
conferenceDetailsPage.assertConferenceStatus("Not Started")
conferenceDetailsPage.assertDescription(testConferenceDescription)

Log.d(STEP_TAG,"Assert that the previously created conference is displayed with $title title and $description description.")
ConferencesPage.assertConferenceTitlePresent(title)
ConferencesPage.assertConferenceDescriptionPresent(description)
}
}
Loading

0 comments on commit 1746bc3

Please sign in to comment.