From 954da6731411371918e859521fe73e0db62fc62f Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 3 Apr 2023 18:51:02 +0200 Subject: [PATCH] Add Maestro flow to record screenshots for the user manual (reading) --- ui-flows/screenshots/user_manual_reading.yml | 84 ++++++++++++++++++++ user-manual/build_images.sh | 1 + user-manual/process_screenshots.sh | 30 +++++-- 3 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 ui-flows/screenshots/user_manual_reading.yml diff --git a/ui-flows/screenshots/user_manual_reading.yml b/ui-flows/screenshots/user_manual_reading.yml new file mode 100644 index 000000000..952595107 --- /dev/null +++ b/ui-flows/screenshots/user_manual_reading.yml @@ -0,0 +1,84 @@ +appId: com.fsck.k9.debug +--- +- launchApp: + clearState: true + +- tapOn: + id: "com.fsck.k9.debug:id/next" + +- tapOn: + id: "com.fsck.k9.debug:id/account_email" +- inputText: "fun@k9mail.example" +- tapOn: + id: "com.fsck.k9.debug:id/next" + +- tapOn: + id: "com.fsck.k9.debug:id/account_description" +- inputText: "Personal" +- tapOn: + id: "com.fsck.k9.debug:id/account_name" +- inputText: "Demo User" +- tapOn: + id: "com.fsck.k9.debug:id/done" + +- tapOn: + id: "com.android.permissioncontroller:id/permission_allow_button" + +- tapOn: "Navigate up" +- tapOn: "Settings" +- tapOn: "Add account" + +- tapOn: + id: "com.fsck.k9.debug:id/account_email" +- inputText: "serious@k9mail.example" +- tapOn: + id: "com.fsck.k9.debug:id/next" + +- tapOn: + id: "com.fsck.k9.debug:id/account_description" +- inputText: "Work" +- tapOn: + id: "com.fsck.k9.debug:id/done" + +- tapOn: "Navigate up" +- tapOn: "Turing Awards" +- swipe: + direction: DOWN + + +- tapOn: "More options" +- tapOn: + id: "com.fsck.k9.debug:id/title" + index: 1 +- tapOn: + id: "android:id/button1" +- tapOn: + id: "com.fsck.k9.debug:id/contact_picture" + index: 0 +- tapOn: + id: "com.fsck.k9.debug:id/subject" + index: 1 +- tapOn: "Mark unread" + +- tapOn: + id: "com.fsck.k9.debug:id/subject" + index: 2 + +- waitForAnimationToEnd +- takeScreenshot: "user-manual/screenshots/message_list_multi_select" + +- back + +- waitForAnimationToEnd +- takeScreenshot: "user-manual/screenshots/reading_folder_view" + +- scrollUntilVisible: + element: + id: "com.fsck.k9.debug:id/subject" + text: "The Humble Programmer" + direction: DOWN + timeout: 5000 +- tapOn: "The Humble Programmer" + +- waitForAnimationToEnd +- takeScreenshot: "user-manual/screenshots/reading_email_view" diff --git a/user-manual/build_images.sh b/user-manual/build_images.sh index da2bef737..8c31a14a1 100755 --- a/user-manual/build_images.sh +++ b/user-manual/build_images.sh @@ -20,6 +20,7 @@ pushd "${SCRIPT_PATH}/.." # Record screenshots maestro test ui-flows/screenshots/user_manual_account_setup.yml maestro test ui-flows/screenshots/user_manual_accounts.yml +maestro test ui-flows/screenshots/user_manual_reading.yml # Post-process screenshots user-manual/process_screenshots.sh diff --git a/user-manual/process_screenshots.sh b/user-manual/process_screenshots.sh index 0e059fcbe..52194e74c 100755 --- a/user-manual/process_screenshots.sh +++ b/user-manual/process_screenshots.sh @@ -14,17 +14,31 @@ cp screenshots/account_setup_* output/accounts/img/ cp screenshots/drawer_account_list.png output/accounts/img/ # Adding another account -convert screenshots/drawer_one_account.png -stroke red -strokewidth 5 -fill none -draw "rectangle 20,1750 820,1840 " output/accounts/img/drawer_settings_highlight.png -convert screenshots/settings_one_account.png -stroke red -strokewidth 5 -fill none -draw "rectangle 20,580 1060,690 " output/accounts/img/settings_add_account_highlight.png +convert screenshots/drawer_one_account.png -stroke red -strokewidth 5 -fill none -draw "rectangle 20,1750 820,1840" output/accounts/img/drawer_settings_highlight.png +convert screenshots/settings_one_account.png -stroke red -strokewidth 5 -fill none -draw "rectangle 20,580 1060,690" output/accounts/img/settings_add_account_highlight.png # Switching between multiple accounts -convert screenshots/unified_inbox.png -crop 1080x660+0+0 -stroke red -strokewidth 5 -fill none -draw "rectangle 20,85 130,190 " output/accounts/img/message_list_drawer_button_highlight.png -convert screenshots/drawer_two_accounts.png -crop 1080x650+0+0 -stroke red -strokewidth 5 -fill none -draw "rectangle 720,360 815,455 " output/accounts/img/drawer_account_switcher_highlight.png +convert screenshots/unified_inbox.png -crop 1080x660+0+0 -stroke red -strokewidth 5 -fill none -draw "rectangle 20,85 130,190" output/accounts/img/message_list_drawer_button_highlight.png +convert screenshots/drawer_two_accounts.png -crop 1080x650+0+0 -stroke red -strokewidth 5 -fill none -draw "rectangle 720,360 815,455" output/accounts/img/drawer_account_switcher_highlight.png # Removing an account -convert screenshots/drawer_two_accounts.png -stroke red -strokewidth 5 -fill none -draw "rectangle 20,1750 820,1840 " output/accounts/img/drawer_two_accounts_settings_highlight.png -convert screenshots/settings_two_accounts.png -stroke red -strokewidth 5 -fill none -draw "rectangle 20,580 1060,735 " output/accounts/img/settings_second_account_highlight.png -convert screenshots/account_settings.png -crop 1080x485+0+0 -stroke red -strokewidth 5 -fill none -draw "rectangle 980,85 1060,190 " output/accounts/img/account_settings_menu_highlight.png -convert screenshots/account_settings_menu_expanded.png -crop 1080x485+0+0 -stroke red -strokewidth 5 -fill none -draw "rectangle 570,110 1050,210 " output/accounts/img/account_settings_remove_account_highlight.png +convert screenshots/drawer_two_accounts.png -stroke red -strokewidth 5 -fill none -draw "rectangle 20,1750 820,1840" output/accounts/img/drawer_two_accounts_settings_highlight.png +convert screenshots/settings_two_accounts.png -stroke red -strokewidth 5 -fill none -draw "rectangle 20,580 1060,735" output/accounts/img/settings_second_account_highlight.png +convert screenshots/account_settings.png -crop 1080x485+0+0 -stroke red -strokewidth 5 -fill none -draw "rectangle 980,85 1060,190" output/accounts/img/account_settings_menu_highlight.png +convert screenshots/account_settings_menu_expanded.png -crop 1080x485+0+0 -stroke red -strokewidth 5 -fill none -draw "rectangle 570,110 1050,210" output/accounts/img/account_settings_remove_account_highlight.png + +# Reading mail +mkdir -p output/reading/img/ + +cp screenshots/reading_folder_view.png output/reading/img/ +cp screenshots/reading_email_view.png output/reading/img/ + +# Unified Inbox +convert screenshots/unified_inbox.png -crop 1080x882+0+0 -stroke red -strokewidth 5 -fill none -draw "rectangle 176,238 207,756" output/reading/img/unified_inbox_account_chip_highlight.png +convert screenshots/drawer_account_list.png -crop 1080x890+0+0 -stroke red -strokewidth 5 -fill none -draw "rectangle 25,515 163,864" output/reading/img/drawer_account_list_account_image_highlight.png + +# Managing mail +convert screenshots/message_list_multi_select.png -crop 1080x1110+0+0 output/reading/img/managing_multiselect.png +convert screenshots/message_list_multi_select.png -crop 1080x139+0+64 -stroke red -strokewidth 5 -fill none -draw "rectangle 606,24 1062,116" output/reading/img/reading_actionbar_options.png popd