~uriboni/webbrowser-app/newtabview-listviews

« back to all changes in this revision

Viewing changes to tests/autopilot/webbrowser_app/tests/test_addressbar_states.py

  • Committer: Ugo Riboni
  • Date: 2015-11-16 09:11:32 UTC
  • mfrom: (1226.5.34 webbrowser-app)
  • Revision ID: ugo.riboni@canonical.com-20151116091132-4jykz6q4jt2zjl3l
Merge changes from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
 
 
17
import testtools
 
18
from testtools.matchers import Equals
 
19
from autopilot.matchers import Eventually
 
20
from autopilot.platform import model
 
21
 
17
22
from webbrowser_app.tests import StartOpenRemotePageTestCaseBase
18
23
 
19
24
 
53
58
        address_bar.write(self.url)
54
59
        address_bar.click_action_button()
55
60
        address_bar.activeFocus.wait_for(False)
 
61
 
 
62
    # http://pad.lv/1456199
 
63
    @testtools.skipIf(model() != "Desktop", "on desktop only")
 
64
    def test_clears_when_actual_url_changed(self):
 
65
        address_bar = self.main_window.address_bar
 
66
        self.pointing_device.click_object(address_bar)
 
67
        address_bar.activeFocus.wait_for(True)
 
68
        url = self.base_url + "/test1"
 
69
        self.main_window.go_to_url(url)
 
70
        self.main_window.wait_until_page_loaded(url)
 
71
        self.pointing_device.click_object(address_bar)
 
72
        address_bar.activeFocus.wait_for(True)
 
73
        self.new_tab_view = self.open_new_tab(open_tabs_view=True)
 
74
        self.assertThat(address_bar.text, Eventually(Equals("")))
 
75
 
 
76
    # http://pad.lv/1487713
 
77
    def test_does_not_clear_when_typing_while_loading(self):
 
78
        address_bar = self.main_window.address_bar
 
79
        self.pointing_device.click_object(address_bar)
 
80
        address_bar.activeFocus.wait_for(True)
 
81
        url = self.base_url + "/wait/3"
 
82
        self.main_window.go_to_url(url)
 
83
        self.pointing_device.click_object(address_bar)
 
84
        address_bar.write("x")
 
85
        self.main_window.wait_until_page_loaded(url)
 
86
        self.assertThat(address_bar.text, Equals("x"))