Repo created
This commit is contained in:
parent
75dc487a7a
commit
39c29d175b
6317 changed files with 388324 additions and 2 deletions
43
ui-flows/README.md
Normal file
43
ui-flows/README.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# UI flows
|
||||
|
||||
Ui flows are using [Maestro](https://maestro.dev/), that allows to write UI E2E tests for Android.
|
||||
|
||||
The flows are located in the `ui-flows` folder with this structure:
|
||||
|
||||
- `custom` - flows that should not be committed to git
|
||||
- `shared` - flows usable by other flows
|
||||
- `validate` - flows that assert behavior of the app
|
||||
|
||||
## Requirements
|
||||
|
||||
- Android Pixel 2 emulator 5.0" screen with 1080x1920 resolution and 420dpi
|
||||
- API 31
|
||||
- English as system language
|
||||
|
||||
## Install
|
||||
|
||||
To be able to run the flows, you need to [install the CLI tools](https://docs.maestro.dev/getting-started/installing-maestro)
|
||||
|
||||
## Run
|
||||
|
||||
Ensure a device or emulator is running and execute:
|
||||
|
||||
- `maestro test ui-flows/validate/ini_withh_demo_account.yml`
|
||||
- `maestro test ui-flows/validate/compose_simple_message.yml`
|
||||
|
||||
The following commands are limited to the exact emulator configuration mentioned above:
|
||||
|
||||
- `maestro test ui-flows/validate/emulator_message_details_show_contact_names.yml`
|
||||
|
||||
## Write
|
||||
|
||||
Have a look at the [documentation](https://docs.maestro.dev/) on how to write flows.
|
||||
|
||||
### Best Practices
|
||||
|
||||
- Use ID-based selectors over text selectors, as text can be brittle as soon it changes
|
||||
- For Compose views, use the `Modifier.testTagAsResourceId` to expose interactable elements
|
||||
- Add comments to explain the purpose of each section of the test
|
||||
- Use shared flows for common operations to avoid duplication
|
||||
- Add appropriate wait commands (like `waitForAnimationToEnd`) when needed to ensure UI stability
|
||||
- Use environment variables with shared flows to make them more reusable
|
||||
28
ui-flows/shared/add_contact.yml
Normal file
28
ui-flows/shared/add_contact.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# use env to provide properties:
|
||||
# env:
|
||||
# INDEX: 0
|
||||
# NAME: Alice
|
||||
# FIRST_NAME: Alice
|
||||
|
||||
appId: net.thunderbird.android.debug
|
||||
---
|
||||
|
||||
## Add contact
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/menu_add_contact"
|
||||
index: ${INDEX}
|
||||
- tapOn: ${FIRST_NAME}
|
||||
|
||||
- runFlow:
|
||||
when:
|
||||
visible:
|
||||
id: "com.android.contacts:id/editor_menu_save_button"
|
||||
commands:
|
||||
- inputText: " from Contacts"
|
||||
### Save
|
||||
- tapOn:
|
||||
id: "com.android.contacts:id/editor_menu_save_button"
|
||||
|
||||
### Exit
|
||||
- tapOn:
|
||||
id: "com.android.systemui:id/back"
|
||||
18
ui-flows/shared/add_demo2_account.yml
Normal file
18
ui-flows/shared/add_demo2_account.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
appId: net.thunderbird.android.debug
|
||||
---
|
||||
|
||||
# Open drawer
|
||||
- tapOn: "Navigate up"
|
||||
|
||||
## Open settings
|
||||
- tapOn:
|
||||
id: "com.fsck.k9.debug:id/material_drawer_name"
|
||||
index: 9
|
||||
|
||||
## Add new account
|
||||
- runFlow:
|
||||
file: create_demo_account.yml
|
||||
env:
|
||||
EMAIL_ADDRESS: "demo2@example.com"
|
||||
ACCOUNT_NAME: "Demo2 Account"
|
||||
DISPLAY_NAME: "Demo2 User"
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
appId: net.thunderbird.android.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
|
||||
9
ui-flows/shared/close_display_settings.yml
Normal file
9
ui-flows/shared/close_display_settings.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
appId: net.thunderbird.android.debug
|
||||
---
|
||||
|
||||
- tapOn: "Navigate up"
|
||||
- tapOn: "Navigate up"
|
||||
- tapOn: "Navigate up"
|
||||
- swipe:
|
||||
direction: LEFT
|
||||
duration: 200
|
||||
53
ui-flows/shared/create_demo_account.yml
Normal file
53
ui-flows/shared/create_demo_account.yml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# use env to provide properties:
|
||||
# env:
|
||||
# EMAIL_ADDRESS: "demo@example.com"
|
||||
# ACCOUNT_NAME: "Demo Account"
|
||||
# DISPLAY_NAME: "Demo User"
|
||||
|
||||
appId: net.thunderbird.android.debug
|
||||
---
|
||||
## Auto-discovery screen
|
||||
- waitForAnimationToEnd:
|
||||
timeout: 500
|
||||
- tapOn:
|
||||
id: "account_setup_email_address_input"
|
||||
- waitForAnimationToEnd:
|
||||
timeout: 500
|
||||
- inputText: ${EMAIL_ADDRESS}
|
||||
- tapOn:
|
||||
id: "account_setup_next_button"
|
||||
|
||||
## Wait for auto-discovery to complete and enter password
|
||||
- waitForAnimationToEnd:
|
||||
timeout: 500
|
||||
- tapOn:
|
||||
id: "account_setup_password_input"
|
||||
- waitForAnimationToEnd:
|
||||
timeout: 500
|
||||
- inputText: "password"
|
||||
- tapOn:
|
||||
id: "account_setup_next_button"
|
||||
|
||||
## Wait for server validation
|
||||
- waitForAnimationToEnd:
|
||||
timeout: 3000
|
||||
|
||||
## Display options
|
||||
- tapOn:
|
||||
id: "account_setup_display_options_account_name_input"
|
||||
- eraseText
|
||||
- inputText: ${ACCOUNT_NAME}
|
||||
- tapOn:
|
||||
id: "account_setup_display_options_display_name_input"
|
||||
- inputText: ${DISPLAY_NAME}
|
||||
- tapOn:
|
||||
id: "account_setup_next_button"
|
||||
|
||||
## Sync options
|
||||
- waitForAnimationToEnd:
|
||||
timeout: 500
|
||||
- tapOn:
|
||||
id: "account_setup_next_button"
|
||||
|
||||
- waitForAnimationToEnd:
|
||||
timeout: 500
|
||||
42
ui-flows/shared/onboard_with_demo_account.yml
Normal file
42
ui-flows/shared/onboard_with_demo_account.yml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
appId: net.thunderbird.android.debug
|
||||
---
|
||||
- launchApp:
|
||||
clearState: true
|
||||
|
||||
## Welcome screen
|
||||
- tapOn:
|
||||
id: "onboarding_welcome_start_button"
|
||||
|
||||
## Already using Thunderbird screen
|
||||
- waitForAnimationToEnd:
|
||||
timeout: 500
|
||||
- tapOn:
|
||||
id: "onboarding_migration_new_account_button"
|
||||
|
||||
- runFlow:
|
||||
file: create_demo_account.yml
|
||||
env:
|
||||
EMAIL_ADDRESS: "demo@example.com"
|
||||
ACCOUNT_NAME: "Demo Account"
|
||||
DISPLAY_NAME: "Demo User"
|
||||
|
||||
# Permissions
|
||||
- waitForAnimationToEnd:
|
||||
timeout: 500
|
||||
- runFlow:
|
||||
when:
|
||||
visible:
|
||||
id: "onboarding_permissions_skip_button"
|
||||
commands:
|
||||
- tapOn:
|
||||
id: "onboarding_permissions_skip_button"
|
||||
- runFlow:
|
||||
when:
|
||||
visible:
|
||||
id: "onboarding_permissions_next_button"
|
||||
commands:
|
||||
- tapOn:
|
||||
id: "onboarding_permissions_next_button"
|
||||
|
||||
- waitForAnimationToEnd:
|
||||
timeout: 500
|
||||
22
ui-flows/shared/open_display_settings.yml
Normal file
22
ui-flows/shared/open_display_settings.yml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
appId: net.thunderbird.android.debug
|
||||
---
|
||||
|
||||
## Open drawer
|
||||
- tapOn: "Navigate up"
|
||||
|
||||
### Open settings
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/material_drawer_name"
|
||||
index: 9
|
||||
|
||||
### Open general settings
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/text"
|
||||
index: 0
|
||||
text: "General settings"
|
||||
|
||||
### Open display settings
|
||||
- tapOn:
|
||||
id: "android:id/title"
|
||||
index: 0
|
||||
text: "Display"
|
||||
14
ui-flows/shared/open_message_details.yml
Normal file
14
ui-flows/shared/open_message_details.yml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
appId: net.thunderbird.android.debug
|
||||
---
|
||||
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/participants_container"
|
||||
- swipe:
|
||||
from:
|
||||
id: "net.thunderbird.android.debug:id/message_details_list"
|
||||
direction: UP
|
||||
- swipe:
|
||||
from:
|
||||
id: "net.thunderbird.android.debug:id/message_details_list"
|
||||
direction: DOWN
|
||||
duration: 200
|
||||
19
ui-flows/shared/remove_contact.yml
Normal file
19
ui-flows/shared/remove_contact.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# use env to provide properties:
|
||||
# env:
|
||||
# NAME: Alice
|
||||
|
||||
appId: net.thunderbird.android.debug
|
||||
---
|
||||
|
||||
## Open contact
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/name"
|
||||
text: ${NAME}
|
||||
|
||||
## Delete contact
|
||||
- tapOn: "More options"
|
||||
- tapOn:
|
||||
id: "android:id/title"
|
||||
index: 1
|
||||
- tapOn:
|
||||
id: "android:id/button1"
|
||||
56
ui-flows/validate/compose_simple_message.yml
Normal file
56
ui-flows/validate/compose_simple_message.yml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
appId: net.thunderbird.android.debug
|
||||
---
|
||||
- runFlow:
|
||||
file: ../shared/onboard_with_demo_account.yml
|
||||
when:
|
||||
visible:
|
||||
id: "onboarding_welcome_start_button"
|
||||
|
||||
## Start composing
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/floating_action_button"
|
||||
|
||||
## Compose email
|
||||
|
||||
## To
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/to"
|
||||
- inputText: "simple_compose@example.com"
|
||||
|
||||
## Subject
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/subject"
|
||||
- inputText: "Simple compose test"
|
||||
|
||||
## Message
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/message_content"
|
||||
- inputText: "Lorem ipsum dolor sit amet."
|
||||
|
||||
## Send
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/send"
|
||||
|
||||
## Open message
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/subject"
|
||||
index: 0
|
||||
text: "Simple compose test"
|
||||
|
||||
## Assert
|
||||
- assertVisible:
|
||||
id: "net.thunderbird.android.debug:id/subject"
|
||||
text: "Simple compose test"
|
||||
- assertVisible:
|
||||
id: "net.thunderbird.android.debug:id/from"
|
||||
text: "Demo User"
|
||||
- assertVisible:
|
||||
id: "net.thunderbird.android.debug:id/recipient_names"
|
||||
text: "to simple_compose@example.com"
|
||||
|
||||
## Delete message
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/delete"
|
||||
- assertNotVisible:
|
||||
id: "net.thunderbird.android.debug:id/subject"
|
||||
text: "Simple compose test"
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
appId: net.thunderbird.android.debug
|
||||
---
|
||||
- runFlow:
|
||||
file: ../shared/onboard_with_demo_account.yml
|
||||
when:
|
||||
visible:
|
||||
id: "onboarding_welcome_start_button"
|
||||
|
||||
## Open message
|
||||
- tapOn:
|
||||
id: "net.thunderbird.android.debug:id/subject"
|
||||
index: 0
|
||||
text: "Message details demo"
|
||||
|
||||
## Check message
|
||||
- assertVisible:
|
||||
id: "net.thunderbird.android.debug:id/from"
|
||||
text: "Alice"
|
||||
- assertVisible:
|
||||
id: "net.thunderbird.android.debug:id/recipient_names"
|
||||
text: "to User 1.*"
|
||||
|
||||
### Open message details
|
||||
- runFlow: ../shared/open_message_details.yml
|
||||
|
||||
## Check message details
|
||||
- assertVisible:
|
||||
id: "net.thunderbird.android.debug:id/name"
|
||||
text: "Alice"
|
||||
- assertVisible:
|
||||
id: "net.thunderbird.android.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: "net.thunderbird.android.debug:id/subject"
|
||||
index: 0
|
||||
text: "Message details demo"
|
||||
|
||||
## Check message
|
||||
- assertVisible:
|
||||
id: "net.thunderbird.android.debug:id/from"
|
||||
text: "Alice from Contacts"
|
||||
- assertVisible:
|
||||
id: "net.thunderbird.android.debug:id/recipient_names"
|
||||
text: "to User from Contacts.*"
|
||||
|
||||
### Open message details
|
||||
- runFlow: ../shared/open_message_details.yml
|
||||
|
||||
## Check message details
|
||||
- assertVisible:
|
||||
id: "net.thunderbird.android.debug:id/name"
|
||||
text: "Alice from Contacts"
|
||||
- assertVisible:
|
||||
id: "net.thunderbird.android.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"
|
||||
4
ui-flows/validate/init_with_demo_account.yml
Normal file
4
ui-flows/validate/init_with_demo_account.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
appId: net.thunderbird.android.debug
|
||||
---
|
||||
- runFlow:
|
||||
file: ../shared/onboard_with_demo_account.yml
|
||||
Loading…
Add table
Add a link
Reference in a new issue