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

Collection UI Test (disabled currently due to #5793) added #6160

Merged
merged 1 commit into from
Oct 28, 2019
Merged

Collection UI Test (disabled currently due to #5793) added #6160

merged 1 commit into from
Oct 28, 2019

Conversation

nojunpark
Copy link

@nojunpark nojunpark commented Oct 21, 2019

Add Collections UI test that tests:

  • Create Collections
  • Delete Collections
  • Rename Collections
  • Adding a tab to existing Collections

But due to #5793, it is currently disabled. Once Collections refactoring is done by a-c, it should be enabled.

@codecov-io
Copy link

codecov-io commented Oct 22, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@11c07e6). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #6160   +/-   ##
=========================================
  Coverage          ?   14.49%           
  Complexity        ?      323           
=========================================
  Files             ?      272           
  Lines             ?    11039           
  Branches          ?     1593           
=========================================
  Hits              ?     1600           
  Misses            ?     9311           
  Partials          ?      128

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11c07e6...afad82f. Read the comment docs.

Copy link
Contributor

@rpappalax rpappalax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few nits, otherwise looks good

Until.findObject(By.text("testcollection_1")),
TestAssetHelper.waitingTime)
Espresso.onView(ViewMatchers.withText("testcollection_1")).click()
Thread.sleep(5000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this sleep looks brittle, but I think you may have explained why this was necessary? If you must use a sleep here, perhaps could we leave a comment why it's necessary? Also, instead of leaving time integer here, could we instead define that with the other time constants? https://github.com/mozilla-mobile/fenix/blob/master/app/src/androidTest/java/org/mozilla/fenix/helpers/TestAssetHelper.kt#L18-L19 Note: Eventually, we should probably move all of them to the more generic TestHelper since they're being used for things other than test assets.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this sleep was for investigation purpose, good catch.

org.mozilla.fenix.ui.robots.mDevice.wait(
Until.findObject(By.text("testcollection_1")),
TestAssetHelper.waitingTime)
Espresso.onView(ViewMatchers.withText("testcollection_1")).click()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to use Espresso.onView, onView is enough.

// close currently opened tab
homeScreen {
verifyHomeScreen()
Espresso.onView(ViewMatchers.withId(R.id.close_tab_button)).click()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for all these....

@Test
fun OpenTabFromCollectionTest() {
// Open one tab from Collection in the Homescreen view
@Ignore("Temp disable test - see: https://github.com/mozilla-mobile/fenix/issues/5793")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess all these disabled tests work on physical device, just not on x86 (for now) at least til #5793 is resolved, true?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they work on physical devices when ran locally.

}

@Ignore
// Open 2 webpages, and save each of them to a single collection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like these explanatory / summary notes in places where it's not 100% clear what the test objective is. We should do this more often so that it's easier for someone else to maintain the test in the future.

@nojunpark nojunpark merged commit ad94d49 into mozilla-mobile:master Oct 28, 2019
@nojunpark nojunpark deleted the npark-mozilla/collectiontest branch October 28, 2019 19:10
mcarare pushed a commit to mcarare/fenix that referenced this pull request Oct 29, 2019
@severinrudie severinrudie mentioned this pull request Nov 6, 2019
30 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants