Merge lp:~canonical-platform-qa/ubuntu-system-settings/cchange_ringtone_tests into lp:ubuntu-system-settings

Proposed by Omer Akram
Status: Work in progress
Proposed branch: lp:~canonical-platform-qa/ubuntu-system-settings/cchange_ringtone_tests
Merge into: lp:ubuntu-system-settings
Diff against target: 373 lines (+215/-23)
8 files modified
plugins/sound/PageComponent.qml (+1/-0)
plugins/sound/SoundsList.qml (+4/-0)
src/main.cpp (+2/-1)
tests/autopilot/ubuntu_system_settings/__init__.py (+84/-10)
tests/autopilot/ubuntu_system_settings/fixture_setup.py (+38/-0)
tests/autopilot/ubuntu_system_settings/helpers.py (+39/-0)
tests/autopilot/ubuntu_system_settings/tests/__init__.py (+8/-8)
tests/autopilot/ubuntu_system_settings/tests/test_sound.py (+39/-4)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-system-settings/cchange_ringtone_tests
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Sebastien Bacher Pending
Leo Arias Pending
Review via email: mp+228884@code.launchpad.net

This proposal supersedes a proposal from 2014-07-25.

Commit message

Add tests to make sure ringtone change saves in the backend.

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote : Posted in a previous version of this proposal

Just please rename this:

+ def ringtone_setting_button_current_value(self):

to:

get_current_value

Nice work, thanks!

review: Approve (code review)
Revision history for this message
Christopher Lee (veebers) wrote : Posted in a previous version of this proposal

Hi Omer, I'm just being very nosey. Is the sleep on diff line 130 required? Esp. if you're doing a wait_for just after that.

Looks nice and clean :-)

Revision history for this message
Omer Akram (om26er) wrote : Posted in a previous version of this proposal

> Hi Omer, I'm just being very nosey. Is the sleep on diff line 130 required?
> Esp. if you're doing a wait_for just after that.
>
> Looks nice and clean :-)

Thanks for the comment.

That sleep is required. When you open the ringtone settings page, initially the page is not moving but if the current selected ringtone is at the bottom of the list and not visible on screen, it automatically scrolls down. So we try to workaround that.

Ideally it would always show the selected ringtone at the center whenever the list is opened but currently its not doing that.

Revision history for this message
Omer Akram (om26er) wrote : Posted in a previous version of this proposal

> Just please rename this:
>
> + def ringtone_setting_button_current_value(self):
>
> to:
>
> get_current_value
>
> Nice work, thanks!

Done!

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:713
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/835/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/431
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/386
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/27
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/27
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/27/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/27
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/892
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/856
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/856/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7573
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/338
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/512
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/512/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/835/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:714
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/836/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/436
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/391
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/28
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/28
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/28/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/28
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/897
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/861
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/861/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7580
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/343
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/520
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/520/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/836/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:715
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/837/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/442
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/397
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/29
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/29
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/29/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/29
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/900
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/872
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/872/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7598
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/349
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/527
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/527/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/837/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:715
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/838/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/454
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/408
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/30
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/30
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/30/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/30
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/910
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/896
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/896/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7720
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/360
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/546
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/546/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/838/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote : Posted in a previous version of this proposal

Thank you for your work, the approach seems fine, CI is unhappy it seems though, could you have a look to that?

review: Needs Fixing
Revision history for this message
Omer Akram (om26er) wrote : Posted in a previous version of this proposal

Not ready, just changed status for CI.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:716
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/855/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/664
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/606
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/47
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/47
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/47/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/47
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1095
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1268
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1268/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8076
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/538
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/745
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/745/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/855/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:718
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/860/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/686
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/628
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/52
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/52
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/52/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/52
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1117
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1303
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1303/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8112
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/559
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/767
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/767/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/860/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:719
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/861/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/690
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/636
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/53
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/53
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/53/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/53
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1122
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1312
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1312/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8124
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/566
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/775
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/775/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/861/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:720
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/863/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/711
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/659
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/55
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/55
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/55/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/55
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1138
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1344
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1344/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8155
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/586
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/798
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/798/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/863/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:722
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/865/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/717
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/663
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/57
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/57
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/57/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/57
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1141
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1354
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1354/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8164
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/590
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/802
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/802/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/865/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:725
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/887/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1104
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/986
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/79
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/79
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/79/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/79
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1466
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1925
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1925/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8723
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/842
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1129
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1129/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/887/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:726
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/907/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1363
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1192
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/99
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/99
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/99/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/99
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1671
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2291
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2291/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9044
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/983
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1335
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1335/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/907/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote : Posted in a previous version of this proposal

