summaryrefslogtreecommitdiff
diff options
authorOmer Akram <om26er@ubuntu.com>2012-08-27 21:14:32 -0400
committerTarmac <>2012-08-27 21:14:32 -0400
commit0de5792f5c57f85da4a0be5ecb4c6feebc3f6ae6 (patch)
treed204ee79384783f7fd7a0e33709f9d0b48555229
parent6390754f41cf1af439309ff4feef33250103d393 (diff)
parenta7e1e06dd02c32441b45956ede25f64e84e7f190 (diff)
Removed manual-tests that were already automated by Nick, added two tests to ensure Music and Video lens previews are tested.6.4.0
Also made a single class for all the Invocation tests previously they were in separate classes.. Fixes: . Approved by Thomi Richards. (bzr r2632)
-rw-r--r--manual-tests/Preview.txt130
-rw-r--r--tests/autopilot/unity/tests/test_dash.py108
2 files changed, 62 insertions, 176 deletions
diff --git a/manual-tests/Preview.txt b/manual-tests/Preview.txt
index 77050010d..4b6e6093c 100644
--- a/manual-tests/Preview.txt
+++ b/manual-tests/Preview.txt
@@ -1,114 +1,3 @@
-Preview Tests
-=============
-
-Application Preview Open
-------------
-This tests that the dash preview opens using mouse right-click
-
-Setup:
-#. Open application lens (Super+A)
-#. Enter arbitrary search string and ensure a result is available.
-
-Actions:
-#. Right-click the mouse on one of the results.
-
-Expected Result:
- A application preview view will replace the dash lens view.
- If multiple results were available in the dash, there will be navigator
- buttons on either side of the preview.
-
-
-File Preview Open
-------------
-This tests that the dash preview opens using mouse right-click
-
-Setup:
-#. Open file lens (Super+F)
-#. Enter arbitrary search string and ensure a result is available.
-
-Actions:
-#. Right-click the mouse on one of the results.
-
-Expected Result:
- A file preview view will replace the dash lens view.
- If multiple results were available in the dash, there will be navigator
- icons on either side of the preview.
-
-
-Music Preview Open
-note: Should be automated.
-------------
-This tests that the dash preview opens using mouse right-click
-
-Setup:
-#. Open music lens (Super+M)
-#. Enter arbitrary search string and ensure a result is available.
-
-Actions:
-#. Right-click the mouse on one of the results.
-
-Expected Result:
- A music preview view will replace the dash lens view.
- If multiple results were available in the dash, there will be navigator
- icons on either side of the preview.
-
-
-Video Preview Open
-note: Should be automated.
-------------
-This tests that the dash preview opens using mouse right-click
-
-Setup:
-#. Open video lens (Super+V)
-#. Enter arbitrary search string and ensure a result is available.
-
-Actions:
-#. Right-click the mouse on one of the results.
-
-Expected Result:
- A video preview view will replace the dash lens view.
- If multiple results were available in the dash, there will be navigator
- icons on either side of the preview.
-
-
-Preview Left Navigation
-------------
-This tests the dash preview animation
-
-Setup:
-#. Open dash super
-#. Open a lens which supports previeing (eg Application, Music, File)
-#. Enter arbitrary search string and ensure at least 2 results are available.
-
-Actions:
-#. Right-click the mouse on at least the second result.
-#. Wait for the preview window to open and finish animating.
-#. Click the 'navigate left' icon.
-
-Expected Result:
- The current preview will be replaced with a preview modelled on the previous result
- in the dash.
-
-
-Preview Right Navigation
-------------
-This tests the dash preview animation
-
-Setup:
-#. Open dash super
-#. Open a lens which supports previeing (eg Application, Music, File)
-#. Enter arbitrary search string and ensure at least 2 results are available.
-
-Actions:
-#. Right-click the mouse on at most the second last result.
-#. Wait for the preview window to open and finish animating.
-#. Click the 'navigate right' icon.
-
-Expected Result:
- The current preview will be replaced with a preview modelled on the next result
- in the dash.
-
-
Preview Open Animation
note: Should be automated.
------------
@@ -167,25 +56,6 @@ Expected Result:
to left using an ease in-out curve progression.
-Preview Navigate Many
-------------
-This tests the dash preview multi-navigation support
-
-Setup:
-#. Open dash super
-#. Open a lens which supports previeing (eg Application, Music, File)
-#. Enter arbitrary search string and ensure at least 3 results are available.
-#. Right-click first result.
-#. Wait for the preview window to open and finish animating.
-
-Actions:
-#. Click 'navigate right' icon twice quickly.
-
-Expected Result:
- The current preview will swipe out, being replaced intermittently by the next preview,
- which will then be replaced by the next preview.
-
-
Preview Music Tracks
note: Should be automated.
------------
diff --git a/tests/autopilot/unity/tests/test_dash.py b/tests/autopilot/unity/tests/test_dash.py
index ab4c5b489..d6e270ee6 100644
--- a/tests/autopilot/unity/tests/test_dash.py
+++ b/tests/autopilot/unity/tests/test_dash.py
@@ -609,93 +609,97 @@ class CategoryHeaderTests(DashTestCase):
self.assertThat(category.is_expanded, Eventually(Equals(is_expanded)))
-class PreviewAppLensInvocationTests(DashTestCase):
- """Tests that application lens previews can be opened and closed
+class PreviewInvocationTests(DashTestCase):
+ """Tests that dash previews can be opened and closed in different
+ lenses.
+
"""
- def assertSearchText(self, text):
- self.assertThat(self.dash.search_string, Eventually(Equals(text)))
+
+ def test_app_lens_preview_open_close(self):
+ """Right-clicking on an application lens result must show
+ its preview.
- 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")
results = category.get_results()
- # wait for a result
- refresh_fn = lambda: len(results)
- self.assertThat(refresh_fn, Eventually(GreaterThan(0)))
-
result = results[0]
# result.preview handles finding xy co-ords and right mouse-click
result.preview()
- # 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("Escape")
self.assertThat(self.dash.preview_displaying, Eventually(Equals(False)))
- def test_preview_refocus_close(self):
- """This tests that if the mouse is clicked on a preview element (Cover art for example),
- the keyboard shortcut for closing ('Escape') still works correctly.
+ def test_files_lens_preview_open_close(self):
+ """Right-clicking on a files lens result must show its
+ preview.
+
"""
- lens = self.dash.reveal_application_lens()
+ lens = self.dash.reveal_file_lens()
self.addCleanup(self.dash.ensure_hidden)
- category = lens.get_category_by_name("Installed")
+ category = lens.get_category_by_name("Folders")
results = category.get_results()
- # wait for a result
- refresh_fn = lambda: len(results)
- self.assertThat(refresh_fn, Eventually(GreaterThan(0)))
-
result = results[0]
# result.preview handles finding xy co-ords and right mouse-click
result.preview()
- # revealing a preview may be very slow, not sure if Eventually handles that nicely
self.assertThat(self.dash.preview_displaying, Eventually(Equals(True)))
- preview_container = self.dash.view.get_preview_container()
- # wait for settle.
- self.assertThat(preview_container.animating, Eventually(Equals(False)))
- cover_art = preview_container.current_preview.cover_art
+ self.keyboard.press_and_release("Escape")
- # click the cover-art (this will set focus)
- tx = cover_art.x + (cover_art.width / 2)
- ty = cover_art.y + (cover_art.height / 2)
- self.mouse.move(tx, ty)
- self.mouse.click()
+ self.assertThat(self.dash.preview_displaying, Eventually(Equals(False)))
+
+ def test_music_lens_preview_open_close(self):
+ """Right-clicking on a music lens result must show its
+ preview.
+
+ """
+ lens = self.dash.reveal_music_lens()
+ self.addCleanup(self.dash.ensure_hidden)
+
+ category = lens.get_category_by_name("Songs")
+ # Incase there was no music ever played we skip the test instead
+ # of failing.
+ if category is None:
+ self.skipTest("This lens is probably empty")
+
+ results = category.get_results()
+
+ result = results[0]
+ # result.preview handles finding xy co-ords and right mouse-click
+ result.preview()
+ self.assertThat(self.dash.preview_displaying, Eventually(Equals(True)))
self.keyboard.press_and_release("Escape")
self.assertThat(self.dash.preview_displaying, Eventually(Equals(False)))
+ def test_video_lens_preview_open_close(self):
+ """Right-clicking on a video lens result must show its
+ preview.
-class PreviewFileLensInvocationTests(DashTestCase):
- """Tests that file lens previews can be opened and closed
- """
- def assertSearchText(self, text):
- self.assertThat(self.dash.search_string, Eventually(Equals(text)))
-
- 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_file_lens()
+ lens = self.dash.reveal_video_lens()
self.addCleanup(self.dash.ensure_hidden)
- category = lens.get_category_by_name("Folders")
+ category = lens.get_category_by_name("Recently Viewed")
+ # If there was no video played on this system this category is expected
+ # to be empty, if its empty we check if the 'Online' category have any
+ # contents, if not then we skip the test.
+ if category is None:
+ category = lens.get_category_by_name("Online")
+ if category is None:
+ self.skipTest("This lens is probably empty")
+
results = category.get_results()
- # wait for a result
- refresh_fn = lambda: len(results)
- self.assertThat(refresh_fn, Eventually(GreaterThan(0)))
result = results[0]
# result.preview handles finding xy co-ords and right mouse-click
result.preview()
- # 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("Escape")
@@ -813,5 +817,17 @@ class PreviewNavigateTests(DashTestCase):
# if we've navigated right, there should be at least one preview available on left.
self.assertThat(self.preview_container.navigate_left_enabled, Eventually(Equals(True)))
+ def test_preview_refocus_close(self):
+ """Clicking on a preview element must not lose keyboard focus."""
+ cover_art = self.preview_container.current_preview.cover_art
+
+ # click the cover-art (this will set focus)
+ tx = cover_art.x + (cover_art.width / 2)
+ ty = cover_art.y + (cover_art.height / 2)
+ self.mouse.move(tx, ty)
+ self.mouse.click()
+
+ self.keyboard.press_and_release("Escape")
+ self.assertThat(self.dash.preview_displaying, Eventually(Equals(False)))