on xenial help sign in
Moved more common things to the base test case.
commitc453c879d4e4032efe7b6f84036b63571a71fe9c authorLeo Arias <leo.arias@canonical.com> dateMon 7 Apr 2014, 15:15 (13 years ago) parent2b28662
3 files changed+9−14
tests/autopilot/unity8/application_lifecycle/tests/__init__.py+7 tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+2−9 tests/autopilot/unity8/application_lifecycle/tests/test_url_dispatcher.py−5
tests/autopilot/unity8/application_lifecycle/tests/__init__.py+7
@@ -21,11 +21,18 @@ from autopilot.matchers import Eventually
2121from testtools.matchers import Equals
2222from ubuntuuitoolkit import fixture_setup
2323
24+from unity8 import process_helpers
2425from unity8.shell import tests
2526
2627
2728class ApplicationLifeCycleTestCase(tests.UnityTestCase):
2829
30+ def setUp(self):
31+ self._qml_mock_enabled = False
32+ self._data_dirs_mock_enabled = False
33+ unity_proxy = self.launch_unity()
34+ process_helpers.unlock_unity(unity_proxy)
35+
2936 def create_test_application(self):
3037 fake_application = fixture_setup.FakeApplication()
3138 self.useFixture(fake_application)
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+2−9
@@ -31,7 +31,6 @@ from ubuntuuitoolkit import (
3131)
3232
3333from unity8.application_lifecycle import tests
34−from unity8.process_helpers import unlock_unity
3534from unity8.shell import disable_qml_mocking
3635from unity8.shell.tests import _get_device_emulation_scenarios
3736
@@ -44,12 +43,9 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
4443 scenarios = _get_device_emulation_scenarios()
4544
4645 def setUp(self):
46+ if model() == 'Desktop':
47+ self.skipTest('Test cannot be run on the desktop.')
4748 super(ApplicationLifecycleTests, self).setUp()
48− if model() == "Desktop":
49− self.skipTest("Test cannot be run on the desktop.")
50−
51− unity_proxy = self.launch_unity()
52− unlock_unity(unity_proxy)
5349
5450 def swipe_screen_from_right(self):
5551 width = self.main_window.width
@@ -75,13 +71,11 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
7571 app_type='qt')
7672 return application_name
7773
78− @disable_qml_mocking
7974 def test_can_launch_application(self):
8075 """Must be able to launch an application."""
8176 application_name = self.launch_fake_app()
8277 self.assert_current_focused_application(application_name)
8378
84− @disable_qml_mocking
8579 def test_can_launch_multiple_applications(self):
8680 """A second application launched must be focused."""
8781 application1_name = self.launch_fake_app()
@@ -91,7 +85,6 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
9185 self.assertFalse(application1_name == application2_name)
9286 self.assert_current_focused_application(application2_name)
9387
94− @disable_qml_mocking
9588 def test_app_moves_from_unfocused_to_focused(self):
9689 """An application that is in the unfocused state must be able to be
9790 brought back to the focused state.
tests/autopilot/unity8/application_lifecycle/tests/test_url_dispatcher.py−5
@@ -23,7 +23,6 @@ import os
2323
2424from autopilot import platform
2525
26−from unity8 import process_helpers
2726from unity8.application_lifecycle import tests
2827
2928
@@ -35,10 +34,6 @@ class URLDispatcherTestCase(tests.ApplicationLifeCycleTestCase):
3534 if platform.model() == 'Desktop':
3635 self.skipTest("URL dispatcher doesn't work on the desktop.")
3736 super(URLDispatcherTestCase, self).setUp()
38− self._qml_mock_enabled = False
39− self._data_dirs_mock_enabled = False
40− unity_proxy = self.launch_unity()
41− process_helpers.unlock_unity(unity_proxy)
4237
4338 def test_swipe_out_application_started_by_url_dispatcher(self):
4439 _, desktop_file_path = self.create_test_application()