mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
parent
1372ed5837
commit
eb2eed1c9c
@ -112,7 +112,7 @@ class ContextMenusTest {
|
|||||||
clickContextCopyLink()
|
clickContextCopyLink()
|
||||||
verifySnackBarText("Link copied to clipboard")
|
verifySnackBarText("Link copied to clipboard")
|
||||||
}.openNavigationToolbar {
|
}.openNavigationToolbar {
|
||||||
}.visitLinkFromClipboard(genericURL.url) {
|
}.visitLinkFromClipboard {
|
||||||
verifyUrl(genericURL.url.toString())
|
verifyUrl(genericURL.url.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,7 +169,7 @@ class ContextMenusTest {
|
|||||||
clickContextCopyImageLocation()
|
clickContextCopyImageLocation()
|
||||||
verifySnackBarText("Link copied to clipboard")
|
verifySnackBarText("Link copied to clipboard")
|
||||||
}.openNavigationToolbar {
|
}.openNavigationToolbar {
|
||||||
}.visitLinkFromClipboard(imageResource.url) {
|
}.visitLinkFromClipboard {
|
||||||
verifyUrl(imageResource.url.toString())
|
verifyUrl(imageResource.url.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,14 +38,14 @@ class BrowserRobot {
|
|||||||
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun verifyUrl(redirectUrl: String) {
|
fun verifyUrl(url: String) {
|
||||||
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
||||||
mDevice.waitNotNull(
|
mDevice.waitNotNull(
|
||||||
Until.findObject(By.res("org.mozilla.fenix.debug:id/mozac_browser_toolbar_url_view")),
|
Until.findObject(By.res("org.mozilla.fenix.debug:id/mozac_browser_toolbar_url_view")),
|
||||||
TestAssetHelper.waitingTime
|
TestAssetHelper.waitingTime
|
||||||
)
|
)
|
||||||
onView(withId(R.id.mozac_browser_toolbar_url_view))
|
onView(withId(R.id.mozac_browser_toolbar_url_view))
|
||||||
.check(matches(withText(containsString(redirectUrl))))
|
.check(matches(withText(containsString(url))))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun verifyHelpUrl() {
|
fun verifyHelpUrl() {
|
||||||
|
@ -54,7 +54,7 @@ class NavigationToolbarRobot {
|
|||||||
return BrowserRobot.Transition()
|
return BrowserRobot.Transition()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun visitLinkFromClipboard(url: Uri, interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
|
fun visitLinkFromClipboard(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
|
||||||
mDevice.waitNotNull(
|
mDevice.waitNotNull(
|
||||||
Until.findObject(By.res("org.mozilla.fenix.debug:id/mozac_browser_toolbar_clear_view")),
|
Until.findObject(By.res("org.mozilla.fenix.debug:id/mozac_browser_toolbar_clear_view")),
|
||||||
waitingTime
|
waitingTime
|
||||||
@ -62,11 +62,12 @@ class NavigationToolbarRobot {
|
|||||||
clearAddressBar().click()
|
clearAddressBar().click()
|
||||||
|
|
||||||
mDevice.waitNotNull(
|
mDevice.waitNotNull(
|
||||||
Until.findObject(By.text(url.toString())), waitingTime
|
Until.findObject(By.res("org.mozilla.fenix.debug:id/clipboard_title")),
|
||||||
|
waitingTime
|
||||||
)
|
)
|
||||||
|
|
||||||
mDevice.waitNotNull(
|
mDevice.waitNotNull(
|
||||||
Until.findObject(By.res("org.mozilla.fenix.debug:id/fill_link_from_clipboard")),
|
Until.findObject(By.res("org.mozilla.fenix.debug:id/clipboard_url")),
|
||||||
waitingTime
|
waitingTime
|
||||||
)
|
)
|
||||||
fillLinkButton().click()
|
fillLinkButton().click()
|
||||||
@ -87,5 +88,5 @@ private fun urlBar() = onView(ViewMatchers.withId(R.id.toolbar))
|
|||||||
private fun awesomeBar() = onView(ViewMatchers.withId(R.id.mozac_browser_toolbar_edit_url_view))
|
private fun awesomeBar() = onView(ViewMatchers.withId(R.id.mozac_browser_toolbar_edit_url_view))
|
||||||
private fun threeDotButton() = onView(ViewMatchers.withContentDescription("Menu"))
|
private fun threeDotButton() = onView(ViewMatchers.withContentDescription("Menu"))
|
||||||
private fun newTab() = onView(ViewMatchers.withContentDescription("Add tab"))
|
private fun newTab() = onView(ViewMatchers.withContentDescription("Add tab"))
|
||||||
private fun fillLinkButton() = onView(ViewMatchers.withId(R.id.fill_link_from_clipboard))
|
private fun fillLinkButton() = onView(ViewMatchers.withId(R.id.clipboard_url))
|
||||||
private fun clearAddressBar() = onView(ViewMatchers.withId(R.id.mozac_browser_toolbar_clear_view))
|
private fun clearAddressBar() = onView(ViewMatchers.withId(R.id.mozac_browser_toolbar_clear_view))
|
||||||
|
Loading…
Reference in New Issue
Block a user