diff options
| author | Gord Allott <gord.allott@canonical.com> | 2012-08-14 14:09:24 +0100 |
|---|---|---|
| committer | Gord Allott <gord.allott@canonical.com> | 2012-08-14 14:09:24 +0100 |
| commit | 4b207353f8f442241b860b73a2e2f4f3d9c49ddf (patch) | |
| tree | 54ff327b8e01cc0fc4f5c9b91e61688e78bce760 | |
| parent | a33c9c2070684f7ee41a2efe3c2dcbbff5e9197c (diff) | |
ap tests
(bzr r2419.6.28)
| -rw-r--r-- | tests/autopilot/unity/emulators/dash.py | 5 | ||||
| -rw-r--r-- | tests/autopilot/unity/tests/test_dash.py | 23 |
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/autopilot/unity/emulators/dash.py b/tests/autopilot/unity/emulators/dash.py index f7d315b65..514f4f083 100644 --- a/tests/autopilot/unity/emulators/dash.py +++ b/tests/autopilot/unity/emulators/dash.py @@ -82,6 +82,11 @@ class Dash(KeybindingsHelper): """Returns the searchbar attached to the dash.""" return self.view.get_searchbar() + @property + def preview_displaying(self): + """Returns true if the dash is currently displaying a preview""" + return self.view.preview_displaying; + def get_num_rows(self): """Returns the number of displayed rows in the dash.""" return self.view.num_rows diff --git a/tests/autopilot/unity/tests/test_dash.py b/tests/autopilot/unity/tests/test_dash.py index 18190cb16..de7bab5fa 100644 --- a/tests/autopilot/unity/tests/test_dash.py +++ b/tests/autopilot/unity/tests/test_dash.py @@ -543,3 +543,26 @@ class CategoryHeaderTests(DashTestCase): self.mouse.click() self.assertThat(category.is_expanded, Eventually(Equals(is_expanded))) + +class PreviewInvocationTests(DashTestCase): + """Tests that previews can be opened and closed + """ + def test_open_preview_close_preview(self): + """Right clicking on any result shall open a preview, + escaping shall close the preview + """ + lens = self.dash.reveal_application_lens() + self.addCleanup(self.dash.ensure_hidden) + + category = lens.get_category_by_name("Installed") + + self.mouse_move(self.dash.view.x + 24, + category.header_y + category.header_height + 24) + + self.mouse.click(button=3) + #revealing a preview may be very slow, not sure if Eventually handles that nicely + self.assertThat(self.dash.preview_displaying, Eventually(Equals(True))) + + self.keyboard.press_and_release("Esc") + + self.assertThat(self.dash.preview_displaying, Eventually(Equals(False))) |
