From 362aa476ae8a47e264727bb21bcfb4414363691b Mon Sep 17 00:00:00 2001 From: Yevheniia Berdnyk Date: Fri, 7 Jul 2023 12:08:13 +0300 Subject: [PATCH] e2e: fix for nightly apk upload (#16517) --- test/appium/tests/conftest.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/appium/tests/conftest.py b/test/appium/tests/conftest.py index f860de130e..521a391fc8 100644 --- a/test/appium/tests/conftest.py +++ b/test/appium/tests/conftest.py @@ -226,7 +226,7 @@ def pytest_configure(config): resp = sauce.storage._session.request('post', '/v1/storage/upload', files={'payload': f}) try: - if resp['item']['name'] != apk_name: + if resp['item']['name'] != test_suite_data.apk_name: raise UploadApkException( "Incorrect apk was uploaded to Sauce storage, response:\n%s" % resp) except KeyError: @@ -234,9 +234,8 @@ def pytest_configure(config): "Error when uploading apk to Sauce storage, response:\n%s" % resp) if 'http' in config.getoption('apk'): - apk_name = config.getoption('apk').split("/")[-1] # it works with just a file_name, but I've added full path because not sure how it'll behave on the remote run (Jenkins) - file_path, to_remove = os.path.join(os.path.dirname(__file__), apk_name), True + file_path, to_remove = os.path.join(os.path.dirname(__file__), test_suite_data.apk_name), True urllib.request.urlretrieve(config.getoption('apk'), filename=file_path) # if url is not valid it raises an error else: