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
bitce
August 15, 2019, 12:26pm
2
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:
appium_logs.sh
============================= test session starts ==============================
platform darwin -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
rootdir: /Users/rafaelcarvalho/Desktop/projects/open-ios/open-test-automation
plugins: allure-pytest-2.7.1
collected 5 items
tests/test_login.py [HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"firstMatch":[{"platformName":"iOS","appium:platformVersion":"12.4","appium:deviceName":"iPhone X","appium:automationName":"XCUITest","appium:useNewWDA":true,"appium:usePrebuiltWDA":false,"appium:app":"/var/folders/sx/qwd0l4kj15g17_m1p1g1nb7r0000gn/T/__archive__388107363/hashtagopen DEV.xcarchive/Products/Applications/hashtagopen DEV.app"}]},"desiredCapabilities":{"platformName":"iOS","platformVersion":"12.4","deviceName":"iPhone X","automationName":"XCUITest","useNewWDA":true,"usePrebuiltWDA":false,"app":"/var/folders/sx/qwd0l4kj15g17_m1p1g1nb7r0000gn/T/__archive__388107363/hashtagopen DEV.xcarchive/Products/Applications/hashtagopen DEV.app"}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"iOS","platformVersion":"12.4","deviceName":"iPhone X","automationName":"XCUITest","useNewWDA":true,"usePrebuiltWDA":false,"app":"/var/folders/sx/qwd0l4kj15g17_m1p1g1nb7r0000gn/T/__archive__388107363/hashtagopen DEV.xcarchive/Products/Applications/hashtagopen DEV.app"},null,{"firstMatch":[{"platformName":"iOS","appium:platformVersion":"12.4","appium:deviceName":"iPhone X","appium:automationName":"XCUITest","appium:useNewWDA":true,"appium:usePrebuiltWDA":false,"appium:app":"/var/folders/sx/qwd0l4kj15g17_m1p1g1nb7r0000gn/T/__archive__388107363/hashtagopen DEV.xcarchive/Products/Applications/hashtagopen DEV.app"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1565888968329 (14:09:28 GMT-0300 (Brasilia Standard Time))
This file has been truncated. show original
system
Closed
September 14, 2019, 5:20pm
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.