def setUp(self): TnsDeviceTest.setUp(self) # "src" folder of TestApp will be restored before each test. # This will ensure failures in one test do not cause common failures. for change in [Changes.JSHelloWord.CSS, Changes.JSHelloWord.XML, Changes.JSHelloWord.JS]: source_src = os.path.join(self.target_project_dir, 'app', os.path.basename(change.file_path)) target_src = os.path.join(self.source_project_dir, change.file_path) File.clean(path=target_src) File.copy(source=source_src, target=target_src)
def get_screen(device_id, file_path): """ Save screen of iOS real device. :param device_id: Device identifier. :param file_path: Path where image will be saved. """ tiff_image_path = file_path.replace('.png', '.tiff') run(cmd="idevicescreenshot -u {0} {1}".format(device_id, tiff_image_path)) run(cmd="sips -s format png {0} --out {1}".format( tiff_image_path, file_path)) File.clean(tiff_image_path)
def setUp(self): TnsRunTest.setUp(self) # "src" folder of TestApp will be restored before each test. # This will ensure failures in one test do not cause common failures. for change in [Changes.JSTabNavigation.SCSS_VARIABLES]: source_src = os.path.join(self.target_project_dir, 'app', os.path.basename(change.file_path)) target_src = os.path.join(self.source_project_dir, change.file_path) File.clean(path=target_src) File.copy(source=source_src, target=target_src) for change in [ Changes.JSTabNavigation.XML, Changes.JSTabNavigation.JS ]: source_src = os.path.join(self.target_project_dir, 'app', 'home', os.path.basename(change.file_path)) target_src = os.path.join(self.source_project_dir, change.file_path) File.clean(path=target_src) File.copy(source=source_src, target=target_src)