~3v1n0/unity/alt+tab-scroll-wheel

« back to all changes in this revision

Viewing changes to tests/autopilot/autopilot/tests/test_dash.py

  • Committer: Marco Trevisan (Treviño)
  • Date: 2012-03-06 17:09:00 UTC
  • mfrom: (2021.2.33 unity)
  • Revision ID: mail@3v1n0.net-20120306170900-f6xp3f63bo9rjiys
Merging with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
from autopilot.emulators.unity.dash import Dash
13
13
from autopilot.emulators.X11 import Keyboard, Mouse
14
14
from autopilot.tests import AutopilotTestCase
15
 
from autopilot.glibrunner import GlibRunner
16
15
 
17
16
 
18
17
class DashRevealTests(AutopilotTestCase):
19
18
    """Test the unity Dash Reveal."""
20
 
    run_test_with = GlibRunner
21
19
 
22
20
    def setUp(self):
23
21
        super(DashRevealTests, self).setUp()
77
75
 
78
76
class DashKeyNavTests(AutopilotTestCase):
79
77
    """Test the unity Dash keyboard navigation."""
80
 
    run_test_with = GlibRunner
81
78
 
82
79
    def setUp(self):
83
80
        super(DashKeyNavTests, self).setUp()
269
266
 
270
267
 
271
268
class DashClipboardTests(AutopilotTestCase):
272
 
    """Test the Unity clipboard""" 
273
 
    run_test_with = GlibRunner
 
269
    """Test the Unity clipboard"""
274
270
 
275
271
    def setUp(self):
276
272
        super(DashClipboardTests, self).setUp()
279
275
    def tearDown(self):
280
276
        super(DashClipboardTests, self).tearDown()
281
277
        self.dash.ensure_hidden()
282
 
         
 
278
 
283
279
    def test_ctrl_a(self):
284
280
        """ This test if ctrl+a selects all text """
285
281
        self.dash.ensure_hidden()
291
287
 
292
288
        kb.press_and_release("Ctrl+a")
293
289
        kb.press_and_release("Delete")
294
 
        
 
290
 
295
291
        searchbar = self.dash.get_searchbar()
296
292
        self.assertEqual(searchbar.search_string, u'')
297
293
 
344
340
        kb.press_and_release("Ctrl+c")
345
341
        kb.press_and_release("Ctrl+v")
346
342
        kb.press_and_release("Ctrl+v")
347
 
        
 
343
 
348
344
        searchbar = self.dash.get_searchbar()
349
345
        self.assertEqual(searchbar.search_string, u'CopyPasteCopyPaste')
350
346
 
361
357
        kb.press_and_release("Ctrl+x")
362
358
        kb.press_and_release("Ctrl+v")
363
359
        kb.press_and_release("Ctrl+v")
364
 
        
 
360
 
365
361
        searchbar = self.dash.get_searchbar()
366
362
        self.assertEqual(searchbar.search_string, u'CutPasteCutPaste')
367
363
 
369
365
class DashKeyboardFocusTests(AutopilotTestCase):
370
366
    """Tests that keyboard focus works."""
371
367
 
372
 
    run_test_with = GlibRunner
373
 
 
374
368
    def setUp(self):
375
369
        super(DashKeyboardFocusTests, self).setUp()
376
370
        self.dash = Dash()
395
389
        searchbar = self.dash.get_searchbar()
396
390
        self.assertEqual("hello world", searchbar.search_string)
397
391
 
 
392
class DashCompositionCharactersTests(AutopilotTestCase):
 
393
    """Tests that composition characters works."""
 
394
 
 
395
    def setUp(self):
 
396
        super(DashCompositionCharactersTests, self).setUp()
 
397
        self.dash = Dash()
 
398
        self.addCleanup(self.dash.ensure_hidden)
 
399
 
 
400
    def tearDown(self):
 
401
        super(DashCompositionCharactersTests, self).tearDown()
 
402
        self.dash.ensure_hidden()
 
403
 
 
404
    def test_composition_characters(self):
 
405
        """Expanding or collapsing the filterbar must keave keyboard focus in the
 
406
        search bar.
 
407
        """
 
408
        self.dash.reveal_application_lens()
 
409
        filter_bar = self.dash.get_current_lens().get_filterbar()
 
410
        filter_bar.ensure_collapsed()
 
411
 
 
412
        sleep(1)
 
413
        self.keyboard.press('Shift')
 
414
        self.keyboard.press_and_release('Multi_key')
 
415
        self.keyboard.press_and_release('6')
 
416
        self.keyboard.release('Shift')
 
417
        self.keyboard.type('o')
 
418
 
 
419
        searchbar = self.dash.get_searchbar()
 
420
        self.assertEqual("ô", searchbar.search_string)        
 
421