def get_pixels_by_color(self, color): image_path = os.path.join( Settings.TEST_OUT_IMAGES, self.name, 'screen_{0}.png'.format(int(time.time() * 1000))) self.get_screen(image_path, log_level=logging.DEBUG) result = ImageUtils.get_pixels_by_color(image_path, color) File.delete(path=image_path) return result
def test_02_get_pixels_by_color(self): blue_pixels = ImageUtils.get_pixels_by_color(image_path=self.app_image, color=self.blue) assert blue_pixels == 18604, 'Blue pixels count is wrong. Actual: {0} Expected: {1}'.format( blue_pixels, 18604)