class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.gallery = Gallery(self) 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.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.UTILS.general.add_file_to_device('./tests/_resources/img1.jpg') self.gallery.launch() self.gallery.wait_for_thumbnails_number(1) self.gallery.delete_thumbnails([0]) 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")
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) # 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() time.sleep(2) self.previous_thumbs = self.gallery.get_number_of_thumbnails() self.apps.kill_all() time.sleep(2) def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.gallery.launch() self.gallery.wait_for_thumbnails_number(self.length) positions_to_delete = (0, 1, 2) self.gallery.delete_thumbnails(positions_to_delete) current_thumbs = self.gallery.get_number_of_thumbnails() self.UTILS.reporting.logResult( 'info', 'current_thumbs: {}'.format(current_thumbs)) self.UTILS.reporting.logResult( 'info', 'previous_thumbs: {}'.format(self.previous_thumbs)) self.UTILS.test.test( current_thumbs == self.previous_thumbs - len(positions_to_delete), "After deleting {} picture/s we have the rest".format( len(positions_to_delete)))
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) # 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() time.sleep(2) self.previous_thumbs = self.gallery.get_number_of_thumbnails() self.apps.kill_all() time.sleep(2) def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.gallery.launch() self.gallery.wait_for_thumbnails_number(self.length) positions_to_delete = (0, 1, 2) self.gallery.delete_thumbnails(positions_to_delete) current_thumbs = self.gallery.get_number_of_thumbnails() self.UTILS.reporting.logResult('info', 'current_thumbs: {}'.format(current_thumbs)) self.UTILS.reporting.logResult('info', 'previous_thumbs: {}'.format(self.previous_thumbs)) self.UTILS.test.test(current_thumbs == self.previous_thumbs - len(positions_to_delete), "After deleting {} picture/s we have the rest".format(len(positions_to_delete)))