name: UITests

schemes:
  UITests:
    analyze:
      config: Debug
    archive:
      config: Release
    build:
      targets:
        UITests: all
    profile:
      config: Release
    run:
      config: Debug
      disableMainThreadChecker: false
    test:
      config: Debug
      testPlans:
        - path: UITests.xctestplan
          defaultPlan: true

targets:
  UITests:
    type: bundle.ui-testing
    platform: iOS

    dependencies:
    - target: ElementX
    - package: MatrixRustSDK
      linkType: static
    - package: AnalyticsEvents
      linkType: static
    - package: AppAuth
      linkType: static
    - package: DTCoreText
      linkType: static
    - package: KeychainAccess
      linkType: static
    - package: Kingfisher
      linkType: static
    - package: Introspect
      linkType: static
    - package: PostHog
      linkType: static
    - package: SwiftyBeaver
      linkType: static
    - package: SwiftState
      linkType: static
    - package: GZIP
      linkType: static
    - package: Sentry
      linkType: static
    - package: SnapshotTesting
      linkType: static

    info:
      path: ../SupportingFiles/Info.plist

    settings:
      base:
        PRODUCT_NAME: UITests
        PRODUCT_BUNDLE_IDENTIFIER: io.element.elementx.ui.tests
      debug:
      release:

    preBuildScripts:
      - name: Override Simulator Status Bars
        runOnlyWhenInstalling: false
        shell: /bin/sh
        script: |
          python3 $PROJECT_DIR/Tools/Scripts/bootTestSimulator.py --name 'iPhone 13 Pro Max' --version 'iOS.15.5'
          python3 $PROJECT_DIR/Tools/Scripts/bootTestSimulator.py --name 'iPad (9th generation)' --version 'iOS.15.5'

    sources:
    - path: ../Sources
      excludes:
        - "**/__Snapshots__/**"
    - path: ../SupportingFiles
    - path: ../../Tools/Scripts/Templates/SimpleScreenExample/Tests/UI
    - path: ../../ElementX/Sources/BuildSettings.swift
    - path: ../../ElementX/Sources/Screens/RoomScreen/View/Style/TimelineStyle.swift
    - path: ../../ElementX/Sources/Services/Analytics/AnalyticsConfiguration.swift
    - path: ../../ElementX/Sources/UITestScreenIdentifier.swift
    - path: ../../ElementX/Sources/Generated/Strings.swift
    - path: ../../ElementX/Sources/Generated/Strings+Untranslated.swift
    - path: ../../ElementX/Sources/Generated/InfoPlist.swift
    - path: ../../ElementX/Resources
    - path: ../../ElementX/Sources/Other/Extensions/Bundle.swift
