Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import androidx.test.espresso.intent.Intents
import com.instructure.canvas.espresso.FeatureCategory
import com.instructure.canvas.espresso.Priority
import com.instructure.canvas.espresso.SecondaryFeatureCategory
import com.instructure.canvas.espresso.StringConstants.HelpMenu
import com.instructure.canvas.espresso.TestCategory
import com.instructure.canvas.espresso.TestMetaData
import com.instructure.canvas.espresso.annotations.E2E
Expand Down Expand Up @@ -77,9 +78,9 @@ class HelpMenuE2ETest : ParentComposeTest() {
Intents.init()

try {
helpPage.assertHelpMenuURL("Search the Canvas Guides", "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
helpPage.assertHelpMenuURL("Submit a Feature Idea", "https://community.canvaslms.com/t5/Idea-Conversations/idb-p/ideas")
helpPage.assertHelpMenuURL("Share Your Love for the App", "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
helpPage.assertHelpMenuURL(HelpMenu.SEARCH_GUIDES_TITLE, "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
helpPage.assertHelpMenuURL(HelpMenu.SUBMIT_FEATURE_TITLE, "https://community.canvaslms.com/t5/Idea-Conversations/idb-p/ideas")
helpPage.assertHelpMenuURL(HelpMenu.SHARE_LOVE_TITLE, "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
}
finally {
Intents.release()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import com.instructure.canvas.espresso.StringConstants.HelpMenu
import com.instructure.canvas.espresso.containsTextCaseInsensitive
import com.instructure.espresso.OnViewWithStringTextIgnoreCase
import com.instructure.espresso.OnViewWithText
Expand Down Expand Up @@ -91,20 +92,20 @@ class HelpPage : BasePage(R.id.helpDialog) {

fun assertHelpMenuContent() {

onView(withId(R.id.title) + withText("Search the Canvas Guides")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Find answers to common questions")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.SEARCH_GUIDES_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.SEARCH_GUIDES_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("CUSTOM LINK")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("This is a custom help link.")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.CUSTOM_LINK_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.CUSTOM_LINK_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Report a Problem")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("If Canvas misbehaves, tell us about it")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.REPORT_PROBLEM_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.REPORT_PROBLEM_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Submit a Feature Idea")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Have an idea to improve Canvas?")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.SUBMIT_FEATURE_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.SUBMIT_FEATURE_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Share Your Love for the App")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Tell us about your favorite parts of the app")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.SHARE_LOVE_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.SHARE_LOVE_SUBTITLE)).assertDisplayed()
}

fun assertHelpMenuURL(helpMenuText: String, expectedURL: String) {
Expand All @@ -117,9 +118,9 @@ class HelpPage : BasePage(R.id.helpDialog) {
Intents.intending(expectedIntent).respondWith(Instrumentation.ActivityResult(0, null))

when (helpMenuText) {
"Search the Canvas Guides" -> clickSearchGuidesLabel()
"Submit a Feature Idea" -> clickSubmitFeatureLabel()
"Share Your Love for the App" -> clickShareLoveLabel()
HelpMenu.SEARCH_GUIDES_TITLE -> clickSearchGuidesLabel()
HelpMenu.SUBMIT_FEATURE_TITLE -> clickSubmitFeatureLabel()
HelpMenu.SHARE_LOVE_TITLE -> clickShareLoveLabel()
}

Intents.intended(expectedIntent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import androidx.test.espresso.intent.Intents
import com.instructure.canvas.espresso.FeatureCategory
import com.instructure.canvas.espresso.Priority
import com.instructure.canvas.espresso.SecondaryFeatureCategory
import com.instructure.canvas.espresso.StringConstants.HelpMenu
import com.instructure.canvas.espresso.TestCategory
import com.instructure.canvas.espresso.TestMetaData
import com.instructure.canvas.espresso.annotations.E2E
Expand Down Expand Up @@ -75,9 +76,9 @@ class HelpMenuE2ETest : StudentTest() {
Intents.init()

try {
helpPage.assertHelpMenuURL("Search the Canvas Guides", "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
helpPage.assertHelpMenuURL("Submit a Feature Idea", "https://community.canvaslms.com/t5/Idea-Conversations/idb-p/ideas")
helpPage.assertHelpMenuURL("Share Your Love for the App", "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
helpPage.assertHelpMenuURL(HelpMenu.SEARCH_GUIDES_TITLE, "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
helpPage.assertHelpMenuURL(HelpMenu.SUBMIT_FEATURE_TITLE, "https://community.canvaslms.com/t5/Idea-Conversations/idb-p/ideas")
helpPage.assertHelpMenuURL(HelpMenu.SHARE_LOVE_TITLE, "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
}
finally {
Intents.release()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class AssignmentsE2ETest: StudentComposeTest() {

@E2E
@Test
@Stub("Worker issue, failing on CI, needs to be fixed in ticket MBL-18749")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of @Stub annotation for this test appears unrelated to the help menu string constants refactoring. This should be in a separate commit or PR focused on test stability issues.

If this test was already failing and you're just documenting it, that's fine, but it should be clearly mentioned in the PR description as a separate change.

@TestMetaData(Priority.IMPORTANT, FeatureCategory.SUBMISSIONS, TestCategory.E2E)
fun test01CommentsBelongToSubmissionAttempts() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import com.instructure.canvas.espresso.StringConstants.HelpMenu
import com.instructure.canvas.espresso.containsTextCaseInsensitive
import com.instructure.canvas.espresso.withCustomConstraints
import com.instructure.canvasapi2.models.Course
Expand Down Expand Up @@ -119,23 +120,23 @@ class HelpPage : BasePage(R.id.helpDialog) {

fun assertHelpMenuContent() {

onView(withId(R.id.title) + withText("Search the Canvas Guides")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Find answers to common questions")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.SEARCH_GUIDES_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.SEARCH_GUIDES_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("CUSTOM LINK")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("This is a custom help link.")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.CUSTOM_LINK_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.CUSTOM_LINK_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Ask Your Instructor a Question")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Questions are submitted to your instructor")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.Student.ASK_INSTRUCTOR_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.Student.ASK_INSTRUCTOR_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Report a Problem")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("If Canvas misbehaves, tell us about it")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.REPORT_PROBLEM_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.REPORT_PROBLEM_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Submit a Feature Idea")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Have an idea to improve Canvas?")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.SUBMIT_FEATURE_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.SUBMIT_FEATURE_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Share Your Love for the App")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Tell us about your favorite parts of the app")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.SHARE_LOVE_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.SHARE_LOVE_SUBTITLE)).assertDisplayed()
}

fun assertHelpMenuURL(helpMenuText: String, expectedURL: String) {
Expand All @@ -151,9 +152,9 @@ class HelpPage : BasePage(R.id.helpDialog) {
Intents.intending(expectedIntent).respondWith(Instrumentation.ActivityResult(0, null))

when (helpMenuText) {
"Search the Canvas Guides" -> clickSearchGuidesLabel()
"Submit a Feature Idea" -> clickSubmitFeatureLabel()
"Share Your Love for the App" -> clickShareLoveLabel()
HelpMenu.SEARCH_GUIDES_TITLE -> clickSearchGuidesLabel()
HelpMenu.SUBMIT_FEATURE_TITLE -> clickSubmitFeatureLabel()
HelpMenu.SHARE_LOVE_TITLE -> clickShareLoveLabel()
}

Intents.intended(expectedIntent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import androidx.test.espresso.intent.Intents
import com.instructure.canvas.espresso.FeatureCategory
import com.instructure.canvas.espresso.Priority
import com.instructure.canvas.espresso.SecondaryFeatureCategory
import com.instructure.canvas.espresso.StringConstants.HelpMenu
import com.instructure.canvas.espresso.TestCategory
import com.instructure.canvas.espresso.TestMetaData
import com.instructure.canvas.espresso.annotations.E2E
import com.instructure.canvas.espresso.annotations.Stub
import com.instructure.canvas.espresso.checkToastText
import com.instructure.teacher.R
import com.instructure.teacher.ui.utils.TeacherTest
Expand Down Expand Up @@ -76,11 +76,11 @@ class HelpMenuE2ETest: TeacherTest() {
Intents.init()

try {
helpPage.assertHelpMenuURL("Search the Canvas Guides", "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
helpPage.assertHelpMenuURL("Submit a Feature Idea", "https://community.canvaslms.com/t5/Idea-Conversations/idb-p/ideas")
helpPage.assertHelpMenuURL("Ask the Community", "https://community.instructure.com")
helpPage.assertHelpMenuURL("Conference Guides for Remote Classrooms", "https://community.canvaslms.com/docs/DOC-18572-conferences-resources")
helpPage.assertHelpMenuURL("Share Your Love for the App", "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
helpPage.assertHelpMenuURL(HelpMenu.SEARCH_GUIDES_TITLE, "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
helpPage.assertHelpMenuURL(HelpMenu.SUBMIT_FEATURE_TITLE, "https://community.canvaslms.com/t5/Idea-Conversations/idb-p/ideas")
helpPage.assertHelpMenuURL(HelpMenu.Teacher.ASK_COMMUNITY_TITLE, "https://community.instructure.com")
helpPage.assertHelpMenuURL(HelpMenu.Teacher.CONFERENCE_GUIDES_TITLE, "https://community.canvaslms.com/docs/DOC-18572-conferences-resources")
helpPage.assertHelpMenuURL(HelpMenu.SHARE_LOVE_TITLE, "https://community.canvaslms.com/t5/Canvas/ct-p/canvas")
}
finally {
Intents.release()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import com.instructure.canvas.espresso.StringConstants.HelpMenu
import com.instructure.canvas.espresso.containsTextCaseInsensitive
import com.instructure.espresso.OnViewWithStringTextIgnoreCase
import com.instructure.espresso.OnViewWithText
Expand Down Expand Up @@ -110,21 +111,21 @@ class HelpPage : BasePage(R.id.helpDialog) {
* Clicks on the 'Conference Guides for Remote Classrooms' help menu.
*/
private fun clickConferenceGuidesForRemoteClassroomsLabel() {
onView(withText("Conference Guides for Remote Classrooms")).scrollTo().click()
onView(withText(HelpMenu.Teacher.CONFERENCE_GUIDES_TITLE)).scrollTo().click()
}

/**
* Clicks on the 'Ask the Community' help menu.
*/
private fun clickAskTheCommunityLabel() {
onView(withText("Ask the Community")).scrollTo().click()
onView(withText(HelpMenu.Teacher.ASK_COMMUNITY_TITLE)).scrollTo().click()
}

/**
* Clicks on the 'Training Services Portal' help menu.
*/
private fun clickTrainingServicesPortalLabel() {
onView(withText("Training Services Portal")).scrollTo().click()
onView(withText(HelpMenu.Teacher.TRAINING_PORTAL_TITLE)).scrollTo().click()
}

/**
Expand Down Expand Up @@ -154,29 +155,29 @@ class HelpPage : BasePage(R.id.helpDialog) {
*/
fun assertHelpMenuContent() {

onView(withId(R.id.title) + withText("Search the Canvas Guides")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Find answers to common questions")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.SEARCH_GUIDES_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.SEARCH_GUIDES_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("CUSTOM LINK")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("This is a custom help link.")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.CUSTOM_LINK_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.CUSTOM_LINK_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Conference Guides for Remote Classrooms")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Get help on how to use and configure conferences in canvas.")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.Teacher.CONFERENCE_GUIDES_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.Teacher.CONFERENCE_GUIDES_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Report a Problem")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("If Canvas misbehaves, tell us about it")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.REPORT_PROBLEM_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.REPORT_PROBLEM_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Ask the Community")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Get help from a Canvas expert")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.Teacher.ASK_COMMUNITY_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.Teacher.ASK_COMMUNITY_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Submit a Feature Idea")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Have an idea to improve Canvas?")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.SUBMIT_FEATURE_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.SUBMIT_FEATURE_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Training Services Portal")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Access Canvas training videos and courses")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.Teacher.TRAINING_PORTAL_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.Teacher.TRAINING_PORTAL_SUBTITLE)).assertDisplayed()

onView(withId(R.id.title) + withText("Share Your Love for the App")).assertDisplayed()
onView(withId(R.id.subtitle) + withText("Tell us about your favorite parts of the app")).assertDisplayed()
onView(withId(R.id.title) + withText(HelpMenu.SHARE_LOVE_TITLE)).assertDisplayed()
onView(withId(R.id.subtitle) + withText(HelpMenu.SHARE_LOVE_SUBTITLE)).assertDisplayed()
}

/**
Expand All @@ -195,12 +196,12 @@ class HelpPage : BasePage(R.id.helpDialog) {
Intents.intending(expectedIntent).respondWith(Instrumentation.ActivityResult(0, null))

when (helpMenuText) {
"Search the Canvas Guides" -> clickSearchGuidesLabel()
"Submit a Feature Idea" -> clickSubmitFeatureLabel()
"Share Your Love for the App" -> clickShareLoveLabel()
"Conference Guides for Remote Classrooms" -> clickConferenceGuidesForRemoteClassroomsLabel()
"Ask the Community" -> clickAskTheCommunityLabel()
"Training Services Portal" -> clickTrainingServicesPortalLabel()
HelpMenu.SEARCH_GUIDES_TITLE -> clickSearchGuidesLabel()
HelpMenu.SUBMIT_FEATURE_TITLE -> clickSubmitFeatureLabel()
HelpMenu.SHARE_LOVE_TITLE -> clickShareLoveLabel()
HelpMenu.Teacher.CONFERENCE_GUIDES_TITLE -> clickConferenceGuidesForRemoteClassroomsLabel()
HelpMenu.Teacher.ASK_COMMUNITY_TITLE -> clickAskTheCommunityLabel()
HelpMenu.Teacher.TRAINING_PORTAL_TITLE -> clickTrainingServicesPortalLabel()
}

Intents.intended(expectedIntent)
Expand Down
Loading
Loading