appId: ${APP_ID}
env:
  USERNAME: supervisor.e2e
  PASSWORD: 12345678
  INSTANCE_ID: ${EL_INSTANCE_ID}
  API_URL: ${API_URL}
  COLLABORATOR_ID: ${EL_COLLABORATOR_ID}
  MODULE_NAME: 'Tasks'

onFlowStart:
  - runScript: ../../shared/scripts/api.js
  - runScript: ./scripts/employeeLifecycleApi.js
  - runScript: ./scripts/setupProcess.js

onFlowComplete:
  - runScript: ./scripts/teardownProcess.js
---
- runFlow: ../../shared/launch-app.yml
- runFlow: ../../shared/login-to-community.yml
- runFlow: ../../shared/go-to-module-from-apps.yml

# Search for collaborator in list
- waitForAnimationToEnd:
    timeout: 2000
- tapOn: Filter
- assertVisible: Filter by collaborator
- tapOn: Search
- inputText: collaborator
- assertVisible: Collaborator 1 E2E
# Tap to close the keyboard
# Android emulator with bottom sheet don't work the hideKeyboard command
- waitForAnimationToEnd:
    timeout: 1000
- tapOn:
    point: 50%, 30%
- assertVisible:
    text: Collaborator 1 E2E
    enabled: true
- tapOn: Collaborator 1 E2E
- assertVisible:
    text: Select
    enabled: true
- tapOn: Select
- assertNotVisible: Filter by collaborator

# Mark task as completed
- tapOn: '.*${output.employeeLifecycle.supervisorActionTitle}.*'
- tapOn: 'Mark as completed'
- assertVisible:
    text: 'Completed Tasks'
    enabled: true
