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

Issue:116, Issue:173 Verify the nav toolbar buttons[UI Tests] #10822

Conversation

TejaswiKarasani
Copy link
Contributor

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 May 21, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #10822   +/-   ##
=========================================
  Coverage     19.63%   19.63%           
  Complexity      632      632           
=========================================
  Files           363      363           
  Lines         14975    14975           
  Branches       2017     2017           
=========================================
  Hits           2940     2940           
  Misses        11756    11756           
  Partials        279      279           

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 d54dbce...247c2d5. Read the comment docs.

verifyNavURLBar()
clickTabCounter()

// Verify items on HomeScreen
Copy link
Contributor

@isabelrios isabelrios May 21, 2020

Choose a reason for hiding this comment

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

From Browser robot you should use the openHomescreen transition to go to Homescreen and then once there use its robots methods for checking that you are there, going to other menus from there...otherwise you are adding code from that robot to the BrowserRobot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah got that. So, that might be the test failure in emulator may be?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image
Do you mean in this way?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, something like that 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But when function clickTabCounter() is used it will take us to homescreen automatically. Hence, again using transition openHomeScreen causing error as it is already taken to the homescreen on clicking the number of tabs button.

Copy link
Contributor

Choose a reason for hiding this comment

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

So, I tried that, and locally is working:

              verifyNavURLBar()
           }.openHomeScreen {
               verifyHomeScreen()
               verifyExistingTabList()
           }

I think the issue is in after the pressBack() that the test does not wait enough until the website is loaded to continue.
To be sure, try adding TestAssetHelper.waitingTime after that pressBack() if test passes, we will try to find a way to be sure the website is loaded.

Copy link
Contributor Author

@TejaswiKarasani TejaswiKarasani May 22, 2020

Choose a reason for hiding this comment

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

It's seems you missed out adding 'clickTabCounter' function🤔

One of the steps mentioned in testrail is that one needs to click on tab counter and later check whether it's returning back to home screen

Copy link
Contributor

@isabelrios isabelrios May 22, 2020

Choose a reason for hiding this comment

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

No, I didn't, it can go from navigation to homescreen if there is a transition defined...
https://github.com/mozilla-mobile/fenix/blob/master/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt#L338

you are tapping on tabCounter there

Copy link
Contributor Author

@TejaswiKarasani TejaswiKarasani May 22, 2020

Choose a reason for hiding this comment

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

Oops,I should have gone through it carefully. Thanks for pointing out :)

I will rectify and push the code again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After pushing the code, test is failing again!

TestAssetHelper.waitingTime

// Verify various items after returning back to the initial WebPage
verifyPageContent(defaultWebPage.content)
Copy link
Contributor

Choose a reason for hiding this comment

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

@TejaswiKarasani I think the error you are seeing comes from this line...can you try to wait longer just to check that? if it still fails, try commenting out this line...thinking about more options here in the meantime...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

Copy link
Contributor

Choose a reason for hiding this comment

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

Other option may be to check the content in the url bar...and see if that works...

Copy link
Contributor Author

@TejaswiKarasani TejaswiKarasani May 25, 2020

Choose a reason for hiding this comment

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

Other option may be to check the content in the url bar...and see if that works...

When I saw in UI Automator, I couldn't find any specific id for the content in the url bar, I just found the whole url under one id

Copy link
Contributor

Choose a reason for hiding this comment

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

there is text (although I'm not sure you can say starts with...the port number will change each time)
Screenshot 2020-05-25 at 17 56 50

Copy link
Contributor Author

@TejaswiKarasani TejaswiKarasani May 25, 2020

Choose a reason for hiding this comment

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

Yeah, I thought it was the whole red highlight box and didn't struck my mind that it is for text inside the red box and by the way there is some particular function for testhelper.longWaitingTime or testhelper.longWaitingTime...and set time for minutes and seconds? or should I create a separate function for the long waiting time

Copy link
Contributor

Choose a reason for hiding this comment

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

you may be able to use one off those

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah cool.!


// Verify items on HomeScreen
verifyHomeScreen()
verifyExistingTabList()
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh and if I'm not mistaken, we are missing here step 6:

Back on the page, tap the menu button.
Expected Result
The main menu is displayed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I missed that since that text was long, I forgot to expand the excel sheet :/. Thanks for the check :)


// Verify various items after returning back to the initial WebPage
verifyNavURLBar()
verifyUrl((defaultWebPage.url).toString())
Copy link
Contributor

Choose a reason for hiding this comment

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

oh, now test is failing here, it does not find the urlBar element...it is like nothing in that page is seen when running the test...what about tryiing to add aftter line 58 this:
browserScreen { verifyNavURLBar() verifyUrl((defaultWebPage.url).toString()) }

Kind of forcing to say where you are.. and then continue with .openHomeScreen{....} at least locally that works...worth trying...

Copy link
Contributor Author

@TejaswiKarasani TejaswiKarasani May 26, 2020

Choose a reason for hiding this comment

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

image

Is this the approach you were suggesting or should I supposed to add any other?

Copy link
Contributor

Choose a reason for hiding this comment

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

that's right but change the name, is not openBrowserScreen but just browserScreen

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's right but change the name, is not openBrowserScreen but just browserScreen

There isn't any transition named browserScreen , I think I need to create one should I go ahead with that one? Sorry for so many follow ups :/

Copy link
Contributor

Choose a reason for hiding this comment

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

it is not a transition, it is a function in BrowserRobot

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