plugin: resource
id: clock-alarm/system-image
_summary: [Automated] gather system information
command: system-image-cli -i
_description:
 Gather system info

id: clock-alarm/trigger-alarm
plugin: manual
_summary: Trigger alarm test
estimated_duration: 120
_description:
    This test checks if an alarm is triggered at the correct time by the datetime indicator.
    1. Launch the clock app.
        Clock app opens showing the current local time.
    2. Swipe the bottom edge to open the alarms page.
        Alarms page should appear showing a list of alarm. If empty then you should see a
        message being displayed that "No saved alarms".
    3. Press the plus icon to create a new alarm. Change the alarm time to ring in the next
       minute. Do not change any other options. Save Alarm.
        The saved alarm should be displayed in the alarms page.
    4. Wait for the alarm to ring.
        The alarm should ring (with haptic feedback) at the time set in the previous step and
        should show a notification with the buttons "Snooze" and "Ok".
    5. Press "Ok" to dismiss the alarm.
        The alarm should be dismissed.

id: clock-alarm/edit-alarm-sound
plugin: manual
depends: clock-alarm/trigger-alarm
_summary: Edit alarm sound test
estimated_duration: 120
_description:
    This test checks if an updated alarm rings with the alarm sound selected by the user
    as this functionality has regressed in the past.
    1. Launch the clock app.
        Clock app opens showing the current local time.
    2. Swipe the bottom edge to open the alarms page.
        Alarms page should appear showing a list of alarm. If empty then you should see a
        message being displayed that "No saved alarms".
    3. Press the plus icon to create a new alarm. Change the alarm time to ring in the next
       minute. Do not change any other options. Save Alarm.
        The saved alarm should be displayed in the alarms page.
    4. Press the saved alarm to edit it.
        The edit alarm page should be visible with the values set in the previous step.
    5. Press the "Alarm Sound" list item to change the alarm sound.
        The Sound page should be visible on pressing the "Alarm Sound" list item.
    6. Choose a different alarm sound by pressing on any alarm sound.
        On pressing any alarm sound, you should be able to hear a preview of the alarm sound
        and also the checkbox is ticked to indicate it has been selected.
    7. Press the back button and then save the alarm.
        You should be taken back to the alarms page after you save the alarm.
    8. Wait for the alarm to ring.
        The alarm should ring (with haptic feedback) at the time set in the previous step and
        should show a notification with the buttons "Snooze" and "Ok".
    9. Press "Ok" to dismiss the alarm.
        The alarm should be dismissed.

id: clock-alarm/edit-alarm-focus
plugin: manual
depends: clock-alarm/trigger-alarm
_summary: Edit Alarm focus test
estimated_duration: 660
_description:
    This test check if an edited alarm is saveable even when clock app loses focus during the test.
    1. Launch the clock app.
        Clock app opens showing the current local time.
    2. Swipe the bottom edge to open the alarms page.
        Alarms page should appear showing a list of alarm. If empty then you should see a
        message being displayed that "No saved alarms".
    3. Press the plus icon to create a new alarm. Change the alarm time to ring in the next
       minute. Do not change any other options. Save Alarm.
        The saved alarm should be displayed in the alarms page.
    4. Press the saved alarm to edit it.
        The edit alarm page should be visible with the values set in the previous step.
    5. Swipe from the right-edge briefly.
        The Unity dash should be visible
    6. Swipe again from the right-edge briefly.
        The clock app should now be visible
    7. Change the alarm time to ring in the next minute. Do not change any other options. Save Alarm.
        The saved alarm should be displayed in the alarms page.
    8. Wait for the alarm to ring.
        The alarm should ring (with haptic feedback) at the time set in the previous step and
        should show a notification with the buttons "Snooze" and "Ok".
    9. Press "Ok" to dismiss the alarm.
        The alarm should be dismissed.

id: clock-alarm/silence-setting
plugin: manual
depends: clock-alarm/trigger-alarm
_summary: Alarm Silence after setting test
estimated_duration: 660
_description:
    This test checks if the alarm's "silence after" setting is obeyed.
    1. Launch the clock app.
        Clock app opens showing the current local time.
    2. Click the settings icon shown in the top right.
        The settings page is visible showing the alarm settings.
    3. Set the silence after setting to 10 minutes.
        The alarm silence after setting should read "10 minutes" to indicate
        it has been set.
    4. Press the back button.
        The settings page is closed and you are returned to the main clock page.
    5. Swipe the bottom edge to open the alarms page.
        Alarms page should appear showing a list of alarm. If empty then you should see a
        message being displayed that "No saved alarms".
    6. Press the plus icon to create a new alarm. Change the alarm time to ring in the next
       minute. Do not change any other options. Save Alarm.
        The saved alarm should be displayed in the alarms page.
    7. Wait for the alarm to ring.
        The alarm should ring (with haptic feedback) at the time set in the previous step and
        should show a notification with the buttons "Snooze" and "Ok".
    8. Allow the alarm to keep ringing.
        The alarm should keep ringing and be silenced automatically by the phone only after
        the duration set in step three.

