~elopio/u1-test-utils/dash-tests

« back to all changes in this revision

Viewing changes to tests/dash.py

  • Committer: Leo Arias
  • Date: 2013-05-24 03:35:22 UTC
  • Revision ID: leo.arias@canonical.com-20130524033522-qs38109rjx83gqbd
Close the preview only when needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        preview_container.animating, Eventually(Equals(False)))
45
45
 
46
46
 
 
47
def ensure_preview_closed(test):
 
48
    if test.unity.dash.preview_displaying:
 
49
        close_preview(test)
 
50
 
 
51
 
47
52
def close_preview(test):
48
53
    test.assertTrue(test.unity.dash.preview_displaying)
49
54
    test.keyboard.press_and_release('Escape')
75
80
    def get_preview(self, test, good):
76
81
        search_music_scope(test, good.search)        
77
82
        result = self.get_result(test)
78
 
        test.addCleanup(close_preview, test)
 
83
        test.addCleanup(ensure_preview_closed, test)
79
84
        preview_result(test, result)
80
85
        # We have the preview now
81
86
        return Preview(self.user, good)