def test_install_uninstall(self, device: Device, support_app: str): app = Application.from_apk(support_app, device) try: assert app.package_name == "com.linkedin.mdctest" output = device.execute_remote_cmd("shell", "dumpsys", "package", app.package_name, capture_stdout=True, timeout=10) for line in output.splitlines(): if "versionName" in line: assert app.version == line.strip().split('=', 1)[1] finally: app.uninstall() assert app.package_name not in device.list_installed_packages()
def test_install_uninstall(self, device: Device, support_app: str): uninstall_apk(support_app, device) app = Application.from_apk(support_app, device) try: assert app.package_name == "com.linkedin.mtotestapp" completed = device.execute_remote_cmd("shell", "dumpsys", "package", app.package_name, timeout=10, stdout=subprocess.PIPE) for line in completed.stdout.splitlines(): if "versionName" in line: assert app.version == line.strip().split('=', 1)[1] finally: app.uninstall() assert app.package_name not in device.list_installed_packages()