Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 1059245 - Update tests and framework to use the new Browser app #23467

Merged
merged 1 commit into from Sep 8, 2014

Conversation

chirarobert
Copy link
Contributor

No description provided.

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

@@ -215,7 +215,7 @@ def enable_caps_lock(self):
self.apps.switch_to_displayed_app()

# this would go through fastest way to tap/click through a string
def send(self, string):
def send(self, string, tap_key_at_end=None):
Copy link

Choose a reason for hiding this comment

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

Let's not combine two steps like this, there's no point.
In the test we can always call self.keyboard._enter_key directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue here is that the send() method closes the keyboard after typing. To reopen it I would have to tap on the input field which is in the Homescreen frame.

Would that be preferred over this method?

Copy link
Contributor

Choose a reason for hiding this comment

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

If the keyboard hide, I suggest to maintain the focus of input field instead of doing a work-around. Also, What's wrong with hide the keyboard after typing it? (No offense, just want to know more)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the problem with the keyboard being dismissed after typing is that we can no longer tap the enter key which opens the browser.

Copy link

Choose a reason for hiding this comment

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

@chirarobert I don't see where in the code the send method is closing the keyboard. Is switching back to the displayed app causing it to lose focus?
I would create a new public method called tap_search_button in the Keyboard object, that represents the button on the keyboard and call that in the test.
I'd prefer not to overload this method with more options.

Copy link

Choose a reason for hiding this comment

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

So I've tested this and I tihnk it's a bug that the Marionette command is causing the keyboard to close. Marionette should be able to switch frame without triggering events like this. So we'll need to file a bug against Marionette, probably.

I think it would be better not to change the signature of this method so let's put a hack in search_panel.py to tap the url bar again (to open the keyboard) and then tap enter key. We'll add a comment citing the Marionette bug as the reason for the hack and to remind us to remove it later.

self.apps.kill(browser.app)
self.apps.kill(search.app)

# since the browser windows do not have an app origin they need to be closed manually
Copy link

Choose a reason for hiding this comment

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

The kill here is not acutally a requirement of the test case so to avoid the cards view thing, let's just omit this step and jump straight to disable_wifi

I tihnk we used this to stop hitting OOM on Hamachi, but we have better RAM on flame now!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the steps for closing the search and browser apps.

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

@@ -1,147 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a good way? Removing the whole browser app and using the search app which doesn't make much sense to me somehow...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This page object will not be used anymore after upgrading to the new browser app.

Copy link
Contributor

Choose a reason for hiding this comment

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

I know that, but there is still a browser right? instead of a searching app?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those windows are represented by a new page object.

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

@@ -26,6 +26,9 @@ def type_into_search_box(self, search_term):
# The search results frame is not findable with AppWindowManager
self._switch_to_search_results_frame()

def go_to_url(self, url):
Copy link

Choose a reason for hiding this comment

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

this should return the Browser object

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

@viorelaioia-zz
Copy link

test_browser_bookmark.py is failing with https://pastebin.mozilla.org/6295565.
It looks like a locator change. @chirarobert, can you please update the test so it would pass? Thanks!

def go_to_url(self, url):
self.keyboard.send(url)

#TODO Remove hack once Bug 1062309 is fixed
Copy link

Choose a reason for hiding this comment

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

👍 nice, doesn't look too bad in the end :)

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

@viorelaioia-zz
Copy link

Lgtm, tests are working as expected.

@try-server-hook
Copy link

chirarobert chirarobert started tests. Results

zacc pushed a commit that referenced this pull request Sep 8, 2014
Bug 1059245 - Update tests and framework to use the new Browser app
@zacc zacc merged commit d433078 into mozilla-b2g:master Sep 8, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants