1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-19 05:58:09 +00:00

chore(core/mercury): fix UI test for everstake

[no changelog]
This commit is contained in:
obrusvit 2024-09-03 15:07:51 +02:00 committed by Ioan Bizău
parent ba8f0ea4bc
commit 3de7256103
2 changed files with 47 additions and 5 deletions

View File

@ -459,7 +459,6 @@ def test_signtx_data_pagination(client: Client, flow):
_sign_tx_call()
@pytest.mark.skip_t3t1(reason="Not yet implemented in new UI")
@pytest.mark.skip_t1b1("T1 does not support Everstake")
@parametrize_using_common_fixtures("ethereum/sign_tx_staking.json")
@pytest.mark.parametrize("chunkify", (True, False))

View File

@ -499,7 +499,9 @@ class EthereumFlow:
self,
info: bool = False,
) -> BRGeneratorType:
yield
br = yield
assert br.code == B.SignTx
assert br.name == "confirm_ethereum_staking_tx"
TR.assert_equals_multiple(
self.debug.wait_layout().title(),
[
@ -516,7 +518,7 @@ class EthereumFlow:
"ethereum__staking_claim_intro",
],
)
if self.client.model in (models.T2T1, models.T3T1):
if self.client.model in (models.T2T1, ):
# confirm intro
if info:
self.debug.click(buttons.CORNER_BUTTON, wait=True)
@ -532,7 +534,7 @@ class EthereumFlow:
yield
# confirm summary
if info and self.client.model != models.T3T1:
if info:
self.debug.press_info(wait=True)
TR.assert_in(
self.debug.wait_layout().text_content(), "ethereum__gas_limit"
@ -545,7 +547,46 @@ class EthereumFlow:
yield
self.debug.press_yes()
else:
elif self.client.model in (models.T3T1,):
# confirm intro
if info:
self.debug.click(buttons.CORNER_BUTTON, wait=True)
self.debug.synchronize_at("VerticalMenu")
self.debug.click(buttons.VERTICAL_MENU[0], wait=True)
TR.assert_equals_multiple(
self.debug.wait_layout().title(),
[
"ethereum__staking_stake_address",
"ethereum__staking_claim_address",
],
)
self.debug.click(buttons.CORNER_BUTTON, wait=True)
self.debug.click(buttons.CORNER_BUTTON, wait=True)
self.debug.swipe_up()
br = yield
assert br.code == B.SignTx
assert br.name == "confirm_total"
# confirm summary
if info:
self.debug.click(buttons.CORNER_BUTTON, wait=True)
self.debug.synchronize_at("VerticalMenu")
self.debug.click(buttons.VERTICAL_MENU[0], wait=True)
TR.assert_in(
self.debug.wait_layout().text_content(), "ethereum__gas_limit"
)
TR.assert_in(
self.debug.wait_layout().text_content(), "ethereum__gas_price"
)
self.debug.click(buttons.CORNER_BUTTON, wait=True)
self.debug.click(buttons.CORNER_BUTTON, wait=True)
self.debug.swipe_up()
# br = yield # FIXME: no BR on sign transaction
self.debug.press_yes()
elif self.client.model in (models.T2B1, models.T3B1, ):
# confirm intro
if info:
self.debug.press_right(wait=True)
@ -576,3 +617,5 @@ class EthereumFlow:
yield
self.debug.press_yes()
else:
raise ValueError("Unknown model!")