id: clock-alarm/vibration-setting
plugin: manual
depends: clock-alarm/trigger-alarm
_summary: Alarm vibration setting test
estimated_duration: 120
_description:
    This test checks if the alarm vibration settings enables/disables the alarm vibration.
    1. Launch the clock app.
        Clock app opens showing the current local time.
    2. Click the settings icon shown in the top right.
        The settings page is visible showing the alarm settings.
    3. Toggle the alarm vibration settings to off position.
        The switch is discoloured to indicate that it has been disabled.
    4. Press the back button.
        The settings page is closed and you are returned to the main clock page.
    5. Swipe the bottom edge to open the alarms page.
        Alarms page should appear showing a list of alarm. If empty then you should see a
        message being displayed that "No saved alarms".
    6. Press the plus icon to create a new alarm. Change the alarm time to ring in the next
       minute. Do not change any other options. Save Alarm.
        The saved alarm should be displayed in the alarms page.
    7. Wait for the alarm to ring.
        Wait for the alarm to ring.
        The alarm should ring at the time set in the previous step and should show a
        notification with the buttons "Snooze" and "Ok". However there should be no
        vibration when the alarm rings.

id: clock-alarm/snooze-setting
plugin: manual
depends: clock-alarm/trigger-alarm
estimated_duration: 360
_summary: Test the alarm snooze setting options
_description:
    This test checks if the alarm snooze settings works as expected.
    1. Launch the clock app.
        Clock app opens showing the current local time.
    2. Click the settings icon shown in the top right.
        The settings page is visible showing the alarm settings.
    3. Set the snooze duration to 2 minutes.
        The alarm snooze duration setting should read "2 minutes" to indicate
        it has been set.
    4. Press the back button.
        The settings page is closed and you are returned to the main clock page.
    5. Swipe the bottom edge to open the alarms page.
        Alarms page should appear showing a list of alarm. If empty then you should see a
        message being displayed that "No saved alarms".
    6. Press the plus icon to create a new alarm. Change the alarm time to ring in the next
       minute. Do not change any other options. Save Alarm.
        The saved alarm should be displayed in the alarms page.
    7. Wait for the alarm to ring.
        The alarm should ring (with haptic feedback) at the time set in the previous step and
        should show a notification with the buttons "Snooze" and "Ok".
    8. Press the "Snooze" button.
        The alarm should be snoozed.
    9. Wait for 2 minutes.
        The alarm should ring again (with haptic feedback). Note that if an alarm is set to ring
        originally at 10:00:00 and you snooze it the first time at 10:01:30, it should ring the next
        time at 10:03:30 and not at 10:02:00.

id: clock-alarm/disable-alarm
plugin: manual
depends: clock-alarm/trigger-alarm
estimated_duration: 360
_summary: Test the alarm disable feature
_description:
    This test checks if the alarm disable feature works as expected.
    1. Launch the clock app.
        Clock app opens showing the current local time.
    2. Swipe the bottom edge to open the alarms page.
        Alarms page should appear showing a list of alarm. If empty then you should see a
        message being displayed that "No saved alarms".
    3. Press the plus icon to create a new alarm. Change the alarm time to ring in the next
       minute. Do not change any other options. Save Alarm.
        The saved alarm should be displayed in the alarms page.
    4. Press the switch next to the alarm that was just created to disable it.
        The alarm switch should be colorless to indicate it is disabled.
    5. Wait for the time to pass the alarm time.
        The alarm should not ring since it was disabled.

id: clock-alarm/refresh-one-alarm
plugin: manual
depends: clock-alarm/trigger-alarm
estimated_duration: 120
_summary: Test the alarm page refresh issue
_description:
    This test checks if the alarm listview refreshes appropriately when clock app gains focus.
    1. Launch the clock app.
        Clock app opens showing the current local time.
    2. Swipe the bottom edge to open the alarms page.
        Alarms page should appear showing a list of alarm. If empty then you should see a
        message being displayed that "No saved alarms".
    3. Press the plus icon to create a new one-time alarm. Change the alarm time to ring in the next
       minute. Do not change any other options. Save Alarm.
        The saved alarm should be displayed in the alarms page.
    4. Wait for the time to pass the alarm time.
        The alarm should ring at the time set in the previous step.
    5. Press "Ok" to dismiss the alarm
        The alarm should be dismissed.
    6. Check the status of the one-time alarm you just dismissed.
        The one-time alarm must be disabled since it was triggered and dismissed by the user.

id: clock-alarm/refresh-recurring-alarm
plugin: manual
depends: clock-alarm/trigger-alarm
estimated_duration: 120
_summary: Test the alarm switch disable issue
_description:
    This test checks if the recurring alarm switches stays enabled after dismissing the alarm.
    1. Launch the clock app.
        Clock app opens showing the current local time.
    2. Swipe the bottom edge to open the alarms page.
        Alarms page should appear showing a list of alarm. If empty then you should see a
        message being displayed that "No saved alarms".
    3. Press the plus icon to create a new recurring alarm. Change the alarm time to ring in the next
       minute and set it to repeat on 2-3 days (including today). Save Alarm.
        The saved alarm should be displayed in the alarms page.
    4. Wait for the time to pass the alarm time.
        The alarm should ring at the time set in the previous step.
    5. Press "Ok" to dismiss the alarm
        The alarm should be dismissed.
    6. Check the status of the recurring alarm you just dismissed.
        The recurring alarm must not be disabled after it was triggered and dismissed by the user since
        it is a recurring alarm.
    7. Check the recurring alarm in the datetime indicator.
        Indicator datetime should update and show the next occurance day of the recurring alarm you dismissed.

