-
Notifications
You must be signed in to change notification settings - Fork 108
[MBL-17659][Student] - Implement E2E test for draft assignment #3467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kdeakinstructure
merged 6 commits into
master
from
MBL-17659-implement-e2e-test-for-draft-assignment
Jan 20, 2026
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7847e62
Implement E2E test for Draft assignment feature.
kdeakinstructure 2ed6737
Merge branch 'master' into MBL-17659-implement-e2e-test-for-draft-ass…
kdeakinstructure a25d89a
Remove old classic TodoPage
kdeakinstructure e2598c3
Add copyright to TextSubmissionUploadPage
kdeakinstructure 1477a67
Merge branch 'master' into MBL-17659-implement-e2e-test-for-draft-ass…
kdeakinstructure fe787c4
Merge branch 'master' into MBL-17659-implement-e2e-test-for-draft-ass…
kdeakinstructure File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 0 additions & 40 deletions
40
...src/androidTest/java/com/instructure/student/ui/pages/classic/TextSubmissionUploadPage.kt
This file was deleted.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
...src/androidTest/java/com/instructure/student/ui/pages/compose/TextSubmissionUploadPage.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| package com.instructure.student.ui.pages.compose | ||
kdeakinstructure marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| import androidx.compose.ui.test.junit4.ComposeTestRule | ||
| import com.instructure.canvas.espresso.TypeInRCETextEditor | ||
| import com.instructure.canvas.espresso.explicitClick | ||
| import com.instructure.composetest.clickToolbarIconButton | ||
| import com.instructure.espresso.OnViewWithId | ||
| import com.instructure.espresso.OnViewWithText | ||
| import com.instructure.espresso.RCETextEditorContentAssertion | ||
| import com.instructure.espresso.RCETextEditorHtmlAssertion | ||
| import com.instructure.espresso.click | ||
| import com.instructure.espresso.page.BasePage | ||
| import com.instructure.espresso.page.onView | ||
| import com.instructure.espresso.page.waitForViewWithId | ||
| import com.instructure.espresso.page.waitForViewWithText | ||
| import com.instructure.espresso.page.withText | ||
| import com.instructure.student.R | ||
|
|
||
| class TextSubmissionUploadPage(private val composeTestRule: ComposeTestRule) : BasePage(R.id.textSubmissionUpload) { | ||
|
|
||
| val submitButton by OnViewWithId(R.id.menuSubmit) | ||
| val contentRceView by OnViewWithId(R.id.rce_webView) | ||
| val textEntryLabel by OnViewWithText(R.string.textEntry) | ||
|
|
||
| fun typeText(textToType: String) { | ||
| contentRceView.perform(TypeInRCETextEditor(textToType)) | ||
| } | ||
|
|
||
| fun clickToolbarBackButton() { | ||
| composeTestRule.clickToolbarIconButton("Back") | ||
| } | ||
|
|
||
| fun clickOnSubmitButton() { | ||
| submitButton.perform(explicitClick()) | ||
| } | ||
|
|
||
| fun clickCancel() { | ||
| onView(withText(com.instructure.pandautils.R.string.cancel)).click() | ||
| } | ||
|
|
||
| fun clickSaveDraft() { | ||
| waitForViewWithText(com.instructure.pandautils.R.string.save).click() | ||
| } | ||
|
|
||
| fun clickDontSaveDraft() { | ||
| waitForViewWithText(com.instructure.pandautils.R.string.dontSave).click() | ||
| } | ||
|
|
||
| fun assertTextSubmissionContentDescriptionDisplayed(expectedText: String) { | ||
| waitForViewWithId(com.instructure.pandautils.R.id.rce_webView).check( | ||
| RCETextEditorContentAssertion(expectedText) | ||
| ) | ||
| } | ||
|
|
||
| fun assertTextSubmissionDisplayed(expectedHtml: String) { | ||
| waitForViewWithId(com.instructure.pandautils.R.id.rce_webView).check( | ||
| RCETextEditorHtmlAssertion(expectedHtml) | ||
| ) | ||
| } | ||
| } | ||
tamaskozmer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
automation/espresso/src/main/kotlin/com/instructure/composetest/ComposeCustomActions.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * Copyright (C) 2026 - present Instructure, Inc. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, version 3 of the License. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| * | ||
| */ | ||
| package com.instructure.composetest | ||
|
|
||
| import androidx.compose.ui.test.hasContentDescription | ||
| import androidx.compose.ui.test.hasParent | ||
| import androidx.compose.ui.test.hasTestTag | ||
| import androidx.compose.ui.test.junit4.ComposeTestRule | ||
| import androidx.compose.ui.test.performClick | ||
|
|
||
| /** | ||
| * Clicks an IconButton within a TopAppBar by content description. | ||
| * | ||
| * @param contentDescription The content description of the IconButton to click (e.g., "Back", "More options") | ||
| * @param toolbarTag The test tag of the TopAppBar, defaults to "toolbar" | ||
| */ | ||
| fun ComposeTestRule.clickToolbarIconButton( | ||
| contentDescription: String, | ||
| toolbarTag: String = "toolbar" | ||
| ) { | ||
| waitForIdle() | ||
| onNode( | ||
| hasParent(hasTestTag(toolbarTag)).and( | ||
| hasContentDescription(contentDescription) | ||
| ) | ||
| ).performClick() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.