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): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.camera = Camera(self) self.gallery = Gallery(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_video(5) self.camera.open_preview() self.camera.delete_from_preview() self.gallery.launch() time.sleep(2) current_thumbs = self.gallery.get_number_of_thumbnails() self.UTILS.test.test( current_thumbs == self.previous_thumbs, "After taking a picture and delete it, we remain the same")
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.camera.go_to_gallery() 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") # Check Camera is running in the background. self.UTILS.home.holdHomeButton() x = self.UTILS.element.getElement( (DOM.Home.app_card[0], DOM.Home.app_card[1].format("camera")), "When home button is held, camera 'card'", False)
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.camera.go_to_gallery() 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") # Check Camera is running in the background. self.UTILS.home.holdHomeButton() x = self.UTILS.element.getElement((DOM.Home.app_card[0], DOM.Home.app_card[1].format("camera")), "When home button is held, camera 'card'", False)
class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.camera = Camera(self) self.gallery = Gallery(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_video(5) self.camera.open_preview() self.camera.delete_from_preview() self.gallery.launch() time.sleep(2) current_thumbs = self.gallery.get_number_of_thumbnails() self.UTILS.test.test(current_thumbs == self.previous_thumbs, "After taking a picture and delete it, we remain the same")
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) # 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)))