← Back to team overview

ubuntu-phone team mailing list archive

Re: Help needed with autopilot tests for ubuntu-system-settings

 

Hello!

Not really sure why but it seems move_to_object() and click() are not
working well together. I replaced them with click_object() and it worked
for me. I also suggest you to make sure when you click in the search box it
really gets the focus before trying to do anything i.e. assert if
search.activeFocus becomes true.

=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_search.py'
--- tests/autopilot/ubuntu_system_settings/tests/test_search.py	2013-12-05
17:16:45 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/test_search.py	2013-12-19
12:18:26 +0000
@@ -30,8 +30,7 @@
         search = self.main_view.select_single(objectName='searchTextField')
         self.assertThat(search, NotEquals(None))
         # Move to text field
-        self.pointer.move_to_object(search)
-        self.pointer.click()
+        self.pointer.click_object(search)
         # Filter by string
         self.keyboard.type(_('Sound'))
         # Search component


Thanks!



On Thu, Dec 19, 2013 at 3:31 PM, Iain Lane <laney@xxxxxxxxxx> wrote:

> Hi,
>
> There's something up with the autopilot tests for
> ubuntu-system-settings.
>
> There's a set of fairly basic tests which check for the presence of
> various objects on the main screen. Those work. But any tests which
> involve clicking on any component—for example to go into a screen or to
> type in the search box—don't work.
>
> All of the tests pass on desktop.
>
> The output is below. Install ubuntu-system-settings-autpilot on the
> device and run that command.
>
> Anyone got any clues?
>
> phablet@ubuntu-phablet:~$ autopilot run
> ubuntu_system_settings.tests.test_search.SearchTestCases.test_search
> Loading tests from: /usr/lib/python2.7/dist-packages
>
> Tests running...
> ======================================================================
> FAIL: ubuntu_system_settings.tests.test_search.SearchTestCases.test_search
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> _StringException: Empty attachments:
>   process-stdout
>
> process-return-code: {{{-15}}}
> [ … ]
>
> Traceback (most recent call last):
>   File
> "/usr/lib/python2.7/dist-packages/ubuntu_system_settings/tests/test_search.py",
> line 44, in test_search
>     self.assertThat(background, Equals(None))
>   File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 412,
> in assertThat
>     raise MismatchError(matchee, matcher, mismatch, verbose)
> MismatchError: None != <autopilot.introspection.dbus.EntryComponent object
> at 0x1767b30>
>
>
> Ran 1 test in 6.019s
> FAILED (failures=1)
>
> --
> Iain Lane                                  [ iain@xxxxxxxxxxxxxxxxxxx ]
> Debian Developer                                   [ laney@xxxxxxxxxx ]
> Ubuntu Developer                                   [ laney@xxxxxxxxxx ]
>
> --
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help   : https://help.launchpad.net/ListHelp
>
>

References