~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk

« back to all changes in this revision

Viewing changes to tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py

  • Committer: CI Train Bot
  • Author(s): Christian Dywan, Zsombor Egri, Zoltán Balogh, Tim Peeters, Albert Astals Cid, Michael Sheldon, Benjamin Zeller
  • Date: 2015-12-17 17:13:49 UTC
  • mfrom: (1000.739.27 OTA9-landing-2015-12-16)
  • Revision ID: ci-train-bot@canonical.com-20151217171349-8xwclnhnx8v9oz4m
OTA9-landing-2015-12-16
Approved by: Zoltan Balogh

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    def setUp(self):
28
28
        super().setUp()
29
29
        self.open_page('navigationElement')
30
 
        self.scrollbar = self.main_view.wait_select_single(
31
 
            'Scrollbar', objectName="TemplateScrollbar")
 
30
        self.scrollview = self.main_view.wait_select_single(
 
31
            'ScrollView', objectName="TemplateScrollView")
 
32
        self.scrollbar = self.scrollview.select_single(
 
33
            objectName="verticalScrollbar")
32
34
 
33
35
    def move_mouse_to_thumb(self):
34
36
        # TODO we need a helper to move the interactive thumb.
40
42
        return self.scrollbar.select_single(
41
43
            objectName='interactiveScrollbarThumb')
42
44
 
43
 
    def test_scrollbar_must_start_without_interactive_thumb(self):
44
 
        self.assertEqual(self.scrollbar.interactive, False)
45
 
 
46
 
    def test_move_mouse_to_thumb_must_make_scrollbar_interactive(self):
47
 
        if platform.model() != 'Desktop':
48
 
            self.skipTest(
49
 
                'The interactive thumb is activated by the move of a mouse')
50
 
 
51
 
        self.move_mouse_to_thumb()
52
 
 
53
 
        self.assertEqual(self.scrollbar.interactive, True)
54
 
 
55
45
    def test_drag_thumb_down_must_make_bottom_visible(self):
56
46
        if platform.model() != 'Desktop':
57
47
            self.skipTest(
66
56
        mouse_thumb = self.get_mouse_thumb()
67
57
        x, y, width, height = mouse_thumb.globalRect
68
58
        start_x = stop_x = x + (width // 2)
69
 
        start_y = y + (height // 0.8)
 
59
        start_y = y + (height // 2)
70
60
        stop_y = self.main_view.y + self.main_view.height
71
61
 
72
62
        self.pointing_device.drag(start_x, start_y, stop_x, stop_y)