Merge lp:~nskaggs/ubuntu-clock-app/fix-ap-setup into lp:ubuntu-clock-app

Proposed by Nicholas Skaggs
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 46
Merged at revision: 46
Proposed branch: lp:~nskaggs/ubuntu-clock-app/fix-ap-setup
Merge into: lp:ubuntu-clock-app
Diff against target: 101 lines (+36/-26)
1 file modified
tests/autopilot/ubuntu_clock_app/tests/__init__.py (+36/-26)
To merge this branch: bzr merge lp:~nskaggs/ubuntu-clock-app/fix-ap-setup
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Nekhelesh Ramananthan Approve
Review via email: mp+230187@code.launchpad.net

Commit message

Tweak AP setup and launching

Description of the change

Tweak AP setup and launching

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

lgtm! Thnx for removing the OSK hide workaround. Looks better now.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/ubuntu_clock_app/tests/__init__.py'
--- tests/autopilot/ubuntu_clock_app/tests/__init__.py 2014-08-02 12:57:23 +0000
+++ tests/autopilot/ubuntu_clock_app/tests/__init__.py 2014-08-08 22:30:40 +0000
@@ -22,8 +22,7 @@
22import logging22import logging
23import fixtures23import fixtures
2424
25from autopilot import input25from autopilot import logging as autopilot_logging
26from autopilot.platform import model
27from ubuntuuitoolkit import (26from ubuntuuitoolkit import (
28 base,27 base,
29 emulators as toolkit_emulators28 emulators as toolkit_emulators
@@ -40,52 +39,63 @@
40 clock-app tests.39 clock-app tests.
4140
42 """41 """
43 local_location = "../../app/ubuntu-clock-app.qml"42
44 local_backend_dir = "../../builddir/backend/"43 local_location = os.path.dirname(os.path.dirname(os.getcwd()))
45 installed_location = "/usr/share/ubuntu-clock-app/app/ubuntu-clock-app.qml"44 local_location_qml = os.path.join(
46 installed_backend_dir = "/usr/share/ubuntu-clock-app/builddir/backend/"45 local_location, 'app/ubuntu-clock-app.qml')
46 local_location_backend = os.path.join(local_location, 'builddir/backend')
47 installed_location_backend = \
48 '/usr/share/ubuntu-clock-app/builddir/backend'
49 installed_location_qml = \
50 '/usr/share/ubuntu-clock-app/app/ubuntu-clock-app.qml'
51
52 # note this directory could change to com.ubuntu.clock at some point
47 sqlite_dir = os.path.expanduser(53 sqlite_dir = os.path.expanduser(
48 "~/.local/share/com.ubuntu.clock")54 "~/.local/share/com.ubuntu.clock.devel")
49 backup_dir = sqlite_dir + ".backup"55 backup_dir = sqlite_dir + ".backup"
5056
51 def setUp(self):57 def setUp(self):
52 super(ClockAppTestCase, self).setUp()
53 self.pointing_device = input.Pointer(self.input_device_class.create())
54
55 self.useFixture(fixtures.EnvironmentVariable('LC_ALL', newvalue='C'))
56
57 # backup and wipe db's before testing58 # backup and wipe db's before testing
58 self.temp_move_sqlite_db()59 self.temp_move_sqlite_db()
59 self.addCleanup(self.restore_sqlite_db)60 self.addCleanup(self.restore_sqlite_db)
6061
61 # turn off the OSK so it doesn't block screen elements62 launch, self.test_type = self.get_launcher_method_and_type()
62 if model() != 'Desktop':63 self.useFixture(fixtures.EnvironmentVariable('LC_ALL', newvalue='C'))
63 os.system("stop maliit-server")64 super(ClockAppTestCase, self).setUp()
64 self.addCleanup(os.system, "start maliit-server")65
6566 launch()
66 if os.path.exists(self.local_location):67
67 self.launch_test_local()68 def get_launcher_method_and_type(self):
68 elif os.path.exists(self.installed_location):69 if os.path.exists(self.local_location_backend):
69 self.launch_test_installed()70 launcher = self.launch_test_local
71 test_type = 'local'
72 elif os.path.exists(self.installed_location_backend):
73 launcher = self.launch_test_installed
74 test_type = 'deb'
70 else:75 else:
71 self.launch_test_click()76 launcher = self.launch_test_click
77 test_type = 'click'
78 return launcher, test_type
7279
80 @autopilot_logging.log_action(logger.info)
73 def launch_test_local(self):81 def launch_test_local(self):
74 self.app = self.launch_test_application(82 self.app = self.launch_test_application(
75 base.get_qmlscene_launch_command(),83 base.get_qmlscene_launch_command(),
76 self.local_location,84 self.local_location_qml,
77 "-I", self.local_backend_dir,85 "-I", self.local_location_backend,
78 app_type='qt',86 app_type='qt',
79 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)87 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
8088
89 @autopilot_logging.log_action(logger.info)
81 def launch_test_installed(self):90 def launch_test_installed(self):
82 self.app = self.launch_test_application(91 self.app = self.launch_test_application(
83 base.get_qmlscene_launch_command(),92 base.get_qmlscene_launch_command(),
84 self.installed_location,93 self.installed_location_qml,
85 "-I", self.installed_backend_dir,94 "-I", self.installed_location_backend,
86 app_type='qt',95 app_type='qt',
87 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)96 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
8897
98 @autopilot_logging.log_action(logger.info)
89 def launch_test_click(self):99 def launch_test_click(self):
90 self.app = self.launch_click_package(100 self.app = self.launch_click_package(
91 "com.ubuntu.clock.devel",101 "com.ubuntu.clock.devel",

Subscribers

People subscribed via source and target branches