1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2
# Copyright 2013 Canonical
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU General Public License version 3, as published
6
# by the Free Software Foundation.
8
"""Docviewer app autopilot tests."""
10
from __future__ import absolute_import
12
from autopilot.matchers import Eventually
13
from testtools.matchers import Equals
15
from ubuntu_docviewer_app.tests import DocviewerTestCase
18
class TestMainWindow(DocviewerTestCase):
21
super(TestMainWindow, self).setUp()
23
self.main_window.get_qml_view().visible, Eventually(Equals(True)))
26
super(TestMainWindow, self).tearDown()
28
def test_toolbar_shows(self):
29
"""Make sure that dragging from the bottom reveals the hidden
31
toolbar = self.main_window.get_toolbar()
33
x, y, w, h = toolbar.globalRect
37
self.pointing_device.drag(tx, ty, tx, ty - h)
38
self.assertThat(toolbar.state, Eventually(Equals("spread")))