Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

CI for #15730 #28078

Closed
Show file tree
Hide file tree
Changes from all 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 @@ -128,6 +128,27 @@ class ContextMenusTest {
}
}

@Test
fun verifyContextCopyLinkNotDisplayedAfterApplied() {
val pageLinks = TestAssetHelper.getGenericAsset(mockWebServer, 4)
val genericURL = TestAssetHelper.getGenericAsset(mockWebServer, 3)

navigationToolbar {
}.enterURLAndEnterToBrowser(pageLinks.url) {
mDevice.waitForIdle()
longClickMatchingText("Link 3")
verifyLinkContextMenuItems(genericURL.url)
clickContextCopyLink()
verifySnackBarText("Link copied to clipboard")
}.openNavigationToolbar {
}.visitLinkFromClipboard {
verifyUrl(genericURL.url.toString())
}.openTabDrawer {
}.openNewTab {
verifyFillLinkButton()
}
}

@Test
fun verifyContextShareLink() {
val pageLinks =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class SearchRobot {
onView(withContentDescription(expectedText))
}
fun verifyDefaultSearchEngine(expectedText: String) = assertDefaultSearchEngine(expectedText)
fun verifyFillLinkButton() = assertFillLinkButton()

fun verifyEnginesListShortcutContains(rule: ComposeTestRule, searchEngineName: String) = assertEngineListShortcutContains(rule, searchEngineName)

Expand Down Expand Up @@ -533,7 +534,15 @@ private fun assertTranslatedFocusedNavigationToolbar(toolbarHintString: String)
).waitForExists(waitingTime),
)

private fun assertFillLinkButton() {
mDevice.waitForIdle()
onView(withId(R.id.fill_link_from_clipboard))
.check(matches(withEffectiveVisibility(Visibility.GONE)))
}

private val awesomeBar =
mDevice.findObject(UiSelector().resourceId("$packageName:id/mozac_browser_toolbar_edit_url_view"))

private val voiceSearchButton = mDevice.findObject(UiSelector().description("Voice search"))

private fun goBackButton() = onView(allOf(withContentDescription("Navigate up")))
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
from = BrowserDirection.FromSearchDialog,
)
}
requireContext().components.clipboardHandler.text = null
}

val stubListener = ViewStub.OnInflateListener { _, inflated ->
Expand Down