diff --git a/ui-flows/custom/.gitignore b/ui-flows/custom/.gitignore new file mode 100644 index 000000000..72e8ffc0d --- /dev/null +++ b/ui-flows/custom/.gitignore @@ -0,0 +1 @@ +* diff --git a/ui-flows/login_demo_account.yml b/ui-flows/login_demo_account.yml new file mode 100644 index 000000000..07c4a70a2 --- /dev/null +++ b/ui-flows/login_demo_account.yml @@ -0,0 +1,29 @@ +appId: com.fsck.k9.debug +--- +- launchApp: + clearState: true + +# Welcome +- tapOn: + id: "com.fsck.k9.debug:id/next" + +## Setup new account +- tapOn: + id: "com.fsck.k9.debug:id/account_email" +- inputText: "demo@k9mail.example" +- tapOn: + id: "com.fsck.k9.debug:id/next" + +## Account name configuration +- tapOn: + id: "com.fsck.k9.debug:id/account_description" +- inputText: "demo@k9mail" +- tapOn: + id: "com.fsck.k9.debug:id/account_name" +- inputText: "Demo Account" +- tapOn: + id: "com.fsck.k9.debug:id/done" + +## Grant access to contacts +- tapOn: + id: "com.android.permissioncontroller:id/permission_allow_button" diff --git a/ui-flows/shared/add_contact.yml b/ui-flows/shared/add_contact.yml new file mode 100644 index 000000000..270676739 --- /dev/null +++ b/ui-flows/shared/add_contact.yml @@ -0,0 +1,28 @@ +# use env to provide properties: +# env: +# INDEX: 0 +# NAME: Alice +# FIRST_NAME: Alice + +appId: com.fsck.k9.debug +--- + +## Add to contact +- tapOn: + id: "com.fsck.k9.debug:id/name" + text: ${NAME} + +## Add contact +- tapOn: + id: "com.fsck.k9.debug:id/menu_add_contact" + index: ${INDEX} +- tapOn: ${FIRST_NAME} +- inputText: " from Contacts" + +### Save +- tapOn: + id: "com.android.contacts:id/editor_menu_save_button" + +### Exit +- tapOn: + id: "com.android.systemui:id/back" diff --git a/ui-flows/shared/change_display_settings_show_contact_names.yml b/ui-flows/shared/change_display_settings_show_contact_names.yml new file mode 100644 index 000000000..b41f5ea49 --- /dev/null +++ b/ui-flows/shared/change_display_settings_show_contact_names.yml @@ -0,0 +1,21 @@ +appId: com.fsck.k9.debug +--- + +## Open settings +- runFlow: open_display_settings.yml + +### Scroll to "Show contact names" +- scrollUntilVisible: + element: + id: "android:id/title" + text: "Show contact names" + direction: DOWN + timeout: 10000 + +### Enable "Show contact names" +- tapOn: + id: "android:id/title" + text: "Show contact names" + +### Close settings +- runFlow: close_display_settings.yml diff --git a/ui-flows/shared/close_display_settings.yml b/ui-flows/shared/close_display_settings.yml new file mode 100644 index 000000000..fff76a299 --- /dev/null +++ b/ui-flows/shared/close_display_settings.yml @@ -0,0 +1,9 @@ +appId: com.fsck.k9.debug +--- + +- tapOn: "Navigate up" +- tapOn: "Navigate up" +- tapOn: "Navigate up" +- swipe: + direction: LEFT + duration: 200 diff --git a/ui-flows/shared/open_display_settings.yml b/ui-flows/shared/open_display_settings.yml new file mode 100644 index 000000000..ce005068e --- /dev/null +++ b/ui-flows/shared/open_display_settings.yml @@ -0,0 +1,22 @@ +appId: com.fsck.k9.debug +--- + +## Open drawer +- tapOn: "Navigate up" + +### Open settings +- tapOn: + id: "com.fsck.k9.debug:id/material_drawer_name" + index: 9 + +### Open general settings +- tapOn: + id: "com.fsck.k9.debug:id/text" + index: 0 + text: "General settings" + +### Open display settings +- tapOn: + id: "android:id/title" + index: 0 + text: "Display" diff --git a/ui-flows/shared/open_message_details.yml b/ui-flows/shared/open_message_details.yml new file mode 100644 index 000000000..c7eea12e6 --- /dev/null +++ b/ui-flows/shared/open_message_details.yml @@ -0,0 +1,14 @@ +appId: com.fsck.k9.debug +--- + +- tapOn: + id: "com.fsck.k9.debug:id/participants_container" +- swipe: + from: + id: "com.fsck.k9.debug:id/message_details_list" + direction: UP +- swipe: + from: + id: "com.fsck.k9.debug:id/message_details_list" + direction: DOWN + duration: 200 diff --git a/ui-flows/shared/remove_contact.yml b/ui-flows/shared/remove_contact.yml new file mode 100644 index 000000000..3a377a36d --- /dev/null +++ b/ui-flows/shared/remove_contact.yml @@ -0,0 +1,20 @@ +# use env to provide properties: +# env: +# NAME: Alice + +appId: com.fsck.k9.debug +--- + +## Open contact +- tapOn: + id: "com.fsck.k9.debug:id/name" + text: ${NAME} + +## Delete contact +- tapOn: "More options" +- tapOn: + id: "android:id/title" + index: 1 +- tapOn: + id: "android:id/button1" + diff --git a/ui-flows/validate_compose_simple_message.yml b/ui-flows/validate_compose_simple_message.yml new file mode 100644 index 000000000..a424f7b31 --- /dev/null +++ b/ui-flows/validate_compose_simple_message.yml @@ -0,0 +1,60 @@ +appId: com.fsck.k9.debug +--- +- launchApp + +## Start composing +- tapOn: + id: "com.fsck.k9.debug:id/floating_action_button" + +## Compose email + +## To +- tapOn: + id: "com.fsck.k9.debug:id/to" +- inputText: "bob@example.com" + +## Subject +- tapOn: + id: "com.fsck.k9.debug:id/subject" +- inputText: "Compose test" + +## Message +- tapOn: + id: "com.fsck.k9.debug:id/message_content" +- inputText: "Lorem ipsum dolor sit amet." + +## Send +- tapOn: + id: "com.fsck.k9.debug:id/send" + +## Open message +- tapOn: + id: "com.fsck.k9.debug:id/subject" + index: 0 + text: "Compose test" + +## Assert +- assertVisible: + id: "com.fsck.k9.debug:id/subject" + text: "Compose test" +- assertVisible: + id: "com.fsck.k9.debug:id/from" + text: "Demo Account" +- assertVisible: + id: "com.fsck.k9.debug:id/recipient_names" + text: "to bob@example.com" +- assertVisible: "Lorem ipsum dolor sit amet." + +## Delete message +- tapOn: + id: "com.fsck.k9.debug:id/delete" +- assertNotVisible: + id: "com.fsck.k9.debug:id/subject" + text: "Compose test" + +## Return to inbox +- tapOn: "Navigate up" +- assertNotVisible: + id: "com.fsck.k9.debug:id/subject" + index: 0 + text: "Compose test" diff --git a/ui-flows/validate_message_details_show_contact_names.yml b/ui-flows/validate_message_details_show_contact_names.yml new file mode 100644 index 000000000..d6792c9d3 --- /dev/null +++ b/ui-flows/validate_message_details_show_contact_names.yml @@ -0,0 +1,92 @@ +appId: com.fsck.k9.debug +--- +- runFlow: login_demo_account.yml + +## Open message +- tapOn: + id: "com.fsck.k9.debug:id/subject" + index: 0 + text: "Message details demo" + +## Check message +- assertVisible: + id: "com.fsck.k9.debug:id/from" + text: "Alice" +- assertVisible: + id: "com.fsck.k9.debug:id/recipient_names" + text: "to User 1.*" + +### Open message details +- runFlow: shared/open_message_details.yml + +## Check message details +- assertVisible: + id: "com.fsck.k9.debug:id/name" + text: "Alice" +- assertVisible: + id: "com.fsck.k9.debug:id/name" + text: "User 1" + +## Add contacts +- runFlow: + file: shared/add_contact.yml + env: + INDEX: 0 + NAME: Alice + FIRST_NAME: Alice +- runFlow: + file: shared/add_contact.yml + env: + INDEX: 4 + NAME: User 1 + FIRST_NAME: User + +## Close message +- tapOn: + id: "com.android.systemui:id/back" +- tapOn: + id: "com.android.systemui:id/back" + +## Change settings +- runFlow: shared/change_display_settings_show_contact_names.yml + +## Open message +- tapOn: + id: "com.fsck.k9.debug:id/subject" + index: 0 + text: "Message details demo" + +## Check message +- assertVisible: + id: "com.fsck.k9.debug:id/from" + text: "Alice from Contacts" +- assertVisible: + id: "com.fsck.k9.debug:id/recipient_names" + text: "to User from Contacts.*" + +### Open message details +- runFlow: shared/open_message_details.yml + +## Check message details +- assertVisible: + id: "com.fsck.k9.debug:id/name" + text: "Alice from Contacts" +- assertVisible: + id: "com.fsck.k9.debug:id/name" + text: "User from Contacts 1" + +## Remove contacts +- runFlow: + file: shared/remove_contact.yml + env: + NAME: Alice from Contacts + +- runFlow: + file: shared/remove_contact.yml + env: + NAME: User from Contacts 1 + +## Close message +- tapOn: + id: "com.android.systemui:id/back" +- tapOn: "Navigate up"