No issue: Re-enable Context Menu UI tests (#12250)
parent
901a90643f
commit
0a4f92a5d0
|
@ -9,11 +9,11 @@
|
||||||
<a href="generic3.html">Link 3</a>
|
<a href="generic3.html">Link 3</a>
|
||||||
<p>
|
<p>
|
||||||
<a href="../resources/rabbit.jpg">
|
<a href="../resources/rabbit.jpg">
|
||||||
<img src="../resources/rabbit.jpg" title="test_link_image">
|
<img src="../resources/rabbit.jpg" alt="test_link_image">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<img src="../resources/rabbit.jpg" title="test_no_link_image">
|
<img src="../resources/rabbit.jpg" alt="test_no_link_image">
|
||||||
</p>
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -7,7 +7,5 @@ object Constants {
|
||||||
const val GOOGLE_APPS_PHOTOS = "com.google.android.apps.photos"
|
const val GOOGLE_APPS_PHOTOS = "com.google.android.apps.photos"
|
||||||
}
|
}
|
||||||
|
|
||||||
object LongClickDuration {
|
const val LONG_CLICK_DURATION: Long = 5000
|
||||||
const val LONG_CLICK_DURATION: Long = 5000
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,6 @@ class ContextMenusTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore("Disabling because of intermittent failures https://github.com/mozilla-mobile/fenix/issues/8663")
|
|
||||||
fun verifyContextOpenLinkNewTab() {
|
fun verifyContextOpenLinkNewTab() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
|
@ -75,7 +74,6 @@ class ContextMenusTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Intermittent failure - https://github.com/mozilla-mobile/fenix/issues/10586")
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextOpenLinkPrivateTab() {
|
fun verifyContextOpenLinkPrivateTab() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
|
@ -98,7 +96,6 @@ class ContextMenusTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Intermittent failure - https://github.com/mozilla-mobile/fenix/issues/8832")
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextCopyLink() {
|
fun verifyContextCopyLink() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
|
@ -119,7 +116,6 @@ class ContextMenusTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Intermittent failure - https://github.com/mozilla-mobile/fenix/issues/10586")
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextShareLink() {
|
fun verifyContextShareLink() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
|
@ -136,7 +132,6 @@ class ContextMenusTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Temp disable intermittent failure - https://github.com/mozilla-mobile/fenix/issues/7687")
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextOpenImageNewTab() {
|
fun verifyContextOpenImageNewTab() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
|
@ -156,8 +151,8 @@ class ContextMenusTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Temp disable intermittent failure - https://github.com/mozilla-mobile/fenix/issues/7687")
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore("Disabled – Google Keyboard Clipboard overlay blocks the address bar: https://github.com/mozilla-mobile/fenix/issues/10586")
|
||||||
fun verifyContextCopyImageLocation() {
|
fun verifyContextCopyImageLocation() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
TestAssetHelper.getGenericAsset(mockWebServer, 4)
|
||||||
|
@ -177,7 +172,6 @@ class ContextMenusTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Temp disable intermittent failure - https://github.com/mozilla-mobile/fenix/issues/7666")
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextSaveImage() {
|
fun verifyContextSaveImage() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
|
@ -202,7 +196,6 @@ class ContextMenusTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Temp disable intermittent failure - https://github.com/mozilla-mobile/fenix/issues/7693")
|
|
||||||
@Test
|
@Test
|
||||||
fun verifyContextMixedVariations() {
|
fun verifyContextMixedVariations() {
|
||||||
val pageLinks =
|
val pageLinks =
|
||||||
|
@ -217,12 +210,12 @@ class ContextMenusTest {
|
||||||
// verifyPageContent(pageLinks.content)
|
// verifyPageContent(pageLinks.content)
|
||||||
longClickMatchingText("Link 1")
|
longClickMatchingText("Link 1")
|
||||||
verifyLinkContextMenuItems(genericURL.url)
|
verifyLinkContextMenuItems(genericURL.url)
|
||||||
mDevice.pressBack()
|
dismissContentContextMenu(genericURL.url)
|
||||||
longClickMatchingText("test_link_image")
|
longClickMatchingText("test_link_image")
|
||||||
verifyLinkImageContextMenuItems(imageResource.url)
|
verifyLinkImageContextMenuItems(imageResource.url)
|
||||||
mDevice.pressBack()
|
dismissContentContextMenu(imageResource.url)
|
||||||
longClickMatchingText("test_no_link_image")
|
longClickMatchingText("test_no_link_image")
|
||||||
verifyNoLinkImageContextMenuItems("test_no_link_image")
|
verifyNoLinkImageContextMenuItems(imageResource.url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,11 @@ import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||||
import androidx.test.espresso.intent.Intents
|
import androidx.test.espresso.intent.Intents
|
||||||
import androidx.test.espresso.intent.matcher.BundleMatchers
|
import androidx.test.espresso.intent.matcher.BundleMatchers
|
||||||
import androidx.test.espresso.intent.matcher.IntentMatchers
|
import androidx.test.espresso.intent.matcher.IntentMatchers
|
||||||
|
import androidx.test.espresso.matcher.RootMatchers.isDialog
|
||||||
import androidx.test.espresso.matcher.ViewMatchers
|
import androidx.test.espresso.matcher.ViewMatchers
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed
|
import androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.Visibility
|
import androidx.test.espresso.matcher.ViewMatchers.Visibility
|
||||||
|
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
|
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||||
|
@ -34,7 +36,7 @@ import org.hamcrest.CoreMatchers.containsString
|
||||||
import org.junit.Assert.assertTrue
|
import org.junit.Assert.assertTrue
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.ext.components
|
import org.mozilla.fenix.ext.components
|
||||||
import org.mozilla.fenix.helpers.Constants.LongClickDuration
|
import org.mozilla.fenix.helpers.Constants.LONG_CLICK_DURATION
|
||||||
import org.mozilla.fenix.helpers.TestAssetHelper
|
import org.mozilla.fenix.helpers.TestAssetHelper
|
||||||
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
|
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
|
||||||
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTimeShort
|
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTimeShort
|
||||||
|
@ -165,9 +167,9 @@ class BrowserRobot {
|
||||||
verifyMenuButton()
|
verifyMenuButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun verifyNoLinkImageContextMenuItems(containsTitle: String) {
|
fun verifyNoLinkImageContextMenuItems(containsURL: Uri) {
|
||||||
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
|
||||||
mDevice.waitNotNull(Until.findObject(By.textContains(containsTitle)))
|
mDevice.waitNotNull(Until.findObject(By.textContains(containsURL.toString())))
|
||||||
mDevice.waitNotNull(
|
mDevice.waitNotNull(
|
||||||
Until.findObject(text("Open image in new tab")),
|
Until.findObject(text("Open image in new tab")),
|
||||||
waitingTime
|
waitingTime
|
||||||
|
@ -178,6 +180,13 @@ class BrowserRobot {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun dismissContentContextMenu(containsURL: Uri) {
|
||||||
|
onView(withText(containsURL.toString()))
|
||||||
|
.inRoot(isDialog())
|
||||||
|
.check(matches(isDisplayed()))
|
||||||
|
.perform(ViewActions.pressBack())
|
||||||
|
}
|
||||||
|
|
||||||
fun clickEnhancedTrackingProtectionPanel() = enhancedTrackingProtectionPanel().click()
|
fun clickEnhancedTrackingProtectionPanel() = enhancedTrackingProtectionPanel().click()
|
||||||
|
|
||||||
fun clickContextOpenLinkInNewTab() {
|
fun clickContextOpenLinkInNewTab() {
|
||||||
|
@ -291,7 +300,7 @@ class BrowserRobot {
|
||||||
mDevice.waitNotNull(Until.findObject(text(expectedText)), waitingTime)
|
mDevice.waitNotNull(Until.findObject(text(expectedText)), waitingTime)
|
||||||
|
|
||||||
val element = mDevice.findObject(text(expectedText))
|
val element = mDevice.findObject(text(expectedText))
|
||||||
element.click(LongClickDuration.LONG_CLICK_DURATION)
|
element.click(LONG_CLICK_DURATION)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun snackBarButtonClick(expectedText: String) {
|
fun snackBarButtonClick(expectedText: String) {
|
||||||
|
|
|
@ -123,7 +123,7 @@ private fun clickDownloadButton() =
|
||||||
onView(withText("Download")).inRoot(isDialog()).check(matches(isDisplayed()))
|
onView(withText("Download")).inRoot(isDialog()).check(matches(isDisplayed()))
|
||||||
|
|
||||||
private fun clickOpenButton() =
|
private fun clickOpenButton() =
|
||||||
onView(withId(R.id.download_dialog_action_button)).inRoot(isDialog()).check(
|
onView(withId(R.id.download_dialog_action_button)).check(
|
||||||
matches(isDisplayed())
|
matches(isDisplayed())
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue