Merge lp:~canonical-platform-qa/ueqa-code-proposals/indicator-sound-high_volume_warning into lp:ueqa-code-proposals

Proposed by Leonardo Arias Fonseca
Status: Work in progress
Proposed branch: lp:~canonical-platform-qa/ueqa-code-proposals/indicator-sound-high_volume_warning
Merge into: lp:ueqa-code-proposals
Prerequisite: lp:~canonical-platform-qa/ueqa-code-proposals/indicator-sound-control_player
Diff against target: 120 lines (+77/-1)
4 files modified
proposals/indicator-sound-pulseaudio.py (+22/-0)
proposals/indicator-sound-ubuntuuitoolkit.py (+20/-0)
proposals/indicator-sound.py (+12/-1)
proposals/indicator-sound.rst (+23/-0)
To merge this branch: bzr merge lp:~canonical-platform-qa/ueqa-code-proposals/indicator-sound-high_volume_warning
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Canonical UE QA Projects Team Pending
Review via email: mp+242809@code.launchpad.net

Commit message

Added a code proposal for an UX test to test the sound indicator behaviour with a headset plugged.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Christopher Lee (veebers) wrote :

Marked as WIP due to it not happening for the current sprint and so it doesn't confuse the +activereviews.

Please feel free to change this if this is incorrect.

Unmerged revisions

20. By Leonardo Arias Fonseca

Added the proposal to test headset.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'proposals/indicator-sound-pulseaudio.py'
2--- proposals/indicator-sound-pulseaudio.py 1970-01-01 00:00:00 +0000
3+++ proposals/indicator-sound-pulseaudio.py 2014-11-25 16:42:57 +0000
4@@ -0,0 +1,22 @@
5+# Module pulseaudio_testhelpers
6+
7+import fixtures
8+
9+
10+class HeadSetPlugged(fixtures.Fixture):
11+
12+ def setUp(self):
13+ self.addCleanup(self._unplug)
14+ self._plug()
15+
16+ def _plug(self):
17+ """Fake a plugged head set using umockdev."""
18+ raise NotImplementedError()
19+
20+ def _unplug(self):
21+ """Remove the head set."""
22+ raise NotImplementedError()
23+
24+ def run_command(self, command):
25+ """Run a command in the environment that has the head set plugged."""
26+ raise NotImplementedError()
27
28=== added file 'proposals/indicator-sound-ubuntuuitoolkit.py'
29--- proposals/indicator-sound-ubuntuuitoolkit.py 1970-01-01 00:00:00 +0000
30+++ proposals/indicator-sound-ubuntuuitoolkit.py 2014-11-25 16:42:57 +0000
31@@ -0,0 +1,20 @@
32+# Module ubuntuuitoolkit
33+
34+class Slider(UbuntuUIToolkitCustomProxyObjectBase):
35+
36+ """Autopilot helper for the Slider."""
37+
38+ # There is some work in progress in https://code.launchpad.net/~elopio/ubuntu-ui-toolkit/slider-autopilot_helper/+merge/222311
39+
40+ def select_value(self, value):
41+ """Select a value from the slider.
42+
43+ :param value: The value to select.
44+ :raises ubuntuuitoolkit.ToolkitException: if the value is below the
45+ minimum or above the minimum, and if the value is not selectable.
46+
47+ """
48+ raise NotImplementedError()
49+ # Strategy to test the helper:
50+ # Make an app with a slider.
51+ # See ubuntuuitoolkit.tests.QMLFileAppTestCase
52
53=== modified file 'proposals/indicator-sound.py'
54--- proposals/indicator-sound.py 2014-11-25 16:42:57 +0000
55+++ proposals/indicator-sound.py 2014-11-25 16:42:57 +0000
56@@ -7,6 +7,17 @@
57
58 """Custom proxy object for the Sound indicator."""
59
60+ def set_volume(self, value):
61+ """Slide the volume bar to set the volume.
62+
63+ :param int value: The value to set.
64+
65+ """
66+ raise NotImplementedError()
67+ # Strategy to test the helper:
68+ # This helper will be used in an indicator test that changes the
69+ # volume.
70+
71 def play(self):
72 """Press the play button."""
73 raise NotImplementedError()
74@@ -15,7 +26,7 @@
75 """Press the pause button."""
76 raise NotImplementedError()
77
78- # Strategy to test the helpers:
79+ # Strategy to test the play and pause helpers:
80 # Make a mock in python that will be a dbus service implementing the MPRIS
81 # interface. It will record every time play and pause are called, so it can
82 # be checked from the test. Do not use dbus-mock.
83
84=== modified file 'proposals/indicator-sound.rst'
85--- proposals/indicator-sound.rst 2014-11-25 16:42:57 +0000
86+++ proposals/indicator-sound.rst 2014-11-25 16:42:57 +0000
87@@ -28,6 +28,21 @@
88
89 * Check that the music player paused playing the song.
90
91+End-to-end test - show the high volume warning
92+----------------------------------------------
93+
94+* Open the indicator.
95+* Set the sound to 0.
96+* Plug in a headset.
97+
98+ * Use umockdev to fake the headset.
99+ * Will require to stop the indicator and start it calling the binary with
100+ umockdev-run.
101+
102+* Set the sound to 100.
103+
104+ * Check that the high volume warning appears.
105+
106 Helper function requirements and API
107 ------------------------------------
108
109@@ -46,3 +61,11 @@
110 * From Music Player App:
111
112 .. literalinclude:: indicator-sound-music-app.py
113+
114+* From Pulseaudio:
115+
116+.. literalinclude:: indicator-sound-pulseaudio.py
117+
118+* From Ubuntu UI Toolkit:
119+
120+.. literalinclude:: indicator-sound-ubuntuuitoolkit.py

Subscribers

People subscribed via source and target branches