appId: dev.expo.updatese2e
onFlowStart:
  - runFlow:
      file: beforeEach.yml
---
# test changing the updates URL with the client API
- evalScript:
    script:  ${output.api.restartUpdatesServer(0, true)}
    label: Restart updates server with overridden URL
- evalScript:
    script:  ${output.api.serveManifest('test-update-basic', MAESTRO_PLATFORM)}
    label: Setup updates server to serve a basic update
    env:
      MAESTRO_PLATFORM: ${MAESTRO_PLATFORM}
- launchApp
- evalScript:
    script: ${output.api.delay(3000)}
    label: Delay for 3 seconds
- copyTextFrom:
    label: Copy text from update string
    id: updateString
- assertTrue:
    condition: ${maestro.copiedText == "test"}
    label: Assert update string is from embedded bundle
- tapOn:
    label: Tap on button to change updates URL
    id: setUpdateURLAndRequestHeadersOverride
- evalScript:
    script: ${output.api.delay(3000)}
    label: Delay for 3 seconds
- stopApp
- launchApp
- evalScript:
    script: ${output.api.delay(3000)}
    label: Delay for 3 seconds
- copyTextFrom:
    label: Copy text from update string
    id: updateString
- assertTrue:
    condition: ${maestro.copiedText == "test-update-1"}
    label: Assert update string is from downloaded bundle
- stopApp
