~chris.gagnon/ubuntu-ui-toolkit/autopilot-test-progress-activity-properties

« back to all changes in this revision

Viewing changes to tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py

  • Committer: chris.gagnon
  • Date: 2013-10-17 15:46:43 UTC
  • Revision ID: chris.gagnon@canonical.com-20131017154643-z5r8sjhy575a5mrf
use scenario for progressbar and activity indicator page test

Show diffs side-by-side

added added

removed removed

Lines of Context:
234
234
 
235
235
            # self.assertThat(obj.text,Equals("Hello World!"))
236
236
 
237
 
    def test_progress_and_activity(self):
238
 
        item = "Progress and activity"
239
 
        self.loadItem(item)
240
 
        self.checkPageHeader(item)
241
 
 
242
 
        item_data = [
243
 
            ["progressbar_standard"],
244
 
            ["progressbar_indeterminate"],
245
 
            ["activityindicator_standard"]
246
 
        ]
247
 
 
248
 
        for data in item_data:
249
 
            objName = data[0]
250
 
            test_item = self.getObject(objName)
251
 
            self.tap(objName)
252
 
 
253
 
            if 'progressbar' in objName:
254
 
                if 'indeterminate' in objName:
255
 
                    self.assertTrue(test_item.indeterminate)
256
 
                else:
257
 
                    self.assertFalse(test_item.indeterminate)
258
 
            if 'activityindicator' in objName:
259
 
                self.assertTrue(test_item.running)
260
 
 
261
237
    def test_ubuntushape(self):
262
238
        item = "Ubuntu Shape"
263
239
        self.loadItem(item)
279
255
            self.getObject(objName)
280
256
 
281
257
 
 
258
class ProgressActivityTestCase(GalleryTestCase):
 
259
 
 
260
    scenarios = [
 
261
        ('progressbar standard', dict(
 
262
            object_name="progressbar_standard")),
 
263
        ('progressbar indeterminate', dict(
 
264
            object_name="progressbar_indeterminate")),
 
265
        ('activityindicator standard', dict(
 
266
            object_name="activityindicator_standard")),
 
267
    ]
 
268
 
 
269
    def test_progress_and_activity(self):
 
270
        item = "Progress and activity"
 
271
        self.loadItem(item)
 
272
        self.checkPageHeader(item)
 
273
 
 
274
        test_item = self.getObject(self.object_name)
 
275
        self.tap(self.object_name)
 
276
 
 
277
        if 'progressbar' in self.object_name:
 
278
            if 'indeterminate' in self.object_name:
 
279
                self.assertTrue(test_item.indeterminate)
 
280
            else:
 
281
                self.assertFalse(test_item.indeterminate)
 
282
        if 'activityindicator' in self.object_name:
 
283
            self.assertTrue(test_item.running)
 
284
 
 
285
 
282
286
class ButtonsTestCase(GalleryTestCase):
283
287
 
284
288
    scenarios = [