diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/autopilot/unity/tests/launcher/test_icon_behavior.py | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/tests/autopilot/unity/tests/launcher/test_icon_behavior.py b/tests/autopilot/unity/tests/launcher/test_icon_behavior.py index e8b5e868f..0627e2337 100644 --- a/tests/autopilot/unity/tests/launcher/test_icon_behavior.py +++ b/tests/autopilot/unity/tests/launcher/test_icon_behavior.py @@ -49,24 +49,30 @@ class LauncherIconsTests(LauncherTestCase): return icon def test_bfb_tooltip_disappear_when_dash_is_opened(self): - """Tests that the bfb tooltip disappear when the dash is opened.""" - bfb = self.launcher.model.get_bfb_icon() - self.mouse.move(bfb.center_x, bfb.center_y) + """Tests that the bfb tooltip disappear when the dash is opened.""" + bfb = self.launcher.model.get_bfb_icon() + self.mouse.move(bfb.center_x, bfb.center_y) - self.dash.ensure_visible() - self.addCleanup(self.dash.ensure_hidden) + self.assertThat(bfb.get_tooltip().active, Eventually(Equals(True))) + self.dash.ensure_visible() + self.addCleanup(self.dash.ensure_hidden) - self.assertThat(bfb.get_tooltip().active, Eventually(Equals(False))) + self.assertThat(bfb.get_tooltip().active, Eventually(Equals(False))) def test_bfb_tooltip_is_disabled_when_dash_is_open(self): - """Tests the that bfb tooltip is disabled when the dash is open.""" - self.dash.ensure_visible() - self.addCleanup(self.dash.ensure_hidden) + """Tests the that bfb tooltip is disabled when the dash is open.""" + self.dash.ensure_visible() + self.addCleanup(self.dash.ensure_hidden) - bfb = self.launcher.model.get_bfb_icon() - self.mouse.move(bfb.center_x, bfb.center_y) + bfb = self.launcher.model.get_bfb_icon() + self.mouse.move(bfb.center_x, bfb.center_y) - self.assertThat(bfb.get_tooltip().active, Eventually(Equals(False))) + # Tooltips are lazy-created in Unity, so if the BFB tooltip has never + # been shown before, get_tooltip will return None. If that happens, then + # this test should pass. + tooltip = bfb.get_tooltip() + if tooltip is not None: + self.assertThat(tooltip.active, Eventually(Equals(False))) def test_shift_click_opens_new_application_instance(self): """Shift+Clicking MUST open a new instance of an already-running application.""" |
