From 84c31fcee0395b754a14c72b799c89d82f837659 Mon Sep 17 00:00:00 2001 From: Serhy Date: Fri, 15 May 2020 18:59:40 +0300 Subject: [PATCH] Fix e2e by rerun in a case of TLS failure in emulator Signed-off-by: Serhy --- test/appium/support/api/network_api.py | 2 +- test/appium/support/test_rerun.py | 3 ++- test/appium/views/web_views/base_web_view.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/appium/support/api/network_api.py b/test/appium/support/api/network_api.py index cea5e37314..3a5b307bd3 100644 --- a/test/appium/support/api/network_api.py +++ b/test/appium/support/api/network_api.py @@ -23,7 +23,6 @@ class NetworkApi(object): self.api_key = environ.get('ETHERSCAN_API_KEY') def log(self, text: str): - tests.test_suite_data.current_test.testruns[-1].steps.append(text) logging.info(text) @@ -51,6 +50,7 @@ class NetworkApi(object): try: return int(requests.request('GET', method, headers=self.headers).json()["result"]) except ValueError: + time.sleep(5) pass def get_latest_block_number(self) -> int: diff --git a/test/appium/support/test_rerun.py b/test/appium/support/test_rerun.py index 3d4ed17608..cf3bd76780 100644 --- a/test/appium/support/test_rerun.py +++ b/test/appium/support/test_rerun.py @@ -21,7 +21,8 @@ RERUN_ERRORS = [ "[Errno 110] Connection timed out", "replacement transaction underpriced", "StaleElementReferenceException", - "No System TLS" + "'GetStartedButton' is not found on the screen", + "'AccessKeyButton' is not found on the screen" ] diff --git a/test/appium/views/web_views/base_web_view.py b/test/appium/views/web_views/base_web_view.py index 7982af9a21..90542cb329 100644 --- a/test/appium/views/web_views/base_web_view.py +++ b/test/appium/views/web_views/base_web_view.py @@ -61,7 +61,7 @@ class WebViewMenuButton(BaseButton): self.locator = self.Locator.accessibility_id('chat-menu-button') -class URLEditBoxLockIcon(BaseEditBox): +class URLEditBoxLockIcon(BaseButton): def __init__(self, driver): super(URLEditBoxLockIcon, self).__init__(driver)