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

FNX-14440 ⁃ For #112,#145: Verify Search engine can be changed temporarily using Search engine #13259

Merged
merged 1 commit into from
Aug 18, 2020

Conversation

TejaswiKarasani
Copy link
Contributor

@TejaswiKarasani TejaswiKarasani commented Aug 4, 2020

This PR contains the UI test according these steps in Test Rail

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

After merge

  • Milestone: Make sure issues finished by this pull request are added to the milestone of the version currently in development.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2020

Codecov Report

Merging #13259 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            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.

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

@data-sync-user data-sync-user changed the title For #112,#145: Verify Search engine can be changed temporarily using Search engine FNX-14440 ⁃ For #112,#145: Verify Search engine can be changed temporarily using Search engine Aug 11, 2020
@TejaswiKarasani TejaswiKarasani force-pushed the temporaryEngine branch 2 times, most recently from 4ac84ba to a09fb02 Compare August 17, 2020 08:09

private fun assertSearchEngineList() {
scrollToElementByText("Google")
onView(withText("Google"))
Copy link
Contributor

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))
Copy link
Contributor

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

Copy link
Contributor

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 {

Copy link
Contributor

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 {

Copy link
Contributor

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 {
Copy link
Contributor

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")
Copy link
Contributor

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() {
Copy link
Contributor

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:
Captura de pantalla 2020-08-17 a las 13 26 44

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

Copy link
Contributor

@isabelrios isabelrios left a 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")
Copy link
Contributor

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.

Copy link
Contributor

@isabelrios isabelrios left a 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!

@TejaswiKarasani TejaswiKarasani marked this pull request as ready for review August 18, 2020 16:22
@rpappalax rpappalax merged commit cd729b3 into mozilla-mobile:master Aug 18, 2020
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

4 participants