IntroductionWorkshop

Warning /!\ Ubuntu Touch is no longer maintained as a core product by Canonical. However, the Ubports community are continuing development.

Introduction

<balloons> Welcome to anyone joining us for the automated testing workshop
<balloons> so what I'd like to do is answer any questions folks have about writing autopilot tests, and go about helping you get started
<balloons> we can do that via IRC, or if people are willing, over a g+ hangout
<balloons> I know not everyone wants to be on camera, so we'll stick with IRC for the moment. First I'll give a little introduction on what autopilot is, and what we're doing.
<balloons> Autopilot itself is a functional testing tool allowing us to interact with an application the same way a user would
<balloons> it can click, swipe, touch, and type in an application by simulating a user
<balloons> this allows us to test at a functional level to ensure the apps in question work well
<balloons> So, we want to bring this tool to the core apps project. The core apps are written by community developers and represent the core applications for the ubuntu touch platform.
<balloons> We're talking about things like calculator, calendar, file manager, terminal, etc. Some games too, Smile :-)
<balloons> So, in order to help contribute tests there are a couple things you'll need
<balloons> the first is an installation of ubuntu saucy. It can be in a VM or installed on physical hardware
<balloons> the second is an understanding of how autopilot works, and that's what I'm here to help with :-0
<balloons> For anyone who hasn't yet gone through the tutorial on developer.ubuntu.com, http://developer.ubuntu.com/resources/cookbook/mobile/how-to-write-autopilot-tests/, please do so now
<balloons> inside is an example application you can branch and run, then run the autopilot tests for
<balloons> For those who have gone through the tutorial, let's talk about what to do next
<balloons> If you visit this wiki page on the core apps, you'll find a handy listing of the needed testcases for each of the applications
<balloons> https://wiki.ubuntu.com/Touch/CoreApps/Testing
<balloons> In addition, there's a lovely guide to help you out. https://wiki.ubuntu.com/Touch/CoreApps/Testing/ContributeAutopilotTestcase
<balloons> I won't repeat everything here, but in a nutshell here's how to get started
<balloons> first pick an application.. Choose something you like that interests you. If your concerned, I can recommend something that might be easier to start with. An application with pre-existing tests for instance is easier for you to get started since you won't have to create the folder structure and there's already some work done for you to build upon
<balloons> apps like clock, calendar, rss reader, weather, file manager all meet this criteria today
<balloons> second, get the source code and look at and run any existing tests
<balloons> you can do this via bzr; the tutorial has links for each core app, as does the wiki. See the header and click on it for the app your interested in
<balloons> for example, for weather, https://wiki.ubuntu.com/Touch/CoreApps/Weather
<balloons> it has nice links to the project page, the team, blueprint, etc
<balloons> Finally, pick a test to add. You can use the links on this page https://wiki.ubuntu.com/Touch/CoreApps/Testing to pick something. An open bug is something that is needed.
<balloons> for example, the list of needed tests for the rss reader; https://bugs.launchpad.net/ubuntu-rssreader-app/+bugs?field.tag=needs-autopilot-test
<balloons> Now the last step.. how in the world do I write a test? Well, I suggest writing your test in english first. Go through the steps yourself in the application and note what happens as you click and interact with things
<balloons> the list of actions becomes your action steps for your testcase.
<balloons> meanwhile, anything that happens in response to your interactions becomes something you can "assert" about
<balloons> Let's look at the tutorial quickly for an example;
<balloons> http://developer.ubuntu.com/resources/tutorials/quality/how-to-write-autopilot-tests/
<balloons> Inside the test_clear_button function we do a simple action
<balloons> click the clear button. To ensure the action was successful, we as a user would want to see the fields are cleared
<balloons> this is how it looks in autopilot:
<balloons> #click the clear button
<balloons> self.pointing_device.click_object(clearButton)
<balloons>
<balloons> #confirm fields have been wiped
<balloons> self.assertThat(fromField.text, Eventually(Equals('0.0')))
<balloons> self.assertThat(toField.text, Eventually(Equals('0.0')))
<balloons> so you can see us using autopilot to click the clear button, and then have our assertions that the fields have been cleared
<balloons> That's the basics of any good test.. interact and then assert
<balloons> So, with that I'd like to get to answering any questions you may have or help you get your environment setup, pick an app or test to write, etc

Touch/CoreApps/Testing/IntroductionWorkshop (last edited 2013-07-03 20:21:05 by adsl-98-70-135-150)