From 69e406f7cf7cdf467072e55c3d8af468c6d02a75 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Tue, 28 May 2024 00:19:01 +0200 Subject: [PATCH] fix(core/ui): T3T1 device tests [no changelog] --- .github/workflows/core.yml | 2 + core/embed/rust/src/ui/component/base.rs | 4 +- core/embed/rust/src/ui/flow/page.rs | 1 + .../src/ui/model_mercury/component/dialog.rs | 6 +- .../component/keyboard/passphrase.rs | 19 +- .../model_mercury/component/prompt_screen.rs | 4 + .../ui/model_mercury/component/share_words.rs | 1 + .../flow/confirm_reset_create.rs | 9 +- .../flow/confirm_reset_recover.rs | 6 +- .../ui/model_mercury/flow/show_share_words.rs | 8 +- .../rust/src/ui/model_mercury/theme/mod.rs | 24 +- .../apps/management/recovery_device/layout.py | 5 +- .../src/trezor/ui/layouts/mercury/__init__.py | 12 +- .../src/trezor/ui/layouts/mercury/recovery.py | 6 +- core/src/trezor/ui/layouts/mercury/reset.py | 26 +- core/translations/signatures.json | 6 +- tests/buttons.py | 20 +- tests/click_tests/recovery.py | 52 +- tests/click_tests/reset.py | 46 +- tests/click_tests/test_autolock.py | 41 +- .../click_tests/test_backup_slip39_custom.py | 3 - tests/click_tests/test_passphrase_mercury.py | 327 + tests/click_tests/test_passphrase_tt.py | 2 +- .../click_tests/test_reset_slip39_advanced.py | 18 +- tests/click_tests/test_reset_slip39_basic.py | 10 +- tests/common.py | 17 +- tests/device_tests/cardano/test_sign_tx.py | 7 +- .../test_recovery_slip39_advanced.py | 1 + tests/device_tests/test_msg_applysettings.py | 7 + tests/input_flows.py | 102 +- tests/input_flows_helpers.py | 34 +- .../test_shamir_persistence.py | 13 +- tests/ui_tests/fixtures.json | 15829 ++++++++-------- 33 files changed, 8547 insertions(+), 8121 deletions(-) create mode 100644 tests/click_tests/test_passphrase_mercury.py diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 2fe3a03fd5..6872bd9a35 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -266,6 +266,7 @@ jobs: needs: - param - core_emu + timeout-minutes: 90 strategy: fail-fast: false matrix: @@ -350,6 +351,7 @@ jobs: needs: - param - core_emu + timeout-minutes: 30 strategy: fail-fast: false matrix: diff --git a/core/embed/rust/src/ui/component/base.rs b/core/embed/rust/src/ui/component/base.rs index 375df7fb90..36f5963c17 100644 --- a/core/embed/rust/src/ui/component/base.rs +++ b/core/embed/rust/src/ui/component/base.rs @@ -569,8 +569,8 @@ impl EventCtx { } pub fn set_page_count(&mut self, count: usize) { - #[cfg(feature = "ui_debug")] - assert!(self.page_count.is_none()); + // #[cfg(feature = "ui_debug")] + // assert!(self.page_count.unwrap_or(count) == count); self.page_count = Some(count); } diff --git a/core/embed/rust/src/ui/flow/page.rs b/core/embed/rust/src/ui/flow/page.rs index 896820b24a..29a766c8bf 100644 --- a/core/embed/rust/src/ui/flow/page.rs +++ b/core/embed/rust/src/ui/flow/page.rs @@ -90,6 +90,7 @@ impl Component for SwipePage { } fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option { + ctx.set_page_count(self.pages); if let Some(t) = &mut self.transition { let finished = Self::handle_transition(ctx, event, t); if finished { diff --git a/core/embed/rust/src/ui/model_mercury/component/dialog.rs b/core/embed/rust/src/ui/model_mercury/component/dialog.rs index e5bcd9f883..e65bef3828 100644 --- a/core/embed/rust/src/ui/model_mercury/component/dialog.rs +++ b/core/embed/rust/src/ui/model_mercury/component/dialog.rs @@ -136,7 +136,7 @@ where } pub fn with_description(self, description: impl Into>) -> Self { - self.with_text(&theme::TEXT_NORMAL_OFF_WHITE, description) + self.with_text(&theme::TEXT_NORMAL_GREY_EXTRA_LIGHT, description) } pub fn with_value(self, value: impl Into>) -> Self { @@ -154,9 +154,9 @@ where theme::BG, )), paragraphs: ParagraphVecShort::from_iter([ - Paragraph::new(&theme::TEXT_NORMAL_OFF_WHITE, l0).centered(), + Paragraph::new(&theme::TEXT_NORMAL_GREY_EXTRA_LIGHT, l0).centered(), Paragraph::new(&theme::TEXT_DEMIBOLD, l1).centered(), - Paragraph::new(&theme::TEXT_NORMAL_OFF_WHITE, l2).centered(), + Paragraph::new(&theme::TEXT_NORMAL_GREY_EXTRA_LIGHT, l2).centered(), Paragraph::new(&theme::TEXT_DEMIBOLD, l3).centered(), ]) .into_paragraphs() diff --git a/core/embed/rust/src/ui/model_mercury/component/keyboard/passphrase.rs b/core/embed/rust/src/ui/model_mercury/component/keyboard/passphrase.rs index 4f3ffbbaa0..addaa682b9 100644 --- a/core/embed/rust/src/ui/model_mercury/component/keyboard/passphrase.rs +++ b/core/embed/rust/src/ui/model_mercury/component/keyboard/passphrase.rs @@ -76,7 +76,7 @@ pub struct PassphraseKeyboard { input_prompt: Child>, erase_btn: Child>, cancel_btn: Child>, - confirm_btn: Child>, + confirm_btn: Child