Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't figure out how to add my .gpx file to my UITests #1535

Open
rgrinnin opened this issue Mar 11, 2025 · 2 comments
Open

I can't figure out how to add my .gpx file to my UITests #1535

rgrinnin opened this issue Mar 11, 2025 · 2 comments

Comments

@rgrinnin
Copy link

rgrinnin commented Mar 11, 2025

I've been trying to get this right. All day but now I'm out of my wits. Maybe someone spots the problem with one look. I also set the scheme path prefix as suggested in our main project.yml as suggested as we use a workspace.
Project generates and builds fine. I also can add any other predefined location through the .yml. Location can also be selected in manage scheme in xcode.

schemePathPrefix: "../"

Here's my UITest file content. Project generates and builds fine. I also can add any other predifined location. Location can also be selected in manage scheme in xcode. Any hint would be much appreciated 🙏


schemes:
  UITests:
    build:
      targets:
        myUITestTarget: [run]
        myApp: [all]

    run:
      config: Debug
      simulateLocation:
        allow: true
        defaultLocation: London, England

    test:
      config: Debug
      gatherCoverageData: true
      targets:
        - name: myUITestTarget
          parallelizable: false
          randomExecutionOrder: false
          location: ./Tests/Testability/UITestLocation-Muellrose.gpx
      preActions:
        - script: "zsh $PROJECT_DIR/Scripts/UITestAutomation/simulator-test-preAction.sh"
          name: Set geo location
          settingsTarget: myApp
          basedOnDependencyAnalysis: false    
      prebuildScripts:
        - script: 'xcrun simctl erase all'
          name: "Run Script: Pre-Build"
          shell: /bin/zsh
      basedOnDependencyAnalysis: false
      coverageTargets: [MyAppsCore,
                        MyAppsUI,
                        MyAppsShared,
                        MyAppsProfile]

targets:
  myUITestTarget:
    type: bundle.ui-testing
    platform: iOS
    settings:
      SWIFT_ACTIVE_COMPILATION_CONDITIONS: $(inherited) TEST
    configFiles:
      Debug: Configuration/ApplicationTests.xcconfig
      Release: Configuration/ApplicationTests.xcconfig
      skippedTests: [UserLifeCycleUITests/test_createUser_VerifyGPS_DeleteUser_Success()]
    fileGroups:
      - UITestLocation-Muellrose.gpx

    dependencies:
      - target: nebenan
      - target: MyAppsApplication
        embed: true
      - target: MyAppsProfile
        embed: true
@yonaskolb
Copy link
Owner

At first glance fileGroups would need to be replaced with sources in your test target

@rgrinnin
Copy link
Author

Thanks so much for the swift reply and it makes a lot of sense from the snippet I added above. Seems I didn't do a good job there, sorry. 😆
Here is what I use for sources. Which should be fine because the .gpx sits in our Testability folder and all the other sources build and work as expected.

    sources:
      - Tests/MyUITesting
      - path: Tests/Testability
        excludes:
          - "Resources/*"
      - path: Sources/MyAssets
        excludes:
          - "Resources/*"
          - "Sources/*"

I have to admit I don't quite understand the fileGroups key yet. I just tried to follow these docs.
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants