-
Notifications
You must be signed in to change notification settings - Fork 1.3k
FNX-14440 ⁃ For #112,#145: Verify Search engine can be changed temporarily using Search engine #13259
FNX-14440 ⁃ For #112,#145: Verify Search engine can be changed temporarily using Search engine #13259
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13259 +/- ##
=========================================
Coverage 29.57% 29.57%
Complexity 1111 1111
=========================================
Files 421 421
Lines 17163 17163
Branches 2229 2229
=========================================
Hits 5076 5076
Misses 11713 11713
Partials 374 374 Continue to review full report at Codecov.
|
4ac84ba
to
a09fb02
Compare
|
||
private fun assertSearchEngineList() { | ||
scrollToElementByText("Google") | ||
onView(withText("Google")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all these scrollToElementByText. Instead on line 233 add onView(withId(R.id.mozac_browser_toolbar_edit_icon)).click()
Thay way the keyboard will be dismissed and we can check all the elements on the screen without having to scroll.
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) | ||
|
||
private fun selectDefaultSearchEngine(searchEngine: String) { | ||
onView(withText(searchEngine)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be sure we can select each searchEngine in the list, let's dismiss the keyboard first by doing:
onView(withId(R.id.mozac_browser_toolbar_edit_icon)).click()
I have found many issues when running the test to be able to click on Twitter or the next search Engine in the list. With this line we are sure all the search engines in the list are visible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This would go in the previous line to this one, just below the method definition)
}.goToSearchEngine { | ||
}.enterURLAndEnterToBrowser(defaultWebPage.url) { | ||
}.openTabDrawer { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove line
}.goToSearchEngine { | ||
}.enterURLAndEnterToBrowser(defaultWebPage.url) { | ||
}.openTabDrawer { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: same as above
}.goToSearchEngine { | ||
}.enterURLAndEnterToBrowser(defaultWebPage.url) { | ||
}.openTabDrawer { | ||
}.openHomeScreen { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add a comment here, Changing to default search engine, or something similar
}.openHomeScreen { | ||
}.openSearch { | ||
clickSearchEngineButton() | ||
scrollToElementByText("Wikipedia") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to this scroll if you do what I suggest in the search robot to avoid issues with the scroll view
fun verifyKeyboardVisibility() = assertKeyboardVisibility(isExpectedToBeVisible = true) | ||
fun verifySearchEngineList() = assertSearchEngineList() | ||
fun verifySearchEngineIcon(expectedText: String) = assertSearchEngineIconsList(expectedText) | ||
fun verifySearchEngineIconsList() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this check in favor or a modified verifySearchIcon. What we want to be sure is that when the search engine is changed, that the new search is going to use that one. So, when we want to check that would be at this point:
I would change the verifySearchEngineIcon
like:
fun verifySearchEngineIcon(expectedText: String) {
onView(withContentDescription(expectedText))
}
And I would add a call to that function after changing the search engine each time...as commented in the smoketest file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is looking really good now. There are a few changes needed in order to have the test working on firebase and with a cleaner code. Hope the changes suggested make sense, let me know otherwise or any question you may have.
clickSearchEngineButton() | ||
verifySearchEngineList() | ||
verifySearchEngineIconsList() | ||
changeDefaultSearchEngine("Amazon.com") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this line we will need to check that the searc icon is the correct one for that search engine. It would be good to add this check:
verifySearchEngineIconsList()
after chaning the search engine each time.
c6cbf91
to
0e1f1f4
Compare
…e changed temporarily using Search engine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! squash the commits and that would be it!
(Test passed all the 25 times it run)
Great work! thanks!
0e1f1f4
to
ae78ecb
Compare
This PR contains the UI test according these steps in Test Rail
Pull Request checklist
After merge
To download an APK when reviewing a PR: