Skip to content

Commit

Permalink
Merge pull request #1610 from instructure/release/teacher-1.18.0-48
Browse files Browse the repository at this point in the history
Release Teacher 1.18.0 (48)
  • Loading branch information
tamaskozmer authored Jun 20, 2022
2 parents 8eda5f1 + 9103b1f commit 0b00cec
Show file tree
Hide file tree
Showing 946 changed files with 8,575 additions and 5,298 deletions.
Binary file not shown.
150 changes: 75 additions & 75 deletions apps/flutter_parent/lib/l10n/res/intl_es_ES.arb

Large diffs are not rendered by default.

106 changes: 53 additions & 53 deletions apps/flutter_parent/lib/l10n/res/intl_ja.arb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class EmptyPandaWidget extends StatelessWidget {
Text(
title,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headline6.copyWith(fontSize: 20, fontWeight: FontWeight.bold),
style: Theme.of(context).textTheme.headline6.copyWith(fontSize: 20, fontWeight: FontWeight.normal),
),
if (title != null && subtitle != null) SizedBox(height: 8),
if (subtitle != null)
Expand Down
1 change: 1 addition & 0 deletions apps/flutter_parent/lib/utils/design/parent_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ class _ParentThemeState extends State<ParentTheme> {
accentIconTheme: IconThemeData(color: isDarkMode ? Colors.black : Colors.white),
dividerColor: isHC ? onSurfaceColor : isDarkMode ? ParentColors.oxford : ParentColors.tiara,
buttonTheme: ButtonThemeData(height: 48, minWidth: 120, textTheme: ButtonTextTheme.primary),
fontFamily: 'Lato'
);
}

Expand Down
11 changes: 11 additions & 0 deletions apps/flutter_parent/lib/utils/web_view_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ extension WebViewUtils on WebViewController {
String fileText = await rootBundle.loadString('assets/html/html_wrapper.html');
html = _applyWorkAroundForDoubleSlashesAsUrlSource(html);
html = _addProtocolToLinks(html);
html = _checkForMathTags(html);
html = fileText.replaceAll('{CANVAS_CONTENT}', html);
html = html.replaceAll('{PADDING}', horizontalPadding.toString());
this.loadData(baseUrl, html, 'text/html', 'utf-8');
Expand All @@ -47,6 +48,16 @@ extension WebViewUtils on WebViewController {
}
}

String _checkForMathTags(String html) {
if ((RegExp('\$\$.+\$\$|\\\(.+\\\)').hasMatch(html) || html.contains('<math')) && !html.contains("<img class='equation_image'")) {
return """<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>$html""";
} else {
return html;
}
}

String _applyWorkAroundForDoubleSlashesAsUrlSource(String html) {
if (html.isEmpty) return '';
// Fix for embedded videos that have // instead of http://
Expand Down
3 changes: 3 additions & 0 deletions apps/flutter_parent/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ flutter:
- family: CanvasIconsSolid
fonts:
- asset: assets/fonts/CanvasIconsSolid.ttf
- family: Lato
fonts:
- asset: assets/fonts/lato_regular.ttf

# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
Expand Down
4 changes: 2 additions & 2 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 = 236
versionName = '6.16.2'
versionCode = 238
versionName = '6.17.1'

vectorDrawables.useSupportLibrary = true
multiDexEnabled = true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
* 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

import android.util.Log
import androidx.test.espresso.Espresso
import com.instructure.canvas.espresso.E2E
import com.instructure.canvas.espresso.refresh
import com.instructure.canvasapi2.models.DiscussionEntry
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.utils.StudentTest
import com.instructure.student.ui.utils.seedData
import com.instructure.student.ui.utils.tokenLogin
import dagger.hilt.android.testing.HiltAndroidTest
import org.junit.Test
import java.lang.Thread.sleep

@HiltAndroidTest
class AnnouncementsE2ETest : StudentTest() {
override fun displaysPageObjects() = Unit

override fun enableAndConfigureAccessibilityChecks() {
//We don't want to see accessibility errors on E2E tests
}

@E2E
@Test
@TestMetaData(Priority.MANDATORY, FeatureCategory.ANNOUNCEMENTS, TestCategory.E2E)
fun testAnnouncementsE2E() {

Log.d(PREPARATION_TAG,"Seeding data.")
val data = seedData(students = 1, teachers = 1, courses = 1, announcements = 2, locked = true)
val student = data.studentsList[0]
val course = data.coursesList[0]
val announcement = data.announcementsList[0]
val secondAnnouncement = data.announcementsList[1]

Log.d(STEP_TAG,"Login with user: ${student.name}, login id: ${student.loginId} , password: ${student.password}")
tokenLogin(student)
dashboardPage.waitForRender()

Log.d(STEP_TAG,"Navigate to ${course.name} course's announcements page.")
dashboardPage.assertDisplaysCourse(course)
dashboardPage.selectCourse(course)
courseBrowserPage.selectAnnouncements()

Log.d(STEP_TAG,"Assert that ${announcement.title} announcement is displayed.")
discussionListPage.assertTopicDisplayed(announcement.title)

Log.d(STEP_TAG,"Select ${announcement.title} announcement and assert if we are landing on the Discussion Details Page.")
discussionListPage.selectTopic(announcement.title)
discussionDetailsPage.assertTitleText(announcement.title)

val replyMessage = "Reply text"
Log.d(STEP_TAG,"Send a reply to the selected announcement with message: $replyMessage.")
discussionDetailsPage.sendReply(replyMessage)
discussionDetailsPage.assertPageObjects()

Log.d(STEP_TAG,"Assert that the previously sent reply has been displayed.")
val announcementReply = DiscussionEntry(message = replyMessage)
discussionDetailsPage.assertIfThereIsAReply()
discussionDetailsPage.assertReplyDisplayed(announcementReply)

Log.d(STEP_TAG,"Click on Search button and type ${announcement.title} to the search input field.")
Espresso.pressBack()
discussionListPage.clickOnSearchButton()
discussionListPage.typeToSearchBar(announcement.title)

Log.d(STEP_TAG,"Assert that only the matching announcement is displayed on the Discussion List Page.")
discussionListPage.pullToUpdate()
discussionListPage.assertTopicDisplayed(announcement.title)
discussionListPage.assertTopicNotDisplayed(secondAnnouncement.title)

Log.d(STEP_TAG,"Clear search input field value and assert if all the announcements are displayed again on the Discussion List Page.")
discussionListPage.clickOnClearSearchButton()
discussionListPage.waitForDiscussionTopicToDisplay(secondAnnouncement.title)
discussionListPage.assertTopicDisplayed(announcement.title)

Log.d(STEP_TAG,"Type a search value to the search input field which does not much with any of the existing announcements.")
discussionListPage.typeToSearchBar("Non existing announcement title")
sleep(3000) //We need this wait here to let make sure the search process has finished.

Log.d(STEP_TAG,"Assert that the empty view is displayed and none of the announcements are appearing on the page.")
discussionListPage.assertEmpty()
discussionListPage.assertTopicNotDisplayed(announcement.title)
discussionListPage.assertTopicNotDisplayed(secondAnnouncement.title)

Log.d(STEP_TAG,"Clear search input field value and assert if all the announcements are displayed again on the Discussion List Page.")
discussionListPage.clickOnClearSearchButton()
discussionListPage.waitForDiscussionTopicToDisplay(secondAnnouncement.title)
discussionListPage.assertTopicDisplayed(announcement.title)

Log.d(STEP_TAG,"Refresh the page and assert that after refresh, still all the announcements are displayed.")
refresh()
discussionListPage.assertTopicDisplayed(announcement.title)
discussionListPage.assertTopicDisplayed(secondAnnouncement.title)
}
}
Loading

0 comments on commit 0b00cec

Please sign in to comment.