Ubuntu Pastebin

Paste from sputnick at Wed, 13 May 2015 18:18:39 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import autopilot
from autopilot.testcase import AutopilotTestCase

class MyTests(AutopilotTestCase):
    def launch_application(self):
        # Note, the script needs to be executable for the 'which' command to see it to allow it to launch
        app_script = 'main.py'
        app_path = os.path.abspath(os.path.join(os.getcwd(), app_script))
        return self.launch_test_application(
            app_path,
            # '/usr/lib/i386-linux-gnu/qt4/bin/qmlviewer', 'gui/dummyCanvas.qml',
            app_type='qt',
            )

    def test_launch(self):
        print(autopilot.version)
        app_root = self.launch_application()
        # app_root.print_tree()
        print(app_root.select_single('QDeclarativeView'))
        button = app_root.select_single('Button', objectName='prod_switch_to_user_GUI')
        print(button.text)
        self.mouse.click_object(button)
        button = app_root.select_single('Slider', objectName='prod_buzz_volume')
        print(button.value)
        self.mouse.click_object(button)
        self.assertTrue(True)
Download as text