Get the correct app path in DerivedData

I’m trying to run my tests using Appium and to run the tests I need to point the app at desired capabilities:

desired_capabilities = {
    'platformName': 'iOS',
    'platformVersion': '12.4',
    'deviceName': 'iPhone X',
    'automationName': 'XCUITest',
    'useNewWDA': True,
    'app': '/Users/rafael/Library/Developer/Xcode/DerivedData/company-elxxghfnkxsatdcxwwphvkbmetxf/Build/Products/Debug-iphonesimulator/company STAGING.app'
}

My question is: After completing the iOS build on Bitrise, how can I store the correct build located on derivedData folder (/DerivedData / company-elxxghfnkxsatdcxwwphvkbmetxf / Build / Products / Debug-iphonesimulator / company STAGING.app) to point to my tests?
Are there any variables that store this information?

Thanks,
Rafael

Hi @rafaelcrvs!

Can you let us know a bit more details about the project? Specifically, what solution do you use to generate the .app in the first place? Most solutions will automatically assign a variable to the path (like $BITRISE_APP_PATH) if this is the case, you could just reference that.

Hi @bitce.

My current workflow where the app is built:


The last step is the script where the tests are set.

#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# rm -rf open-test-automation
# sleep 3
git clone git@github.com:hashtagopen/open-test-automation.git
envman add --key APP_PATH --value "${BITRISE_APP_PATH}"
echo APP_PATH
export APP_PATH

nohup appium & sleep 2

cd open-test-automation
virtualenv --python=python3 env
source env/bin/activate
pip install -r requirements.txt
pytest -s tests

and when I run all the workflow locally, the iOS simulator opens, installs the app but doesn’t run the tests. Appium logs show this:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.