Should that be marked "work in progress"? The CI seems still unhappy there...

Note that https://code.launchpad.net/~elopio/ubuntu-system-settings/refactor_about_tests/+merge/226468 is about the land and that your changes are going to need to be rebased, since there is a conflict when applying those on top of trunk

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:727
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/996/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2016
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1689
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/188
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/188
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/188/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/188
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2253
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3141
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3141/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9871
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1416
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1898
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1898/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/996/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote : Posted in a previous version of this proposal

I've been able to make it work fixing some things.

First, one second is not enough. And then, it's safest if you also wait for the dragging property.

Instead of:
186 + sleep(1)
187 + list_view.moving.wait_for(False)

sleep(3)
list_view.dragging.wait_for(False)
list_view.moving.wait_for(False)

Then, you will need this branch to land on the toolkit:
https://code.launchpad.net/~canonical-platform-qa/ubuntu-ui-toolkit/fix1342521-find_element_on_top/+merge/226961

Please review it.

Now, it's really important to notice that the need for a sleep is a typical case of a UX bug. For some seconds, the page does nothing. Enough time for the user to start an action. And when the user is just about to click an element on the list or swipe it, the list is swiped by itself making the user click the wrong thing, or just wondering what caused the magic swipe.

Revision history for this message
Leo Arias (elopio) wrote : Posted in a previous version of this proposal

I reported that bug here: https://bugs.launchpad.net/ubuntu-ux/+bug/1342533
Please add a comment on the sleep with a reference to that bug.

review: Needs Fixing
Revision history for this message
Omer Akram (om26er) wrote : Posted in a previous version of this proposal

Hi Leo,

I incorporated your suggestions into my code. Also your branch improves the situation and my code does not fail now.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:837
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~canonical-platform-qa/ubuntu-system-settings/change_ringtone_test/+merge/228228/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1058/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2473
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2001
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/250
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/250
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/250/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/250
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2630
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3716
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3716/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10389
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1673
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2253
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2253/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/1058/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:838
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~canonical-platform-qa/ubuntu-system-settings/change_ringtone_test/+merge/228228/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1060/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2476/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2004
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/252
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/252
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/252/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/252
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2633/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3719
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3719/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10392
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1676
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2256
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2256/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/1060/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote : Posted in a previous version of this proposal

Omer, you still haven't reviewed the branch that you need. Without a QA revision it's going to be harder to get it merged soon.
This branch is blocked by mine, so setting back as work in progress.

Revision history for this message
Omer Akram (om26er) wrote : Posted in a previous version of this proposal

I had reviewed, just didn't change the status. Did that now

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:839
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1073/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2560
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2049
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/265
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/265
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/265/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/265
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2704
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3803
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3803/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10501
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1717
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2302
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2302/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/1073/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:843
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1079/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2688
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2150
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/271
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/271
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/271/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/271
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2804
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3931
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3931/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10654
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1789
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2408
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2408/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/1079/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote : Posted in a previous version of this proposal

the CI seems unhappy, can you have a look at that?

review: Needs Fixing
Revision history for this message
Omer Akram (om26er) wrote : Posted in a previous version of this proposal

Sorry for that, tests were passing on my phone so I thought its ready. Will make sure this time its fixed fully before changing to 'Needs fixing'.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:844
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~canonical-platform-qa/ubuntu-system-settings/cchange_ringtone_tests/+merge/228884/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1105/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2784
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2224
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/297
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/297
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/297/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/297
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2874
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4027
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4027/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10738
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1844
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2483
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2483/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/1105/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Omer Akram (om26er) wrote :

This is crazy, my test fails while trying to get SystemBus, it works on my phone, not really sure what's difference is there in the phone in the lab. Help ?

testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ubuntu_system_settings/tests/test_sound.py", line 47, in setUp
    self.useFixture(fixture_setup.RingtoneBackup())
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 628, in useFixture
    fixture.setUp()
  File "/usr/lib/python3/dist-packages/ubuntu_system_settings/fixture_setup.py", line 28, in setUp
    self._backup_ringtone()
  File "/usr/lib/python3/dist-packages/ubuntu_system_settings/fixture_setup.py", line 31, in _backup_ringtone
    self.ringtone_backup = helpers.get_current_ringtone_from_backend()
  File "/usr/lib/python3/dist-packages/ubuntu_system_settings/helpers.py", line 35, in get_current_ringtone_from_backend
    accounts_iface = get_accounts_service_iface()
  File "/usr/lib/python3/dist-packages/ubuntu_system_settings/helpers.py", line 25, in get_accounts_service_iface
    bus = dbus.SystemBus()
  File "/usr/lib/python3/dist-packages/dbus/_dbus.py", line 194, in __new__
    private=private)
  File "/usr/lib/python3/dist-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket /tmp/dbus-k5zfELDGub: Connection refused

Revision history for this message
Leo Arias (elopio) wrote :

I asked you about precisely this related to my previous system settings branches and you told me that they were intermittent issues on Jenkins. That they disappeared so you didn't dig into them.
I kept running my branches until I got a successful run.

Revision history for this message
Omer Akram (om26er) wrote :

You see, there is a difference, the problem we discussed was happening in otto setup and I had different errors in mind at that time. But now the issue is with mako which I never saw before and was not happening when we discussed a few weeks ago.

Revision history for this message
Leo Arias (elopio) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

setting to "work in progress" to get out of the review queue until the CI issues are sorted out

Unmerged revisions

844. By Omer Akram

add test to make sure ringtone settings are saved in the backend

843. By Launchpad Translations on behalf of system-settings-touch

