chore(@edit_network_test): get rid of 1x1 comparison (#176)

This commit is contained in:
Anastasiya 2023-10-13 17:49:44 +03:00 committed by GitHub
parent 0f3742631e
commit 71c0550611
3 changed files with 24 additions and 10 deletions

View File

@ -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):

View File

@ -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):

View File

@ -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)