From 71c055061130d240f9b26cd03176a0ac4c2fcd03 Mon Sep 17 00:00:00 2001 From: Anastasiya <82375995+anastasiyaig@users.noreply.github.com> Date: Fri, 13 Oct 2023 17:49:44 +0300 Subject: [PATCH] chore(@edit_network_test): get rid of 1x1 comparison (#176) --- test/e2e/constants/wallet.py | 8 ++++---- test/e2e/gui/screens/settings.py | 20 +++++++++++++++---- ...t_wallet_settings_networks_edit_network.py | 6 ++++-- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/test/e2e/constants/wallet.py b/test/e2e/constants/wallet.py index 8fc4eec4ad..7aa3c78386 100644 --- a/test/e2e/constants/wallet.py +++ b/test/e2e/constants/wallet.py @@ -33,10 +33,10 @@ class WalletNetworkNaming(Enum): class WalletNetworkDefaultValues(Enum): - ETHEREUM_LIVE_MAIN = 'https://eth-archival.gateway.pokt.network/v1/lb/************************' - ETHEREUM_TEST_MAIN = 'https://goerli-archival.gateway.pokt.network/v1/lb/************************' - ETHEREUM_LIVE_FAILOVER = 'https://mainnet.infura.io/v3/********************************' - ETHEREUM_TEST_FAILOVER = 'https://goerli.infura.io/v3/********************************' + ETHEREUM_LIVE_MAIN = 'https://eth-archival.gateway.pokt.network' + ETHEREUM_TEST_MAIN = 'https://goerli-archival.gateway.pokt.network' + ETHEREUM_LIVE_FAILOVER = 'https://mainnet.infura.io' + ETHEREUM_TEST_FAILOVER = 'https://goerli.infura.io' class WalletEditNetworkErrorMessages(Enum): diff --git a/test/e2e/gui/screens/settings.py b/test/e2e/gui/screens/settings.py index 81ef910863..3f8dab83bc 100644 --- a/test/e2e/gui/screens/settings.py +++ b/test/e2e/gui/screens/settings.py @@ -611,20 +611,32 @@ class EditNetworkSettings(WalletSettingsView): match network_tab: case WalletNetworkSettings.EDIT_NETWORK_LIVE_TAB.value: self._live_network_tab.click() - assert self.get_edit_network_main_json_rpc_url_value() == WalletNetworkDefaultValues.ETHEREUM_LIVE_MAIN.value + current_value = self.get_edit_network_main_json_rpc_url_value() + return True if current_value.startswith( + WalletNetworkDefaultValues.ETHEREUM_LIVE_MAIN.value) and current_value.endswith("****") \ + else False case WalletNetworkSettings.EDIT_NETWORK_TEST_TAB.value: self._test_network_tab.click() - assert self.get_edit_network_main_json_rpc_url_value() == WalletNetworkDefaultValues.ETHEREUM_TEST_MAIN.value + current_value = self.get_edit_network_main_json_rpc_url_value() + return True if current_value.startswith( + WalletNetworkDefaultValues.ETHEREUM_TEST_MAIN.value) and current_value.endswith("****") \ + else False @allure.step('Verify value in Failover JSON RPC input') def verify_edit_network_failover_json_rpc_url_value(self, network_tab): match network_tab: case WalletNetworkSettings.EDIT_NETWORK_LIVE_TAB.value: self._live_network_tab.click() - assert self.get_edit_network_failover_json_rpc_url_value() == WalletNetworkDefaultValues.ETHEREUM_LIVE_FAILOVER.value + current_value = self.get_edit_network_failover_json_rpc_url_value() + return True if current_value.startswith( + WalletNetworkDefaultValues.ETHEREUM_LIVE_FAILOVER.value) and current_value.endswith("****") \ + else False case WalletNetworkSettings.EDIT_NETWORK_TEST_TAB.value: self._test_network_tab.click() - assert self.get_edit_network_failover_json_rpc_url_value() == WalletNetworkDefaultValues.ETHEREUM_TEST_FAILOVER.value + current_value = self.get_edit_network_failover_json_rpc_url_value() + return True if current_value.startswith( + WalletNetworkDefaultValues.ETHEREUM_TEST_FAILOVER.value) and current_value.endswith("****") \ + else False class EditAccountOrderSettings(WalletSettingsView): diff --git a/test/e2e/tests/settings/settings_wallet/test_wallet_settings_networks_edit_network.py b/test/e2e/tests/settings/settings_wallet/test_wallet_settings_networks_edit_network.py index 413c4a3c26..7473288b75 100644 --- a/test/e2e/tests/settings/settings_wallet/test_wallet_settings_networks_edit_network.py +++ b/test/e2e/tests/settings/settings_wallet/test_wallet_settings_networks_edit_network.py @@ -67,10 +67,12 @@ def test_settings_networks_edit_restore_defaults(main_screen: MainWindow, networ WalletNetworkNaming.ETHEREUM_MAINNET_NETWORK_ID.value) with step('Verify value in Main JSON RPC URL input'): - edit_network_form.verify_edit_network_main_json_rpc_url_value(network_tab) + assert edit_network_form.verify_edit_network_main_json_rpc_url_value(network_tab), \ + f"Reverted value in Main JSON RPC is incorrect" with (step('Verify value in Failover JSON RPC URL input')): - edit_network_form.verify_edit_network_failover_json_rpc_url_value(network_tab) + assert edit_network_form.verify_edit_network_failover_json_rpc_url_value(network_tab), \ + f"Reverted value in Failover JSON RPC is incorrect" with step('Verify the acknowledgment checkbox is unchecked'): assert edit_network_form.check_acknowledgement_checkbox(False, network_tab)