parent
4485b7f647
commit
017fb625dd
|
@ -49,6 +49,7 @@ class ThreeDotMenuMainTest {
|
|||
verifySettingsButton()
|
||||
verifyLibraryButton()
|
||||
verifyHelpButton()
|
||||
verifyWhatsNewButton()
|
||||
}.openSettings {
|
||||
verifySettingsView()
|
||||
}.goBack {
|
||||
|
@ -59,6 +60,10 @@ class ThreeDotMenuMainTest {
|
|||
}.openThreeDotMenu {
|
||||
}.openHelp {
|
||||
verifyHelpUrl()
|
||||
}.openHomeScreen {
|
||||
}.openThreeDotMenu {
|
||||
}.openWhatsNew {
|
||||
verifyWhatsNewURL()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,15 @@ class BrowserRobot {
|
|||
.check(matches(withText(containsString(redirectUrl))))
|
||||
}
|
||||
|
||||
fun verifyWhatsNewURL() {
|
||||
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
||||
val redirectUrl = "https://support.mozilla.org/"
|
||||
|
||||
mDevice.waitForIdle()
|
||||
onView(withId(R.id.mozac_browser_toolbar_url_view))
|
||||
.check(matches(withText(containsString(redirectUrl))))
|
||||
}
|
||||
|
||||
/* Asserts that the text within DOM element with ID="testContent" has the given text, i.e.
|
||||
* document.querySelector('#testContent').innerText == expectedText
|
||||
*/
|
||||
|
|
|
@ -44,6 +44,7 @@ class ThreeDotMenuRobot {
|
|||
fun verifyShareDialogTitle() = assertShareDialogTitle()
|
||||
fun verifySendToDeviceTitle() = assertSendToDeviceTitle()
|
||||
fun verifyShareALinkTitle() = assertShareALinkTitle()
|
||||
fun verifyWhatsNewButton() = assertWhatsNewButton()
|
||||
|
||||
class Transition {
|
||||
|
||||
|
@ -112,6 +113,14 @@ class ThreeDotMenuRobot {
|
|||
FindInPageRobot().interact()
|
||||
return FindInPageRobot.Transition()
|
||||
}
|
||||
|
||||
fun openWhatsNew(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
|
||||
mDevice.wait(Until.findObject(By.text("What's New")), waitingTime)
|
||||
whatsNewButton().click()
|
||||
|
||||
BrowserRobot().interact()
|
||||
return BrowserRobot.Transition()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,3 +175,7 @@ private fun assertSendToDeviceTitle() = SendToDeviceTitle()
|
|||
|
||||
private fun ShareALinkTitle() = onView(allOf(withText("SHARE A LINK"), withResourceName("link_header")))
|
||||
private fun assertShareALinkTitle() = ShareALinkTitle()
|
||||
|
||||
private fun whatsNewButton() = onView(allOf(withText("What's New")))
|
||||
private fun assertWhatsNewButton() = whatsNewButton()
|
||||
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
|
||||
|
|
Loading…
Reference in New Issue