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)