on xenial help sign in
Remove tutorial autopilot test; it's much harder to test via autopilot now that each page fires separately, and we cover it well in qmluitests; there's nothing autopilot-integraty about it
commit99800d5624193f53768e5d237b13ac656947ead6 authorMichael Terry <michael.terry@canonical.com> dateWed 9 Mar 2016, 18:35 (11 years ago) parentb0a5c30
3 files changed−132
tests/autopilot/unity8/shell/emulators.py−2 tests/autopilot/unity8/shell/tests/test_tutorial.py−57 tests/autopilot/unity8/tutorial.py−73
tests/autopilot/unity8/shell/emulators.py−2
@@ -36,7 +36,6 @@ __all__ = [
3636 'greeter',
3737 'launcher',
3838 'main_window',
39− 'tutorial',
4039 'UnityEmulatorException',
4140]
4241
@@ -46,7 +45,6 @@ from unity8 import (
4645 dash,
4746 launcher,
4847 shell as main_window,
49− tutorial,
5048 UnityException as UnityEmulatorException
5149)
5250from unity8.shell import create_interactive_notification
tests/autopilot/unity8/shell/tests/test_tutorial.pydeleted−57
@@ -1,57 +0,0 @@
1−# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2−#
3−# Unity Autopilot Test Suite
4−# Copyright (C) 2014, 2015 Canonical
5−#
6−# This program is free software: you can redistribute it and/or modify
7−# it under the terms of the GNU General Public License as published by
8−# the Free Software Foundation, either version 3 of the License, or
9−# (at your option) any later version.
10−#
11−# This program is distributed in the hope that it will be useful,
12−# but WITHOUT ANY WARRANTY; without even the implied warranty of
13−# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14−# GNU General Public License for more details.
15−#
16−# You should have received a copy of the GNU General Public License
17−# along with this program. If not, see <http://www.gnu.org/licenses/>.
18−#
19−
20−from autopilot.matchers import Eventually
21−from testtools.matchers import Equals
22−
23−from unity8.shell import (
24− fixture_setup,
25− tests
26−)
27−# unused import to load the tutorial helpers custom proxy objects.
28−from unity8 import tutorial as tutorial_helpers # NOQA
29−
30−
31−class TutorialTestCase(tests.UnityTestCase):
32−
33− def setUp(self):
34− super().setUp()
35− self._qml_mock_enabled = False
36− self._data_dirs_mock_enabled = False
37−
38− self.useFixture(fixture_setup.Tutorial(True))
39− self.unity = self.launch_unity()
40−
41− def test_complete_tutorial(self):
42− greeter = self.main_window.get_greeter()
43− tutorial = self.unity.select_single('Tutorial')
44− self.assertThat(tutorial.running, Eventually(Equals(True)))
45− greeter.swipe()
46− page = self.unity.wait_select_single(objectName='tutorialLeft')
47− page.short_swipe_right()
48− page = self.unity.wait_select_single(objectName='tutorialLeftFinish')
49− page.tap()
50− page = self.unity.wait_select_single(objectName='tutorialRight')
51− page.swipe_left()
52− page.tap()
53− page = self.unity.wait_select_single(objectName='tutorialBottom')
54− page.swipe_up()
55− page = self.unity.wait_select_single(objectName='tutorialBottomFinish')
56− page.tap()
57− self.assertThat(tutorial.running, Eventually(Equals(False)))
tests/autopilot/unity8/tutorial.pydeleted−73
@@ -1,73 +0,0 @@
1−# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2−#
3−# Unity Autopilot Test Suite
4−# Copyright (C) 2014 Canonical
5−#
6−# This program is free software: you can redistribute it and/or modify
7−# it under the terms of the GNU General Public License as published by
8−# the Free Software Foundation, either version 3 of the License, or
9−# (at your option) any later version.
10−#
11−# This program is distributed in the hope that it will be useful,
12−# but WITHOUT ANY WARRANTY; without even the implied warranty of
13−# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14−# GNU General Public License for more details.
15−#
16−# You should have received a copy of the GNU General Public License
17−# along with this program. If not, see <http://www.gnu.org/licenses/>.
18−#
19−
20−import logging
21−
22−import ubuntuuitoolkit
23−
24−import autopilot
25−from autopilot import introspection
26−
27−
28−logger = logging.getLogger(__name__)
29−
30−
31−class TutorialPage(
32− ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
33−
34− @classmethod
35− def validate_dbus_object(cls, path, state):
36− name = introspection.get_classname_from_path(path)
37− return name in (b'TutorialPage', b'TutorialLeft',
38− b'TutorialLeftFinish', b'TutorialRight',
39− b'TutorialBottom', b'TutorialBottomFinish')
40−
41− @autopilot.logging.log_action(logger.info)
42− def short_swipe_right(self):
43− self.shown.wait_for(True)
44− x, y, width, height = self.globalRect
45− start_x = x
46− stop_x = x + width // 3
47− start_y = stop_y = y + height // 2
48− self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
49−
50− @autopilot.logging.log_action(logger.info)
51− def swipe_left(self):
52− self.shown.wait_for(True)
53− x, y, width, height = self.globalRect
54− start_x = width
55− stop_x = x
56− start_y = stop_y = y + height // 2
57− self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
58−
59− @autopilot.logging.log_action(logger.info)
60− def swipe_up(self):
61− self.shown.wait_for(True)
62− x, y, width, height = self.globalRect
63− start_y = height
64− stop_y = y
65− start_x = stop_x = x + width // 2
66− self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
67−
68− @autopilot.logging.log_action(logger.info)
69− def tap(self):
70− """Tap the tick button to complete this step."""
71− self.shown.wait_for(True)
72− button = self.wait_select_single(objectName="tick")
73− self.pointing_device.click_object(button)