Skip to content

Commit

Permalink
test(cardano): allow tests with details on mercury
Browse files Browse the repository at this point in the history
  • Loading branch information
obrusvit committed Oct 29, 2024
1 parent aa77a94 commit e349099
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/device_tests/cardano/test_sign_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.exceptions import TrezorFailure

from ...common import parametrize_using_common_fixtures
from ...common import buttons, parametrize_using_common_fixtures
from ...input_flows import InputFlowConfirmAllWarnings

pytestmark = [
Expand All @@ -34,12 +34,16 @@
def show_details_input_flow(client: Client):
yield
client.debug.wait_layout()
# Touch screen click vs pressing right for T2B1
if client.layout_type in (LayoutType.TT, LayoutType.Mercury):
if client.layout_type is LayoutType.TT:
SHOW_ALL_BUTTON_POSITION = (143, 167)
client.debug.click(SHOW_ALL_BUTTON_POSITION)
elif client.layout_type is LayoutType.TR:
# model R - right button for "Show all"
client.debug.press_yes()
elif client.layout_type is LayoutType.Mercury:
# mercury - "Show all" button from context menu
client.debug.click(buttons.CORNER_BUTTON)
client.debug.click(buttons.VERTICAL_MENU[0])
else:
raise NotImplementedError
# reset ui flow to continue "automatically"
Expand All @@ -63,7 +67,6 @@ def test_cardano_sign_tx(client: Client, parameters, result):
assert response == _transform_expected_result(result)


@pytest.mark.models(skip="mercury", reason="Not yet implemented in new UI")
@parametrize_using_common_fixtures("cardano/sign_tx.show_details.json")
def test_cardano_sign_tx_show_details(client: Client, parameters, result):
response = call_sign_tx(client, parameters, show_details_input_flow, chunkify=True)
Expand Down

0 comments on commit e349099

Please sign in to comment.