class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.gallery = Gallery(self) self.camera = Camera(self) self.UTILS.app.setPermission('Camera', 'geolocation', 'deny') self.gallery.launch() time.sleep(2) self.previous_thumbs = self.gallery.get_number_of_thumbnails() self.apps.kill_all() time.sleep(2) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.camera.launch() self.camera.take_picture() self.camera.open_preview() self.gallery.launch() current_thumbs = self.gallery.get_number_of_thumbnails() self.UTILS.test.test( current_thumbs == self.previous_thumbs + 1, "After taking a picture, there's one item more in the gallery") self.gallery.click_on_thumbnail_at_position(0)
class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.gallery = Gallery(self) self.camera = Camera(self) self.UTILS.app.setPermission('Camera', 'geolocation', 'deny') self.gallery.launch() time.sleep(2) self.previous_thumbs = self.gallery.get_number_of_thumbnails() self.apps.kill_all() time.sleep(2) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.camera.launch() self.camera.take_picture() self.camera.open_preview() self.gallery.launch() current_thumbs = self.gallery.get_number_of_thumbnails() self.UTILS.test.test(current_thumbs == self.previous_thumbs + 1, "After taking a picture, there's one item more in the gallery") self.gallery.click_on_thumbnail_at_position(0)
class test_main(GaiaTestCase): img_list = ('img1.jpg', 'img2.jpg', 'img3.jpg', 'img4.jpg', 'img5.jpg') def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.gallery = Gallery(self) self.length = len(self.img_list) def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Load sample images into the gallery. for i in self.img_list: self.UTILS.general.add_file_to_device('./tests/_resources/' + i) self.gallery.launch() self.gallery.wait_for_thumbnails_number(self.length) self.gallery.click_on_thumbnail_at_position(0) self.gallery.swipe_between_gallery_items(self.length)