appId: com.edde746.plezy
name: System back dismisses a hosted sheet without leaving Settings

tags:
  - e2e
  - regression
  - settings
  - sheets
---
# Guards 8e1904dd and c48cbf70 together.
#
# On a phone, Settings is a pushed route. Before c48cbf70 it carried no
# OverlaySheetHost, so Manage Libraries fell back to showModalBottomSheet and a
# single Back tore down the sheet *and* Settings. Before 8e1904dd the host
# answered the platform pop with a TV-only dedup marker that could already be
# spent, stranding the sheet open with no way out. Either defect fails the
# "Manage Libraries is still there after one Back" assertion below.
#
# The same commit blocks semantics behind the barrier, so the occlusion
# assertions pin that an open sheet actually hides the rows underneath.
# Pristine state on purpose. The TV regressions in the same CI group leave
# "Force TV mode" enabled, and this flow asserts the handheld Settings route,
# so it must not inherit whichever layout the previous flow left behind.
- runFlow: ../subflows/onboard_jellyfin.yaml
- runFlow: ../subflows/open_settings.yaml
- assertVisible: "(?s)^Services.*"
- assertVisible: "(?s)^Video Playback.*"
- tapOn: "(?s)^Manage Libraries.*"
- extendedWaitUntil:
    visible: "Maestro Movies"
    timeout: 15000
# The barrier swallows every pointer event, so the rows behind it must leave
# the semantics tree too. Without BlockSemantics an occluded row still reads as
# visible and a tap on it lands on the barrier instead. "Manage Libraries" is
# excluded on purpose: it is also the sheet's own title.
- assertNotVisible: "(?s)^Services.*"
- assertNotVisible: "(?s)^Video Playback.*"
- assertNotVisible: "(?s)^Appearance.*"
- assertNotVisible: "(?s)^Connections.*"
- back
- waitForAnimationToEnd:
    timeout: 3000
- assertNotVisible: "Maestro Movies"
# One Back closed only the sheet: Settings is still the current route.
- extendedWaitUntil:
    visible: "(?s)^Manage Libraries.*"
    timeout: 10000
- assertVisible: "(?s)^Services.*"
- assertVisible: "(?s)^Video Playback.*"
- assertNotVisible: "Discover"
# Reopening proves the host did not strand the one-shot dedup marker: a second
# dismissal has to work exactly like the first.
- tapOn: "(?s)^Manage Libraries.*"
- extendedWaitUntil:
    visible: "Maestro Movies"
    timeout: 15000
# The per-library menu is a nested page of the same sheet now that the host
# exists, so Back returns to the library list instead of tearing the sheet down.
- tapOn: "Library options"
- extendedWaitUntil:
    visible: "(?s).*Refresh Metadata.*"
    timeout: 15000
- back
- waitForAnimationToEnd:
    timeout: 3000
- extendedWaitUntil:
    visible: "Maestro Movies"
    timeout: 10000
- assertNotVisible: "(?s).*Refresh Metadata.*"
# Back at the library list, one more Back leaves the sheet entirely.
- back
- waitForAnimationToEnd:
    timeout: 3000
- assertNotVisible: "Maestro Movies"
- extendedWaitUntil:
    visible: "(?s)^Manage Libraries.*"
    timeout: 10000
- tapOn: "(?s)^Manage Libraries.*"
- extendedWaitUntil:
    visible: "Maestro Movies"
    timeout: 15000
- back
- waitForAnimationToEnd:
    timeout: 3000
- assertNotVisible: "Maestro Movies"
- extendedWaitUntil:
    visible: "(?s)^Manage Libraries.*"
    timeout: 10000
# With no sheet open the host must let the route pop normally.
- back
- extendedWaitUntil:
    visible: "Discover"
    timeout: 15000
- assertNotVisible: "(?s)^Manage Libraries.*"