Launchpad automatic translations update.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/sound/PageComponent.qml'
2--- plugins/sound/PageComponent.qml 2014-07-25 14:19:30 +0000
3+++ plugins/sound/PageComponent.qml 2014-07-30 15:30:26 +0000
4@@ -112,6 +112,7 @@
5 }
6
7 ListItem.SingleValue {
8+ objectName: 'ringtoneListItem'
9 text: i18n.tr("Ringtone")
10 value: Utilities.buildDisplayName(
11 backendInfo.incomingCallSound)
12
13=== modified file 'plugins/sound/SoundsList.qml'
14--- plugins/sound/SoundsList.qml 2014-07-16 16:20:23 +0000
15+++ plugins/sound/SoundsList.qml 2014-07-30 15:30:26 +0000
16@@ -84,6 +84,10 @@
17 Utilities.indexSelectedFile(soundFileNames,
18 backendInfo.incomingMessageSound)
19 }
20+ delegate: OptionSelectorDelegate {
21+ objectName: "ringtone-" + modelData
22+ text: modelData
23+ }
24 onDelegateClicked: {
25 if (soundType == 0) {
26 soundSettings.incomingCallSound = soundFileNames[index]
27
28=== modified file 'src/main.cpp'
29--- src/main.cpp 2014-02-18 11:53:03 +0000
30+++ src/main.cpp 2014-07-30 15:30:26 +0000
31@@ -41,7 +41,8 @@
32 * add some unneeded overhead => Let's load the testability driver on our
33 * own.
34 */
35- if (app.arguments().contains(QStringLiteral("-testability"))) {
36+ if (app.arguments().contains(QStringLiteral("-testability")) ||
37+ qgetenv("QT_LOAD_TESTABILITY") == "1") {
38 QLibrary testLib(QStringLiteral("qttestability"));
39 if (testLib.load()) {
40 typedef void (*TasInitialize)(void);
41
42=== modified file 'tests/autopilot/ubuntu_system_settings/__init__.py'
43--- tests/autopilot/ubuntu_system_settings/__init__.py 2014-07-22 18:29:46 +0000
44+++ tests/autopilot/ubuntu_system_settings/__init__.py 2014-07-30 15:30:26 +0000
45@@ -35,49 +35,70 @@
46 """Helper class for System Settings application"""
47
48 APP_PATH = '/usr/bin/system-settings'
49+ APP_UPSTART_ID = 'ubuntu-system-settings'
50 DESKTOP_FILE = '/usr/share/applications/ubuntu-system-settings.desktop'
51
52- def __init__(self, testobj, panel=None):
53+ def __init__(self, testobj, panel=None, upstart_launch=False):
54 """Constructor. Launches system settings application
55
56 :param testobj: An AutopilotTestCase object, needed to call
57 testobj.launch_test_application()
58
59 :param panel: Launch to a specific panel. Default None.
60+ :param upstart_launch: whether to launch settings with upstart.
61 """
62 self.testobj = testobj
63 self.panel = panel
64+ self.upstart_launch = upstart_launch
65 # Launches application
66 self.app = self.launch(
67 self.testobj,
68 self.APP_PATH,
69 self.DESKTOP_FILE,
70- panel=self.panel)
71+ panel=self.panel,
72+ upstart_launch=self.upstart_launch)
73
74- def launch(self, testobj, app_path, desktop_file, panel=None):
75+ def launch(
76+ self,
77+ testobj,
78+ app_path,
79+ desktop_file,
80+ panel=None,
81+ upstart_launch=False):
82 """Launch system settings application
83
84 :param testobj: An AutopilotTestCase object, needed to call
85 testobj.launch_test_application()
86
87 :param panel: Launch to a specific panel. Default None.
88+ :param upstart_launch: whether to launch settings with upstart.
89
90 :returns: A proxy object that represents the application. Introspection
91 data is retrievable via this object.
92 """
93- params = [app_path]
94- if platform.model() != 'Desktop':
95+ if upstart_launch:
96+ params = [self.APP_UPSTART_ID]
97+ elif platform.model() is 'Desktop':
98+ params = [app_path]
99+ else:
100+ params = [app_path]
101 params.append('--desktop_file_hint={}'.format(desktop_file))
102
103 # Launch to a specific panel
104 if panel is not None:
105 params.append(panel)
106
107- app = testobj.launch_test_application(
108- *params,
109- app_type='qt',
110- emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase,
111- capture_output=True)
112+ toolkit_base = ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase
113+ if upstart_launch:
114+ app = testobj.launch_upstart_application(
115+ *params,
116+ emulator_base=toolkit_base)
117+ else:
118+ app = testobj.launch_test_application(
119+ *params,
120+ app_type='qt',
121+ emulator_base=toolkit_base,
122+ capture_output=True)
123
124 return app
125
126@@ -183,6 +204,59 @@
127 return True
128 return False
129
130+ def _get_ringtone_setting_button(self):
131+ return self.wait_select_single(
132+ 'SingleValue', objectName='ringtoneListItem')
133+
134+ def get_ringtone_setting_button_current_value(self):
135+ """current value of the ringtone setting button.
136+
137+ :return: name of the currently selected ringtone.
138+
139+ """
140+ return self._get_ringtone_setting_button().value
141+
142+ @autopilot.logging.log_action(logger.info)
143+ def open_ringtone_selector(self):
144+ """Open the ringtone selector.
145+
146+ :return: The page with ringtones list.
147+
148+ """
149+ ringtone_setting_button = self._get_ringtone_setting_button()
150+ self.pointing_device.click_object(ringtone_setting_button)
151+
152+ root = self.get_root_instance()
153+ return root.wait_select_single(SoundsList)
154+
155+
156+class SoundsList(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
157+
158+ def choose_ringtone(self, name):
159+ """Choose a new ringtone.
160+
161+ :param name: name of the ringtone to select.
162+ :return: newly selected ringtone item.
163+
164+ """
165+ list_view = self.select_single('QQuickListView', objectName='listView')
166+ # When last item of a long list is preselected the list scrolls
167+ # down automatically, wait for the list to scroll down before
168+ # trying to do anything. -- om26er.
169+ sleep(3)
170+ list_view.dragging.wait_for(False)
171+ list_view.moving.wait_for(False)
172+ list_view.click_element('ringtone-' + name)
173+
174+ return self.select_single(
175+ 'OptionSelectorDelegate', objectName='ringtone-' + name)
176+
177+ @autopilot.logging.log_action(logger.info)
178+ def go_back_to_sound_page(self):
179+ """Go back to the sound settings main page."""
180+ main_window = self.get_root_instance().select_single(MainWindow)
181+ main_window.go_back()
182+
183
184 class AboutPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
185
186
187=== added file 'tests/autopilot/ubuntu_system_settings/fixture_setup.py'
188--- tests/autopilot/ubuntu_system_settings/fixture_setup.py 1970-01-01 00:00:00 +0000
189+++ tests/autopilot/ubuntu_system_settings/fixture_setup.py 2014-07-30 15:30:26 +0000
190@@ -0,0 +1,38 @@
191+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
192+#
193+# Copyright (C) 2014 Canonical Ltd.
194+#
195+# This program is free software; you can redistribute it and/or modify
196+# it under the terms of the GNU Lesser General Public License as published by
197+# the Free Software Foundation; version 3.
198+#
199+# This program is distributed in the hope that it will be useful,
200+# but WITHOUT ANY WARRANTY; without even the implied warranty of
201+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
202+# GNU Lesser General Public License for more details.
203+#
204+# You should have received a copy of the GNU Lesser General Public License
205+# along with this program. If not, see <http://www.gnu.org/licenses/>.
206+
207+import fixtures
208+
209+from ubuntu_system_settings import helpers
210+
211+
212+class RingtoneBackup(fixtures.Fixture):
213+ """Fixture to backup and restore ringtone."""
214+
215+ def setUp(self):
216+ super(RingtoneBackup, self).setUp()
217+ self.addCleanup(self._restore_ringtone)
218+ self._backup_ringtone()
219+
220+ def _backup_ringtone(self):
221+ self.ringtone_backup = helpers.get_current_ringtone_from_backend()
222+
223+ def _restore_ringtone(self):
224+ iface = helpers.get_accounts_service_iface()
225+ iface.Set(
226+ 'com.ubuntu.touch.AccountsService.Sound',
227+ 'IncomingCallSound',
228+ self.ringtone_backup)
229
230=== added file 'tests/autopilot/ubuntu_system_settings/helpers.py'
231--- tests/autopilot/ubuntu_system_settings/helpers.py 1970-01-01 00:00:00 +0000
232+++ tests/autopilot/ubuntu_system_settings/helpers.py 2014-07-30 15:30:26 +0000
233@@ -0,0 +1,39 @@
234+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
235+#
236+# Copyright (C) 2014 Canonical Ltd.
237+#
238+# This program is free software; you can redistribute it and/or modify
239+# it under the terms of the GNU Lesser General Public License as published by
240+# the Free Software Foundation; version 3.
241+#
242+# This program is distributed in the hope that it will be useful,
243+# but WITHOUT ANY WARRANTY; without even the implied warranty of
244+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
245+# GNU Lesser General Public License for more details.
246+#
247+# You should have received a copy of the GNU Lesser General Public License
248+# along with this program. If not, see <http://www.gnu.org/licenses/>.
249+
250+import os
251+
252+import dbus
253+
254+
255+def get_accounts_service_iface():
256+ """Return the accountsservice dbus interface."""
257+ uid = os.geteuid()
258+ bus = dbus.SystemBus()
259+ proxy = bus.get_object(
260+ 'org.freedesktop.Accounts',
261+ '/org/freedesktop/Accounts/User{}'.format(uid))
262+
263+ return dbus.Interface(proxy, 'org.freedesktop.DBus.Properties')
264+
265+
266+def get_current_ringtone_from_backend():
267+ """Return the URI of the current ringtone."""
268+ accounts_iface = get_accounts_service_iface()
269+
270+ return accounts_iface.Get(
271+ 'com.ubuntu.touch.AccountsService.Sound',
272+ 'IncomingCallSound')
273
274=== modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py'
275--- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-07-25 18:12:58 +0000
276+++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2014-07-30 15:30:26 +0000
277@@ -39,9 +39,10 @@
278
279 """Base class for Ubuntu System Settings."""
280
281- def setUp(self, panel=None):
282+ def setUp(self, panel=None, upstart_launch=False):
283 super(UbuntuSystemSettingsTestCase, self).setUp()
284- self.system_settings = SystemSettings(self, panel=panel)
285+ self.system_settings = SystemSettings(
286+ self, panel=panel, upstart_launch=upstart_launch)
287 self.assertThat(
288 self.system_settings.main_view.visible,
289 Eventually(Equals(True)))
290@@ -467,9 +468,8 @@
291 class SoundBaseTestCase(UbuntuSystemSettingsTestCase):
292 """ Base class for sound settings tests"""
293
294- def setUp(self):
295-
296- """ Go to Sound page """
297- super(SoundBaseTestCase, self).setUp('sound')
298- self.assertThat(self.system_settings.main_view.sound_page.active,
299- Eventually(Equals(True)))
300+ def setUp(self, panel='sound', upstart_launch=False):
301+ """Go to Sound page."""
302+ super(SoundBaseTestCase, self).setUp(panel, upstart_launch)
303+ self.sound_page = self.system_settings.main_view.select_single(
304+ objectName='soundPage')
305
306=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_sound.py'
307--- tests/autopilot/ubuntu_system_settings/tests/test_sound.py 2014-07-11 14:17:51 +0000
308+++ tests/autopilot/ubuntu_system_settings/tests/test_sound.py 2014-07-30 15:30:26 +0000
309@@ -5,8 +5,13 @@
310 # under the terms of the GNU General Public License version 3, as published
311 # by the Free Software Foundation.
312
313+from autopilot import platform
314+from autopilot.matchers import Eventually
315+from testtools import skipIf
316 from testtools.matchers import Equals, NotEquals
317
318+from ubuntu_system_settings import fixture_setup
319+from ubuntu_system_settings import helpers
320 from ubuntu_system_settings.tests import SoundBaseTestCase
321 from ubuntu_system_settings.utils.i18n import ugettext as _
322
323@@ -18,12 +23,10 @@
324 """ Checks whether Sound page is available """
325 self.assertThat(
326 self.system_settings.main_view.sound_page,
327- NotEquals(None)
328- )
329+ NotEquals(None))
330 self.assertThat(
331 self.system_settings.main_view.sound_page.title,
332- Equals(_('Sound'))
333- )
334+ Equals(_('Sound')))
335
336 def test_keyboard_sound_switch(self):
337 """ Check that keyboard sound is present and clickable"""
338@@ -33,3 +36,35 @@
339 self.system_settings.main_view.pointing_device.click_object(kbd_snd)
340 self.assertThat(
341 kbd_snd.get_properties()["checked"], NotEquals(current_value))
342+
343+
344+@skipIf(platform.model() is 'Desktop', 'Phones only')
345+class RingtoneSettingTestCase(SoundBaseTestCase):
346+
347+ ringtone = 'Supreme'
348+
349+ def setUp(self):
350+ self.useFixture(fixture_setup.RingtoneBackup())
351+ super(RingtoneSettingTestCase, self).setUp(upstart_launch=True)
352+
353+ def test_ringtone_setting_change_in_ui(self):
354+ """Ensure ringtone change is shown in UI."""
355+ sounds_list = self.sound_page.open_ringtone_selector()
356+ sounds_list.choose_ringtone(self.ringtone)
357+
358+ sounds_list.go_back_to_sound_page()
359+
360+ self.assertThat(
361+ self.sound_page.get_ringtone_setting_button_current_value(),
362+ Eventually(Equals(self.ringtone)))
363+
364+ def test_ringtone_setting_change_in_backend(self):
365+ """Ensure ringtone change saves in backend."""
366+ sounds_list = self.sound_page.open_ringtone_selector()
367+ current_ringtone = sounds_list.choose_ringtone(self.ringtone)
368+
369+ self.assertThat(
370+ current_ringtone.selected, Eventually(Equals(True)))
371+ self.assertThat(
372+ lambda: helpers.get_current_ringtone_from_backend().endswith(
373+ self.ringtone + '.ogg'), Eventually(Equals(True)))

Subscribers

People subscribed via source and target branches