mattermost-mobile-upstream/detox/maestro/flows/timezone/clock_display.yml

90 lines
2.7 KiB
YAML

# MM-T1325: Timezone display settings reflect the device timezone after app restart.
#
# PRE-CONDITIONS:
# - CI: run_ci_batches.sh sets emulator/sim TZ to SIMULATOR_TIMEZONE (default America/New_York)
# - Local: use scripts/run_timezone_test.sh to set device TZ and EXPECTED_TIMEZONE_REGION
#
# REQUIRED ENV VARS:
# - MAESTRO_APP_ID, TEST_USER_EMAIL, TEST_USER_PASSWORD
# - EXPECTED_TIMEZONE_REGION — set by CI/local wrapper (e.g. "New York" for America/New_York)
# - SIMULATOR_TIMEZONE — IANA id (CI/local wrapper; default America/New_York)
#
# ASSERTIONS:
# - With EXPECTED_TIMEZONE_REGION: description shows that region label
# - Without EXPECTED_TIMEZONE_REGION (bare local maestro test): automatic TZ on, label not "Off"
#
# testIDs:
# - tab_bar.account.tab
# - account.screen
# - account.settings.option
# - settings.display.option
# - display_settings.screen
# - display_settings.timezone.option
# - timezone_display_settings.screen
# - timezone_display_settings.automatic.option
# - timezone_display_settings.automatic.option.description
tags:
- MM-T1325
appId: ${MAESTRO_APP_ID}
env:
SIMULATOR_TIMEZONE: ${SIMULATOR_TIMEZONE || "America/New_York"}
EXPECTED_TIMEZONE_REGION: ${EXPECTED_TIMEZONE_REGION || ""}
---
# Step 1: Login (login.yml clearState:true relaunch picks up CI TZ from launchctl setenv).
- runFlow: ../../subflows/auth/login.yml
# Step 2: Open Account settings
- tapOn:
id: "tab_bar.account.tab"
- extendedWaitUntil:
visible:
id: "account.screen"
timeout: 10000
# Step 3: Open Settings
- tapOn:
id: "account.settings.option"
- extendedWaitUntil:
visible:
id: "settings.display.option"
timeout: 10000
# Step 4: Open Display settings
- tapOn:
id: "settings.display.option"
- extendedWaitUntil:
visible:
id: "display_settings.screen"
timeout: 10000
# Step 5: Open Timezone settings
- tapOn:
id: "display_settings.timezone.option"
- extendedWaitUntil:
visible:
id: "timezone_display_settings.screen"
timeout: 10000
# Step 6: Enable automatic timezone if needed; assert region label.
- assertVisible:
id: "timezone_display_settings.automatic.option"
- runFlow:
when:
visible:
text: "Off"
commands:
- tapOn:
id: "timezone_display_settings.automatic.option"
- waitForAnimationToEnd:
timeout: 3000
# CI and run_timezone_test.sh pass EXPECTED_TIMEZONE_REGION; bare local runs use weaker check.
- runFlow:
when:
true: ${EXPECTED_TIMEZONE_REGION != ""}
file: ../../subflows/timezone/assert_timezone_region_label.yml
- runFlow:
when:
true: ${EXPECTED_TIMEZONE_REGION == ""}
file: ../../subflows/timezone/assert_timezone_region_local.yml
- takeScreenshot: timezone-settings-visible