desired capabilities in env variable or command line

53 views
Skip to first unread message

brandt...@gmail.com

unread,
Mar 13, 2014, 12:14:16 PM3/13/14
to wtfra...@googlegroups.com
I am using WTF for mobile app testing. Using TeamCity to run automated tests. TC needs to be able to pass in the path of the binary it produces for the "app" setting of the desired capabilities in my config files. Either a command line arg for runtests.py or a way to specify it in the configs.

I noticed a mention of system variables in the wiki:

https://github.com/wiredrive/wtframework/wiki/Configuration-Management

but It wasn't really clear to me....

brandt...@gmail.com

unread,
Mar 13, 2014, 1:00:50 PM3/13/14
to wtfra...@googlegroups.com
%teamcity.build.checkoutDir%

David Lai

unread,
Mar 13, 2014, 1:41:05 PM3/13/14
to
So the environment variable  method is basically, if you set an enviornment variable like, (dots replaced by underscores, since some OS doesn't support dots in env vars)

export WTF_MySetting_login=admin
export WTF_MySetting_password=s3cure

Then you can access them using the config reader 
print WTF_CONFIG_READER.get("MySetting.login")    # admin
print WTF_CONFIG_READER.get("MySetting.password") # s3cure

This is helpful for running tests on production from the cloud where you don't want to write sensitive information to disk, 
incase the disk might be shared with other systems.  This is what I'm using for the travis CI tests since I don't want to 
leak the API keys for the Sauce account associated with the project.

David Lai

unread,
Mar 13, 2014, 1:44:40 PM3/13/14
to wtfra...@googlegroups.com
I'll have to check if env var settings are pulled in for the desired capabilities, I don't think it is currently.


Ideally you should be able to do this

export WTF_selenium_desired_capabilities_app=path/to/your/app

this will create an en variable that WTFramework to lookup

David Lai

unread,
Mar 13, 2014, 1:51:37 PM3/13/14
to wtfra...@googlegroups.com
Looks like it's not supported currently.  I'll add this to the project issues list so we can tackle it when we have time.

brandt...@gmail.com

unread,
Mar 13, 2014, 1:52:01 PM3/13/14
to wtfra...@googlegroups.com
I think there is a way to embed code in yaml....still investigating...

David Lai

unread,
Mar 13, 2014, 9:29:01 PM3/13/14
to wtfra...@googlegroups.com
This is sort of bad of me for pushing a new feature into a release branch while it's under testing, but I thought the change is simple enough.  I added support for overriding desired_capabilities properties via ENV vars.



brandt...@gmail.com

unread,
Apr 9, 2014, 1:25:42 PM4/9/14
to wtfra...@googlegroups.com
I found a good solution...and that is have TeamCity publish the artifacts of the build which can be found via URL:

app: http://appium:12...@ciserver.local:8111/httpAuth/repository/download/IfhIOS_Tests/lastFinished/IFH.zip

or

app: http://appium:12...@ciserver.local:8111/httpAuth/repository/download/IfhIOS_Tests/lastSuccessful/IFH.zip

Reply all
Reply to author
Forward
0 new messages