简体   繁体   中英

AWS Device Farm: issue launching iOS app with argument through Calabash

I am using Calabash to run test for my iOS app in AWS Device Farm. I need to launch app with argument. I added below code in features/support/01_launch.rb

Before do |scenario|
    launcher = Calabash::Launcher.launcher
    options = {
        :args => ['someargument']
    }
    launcher.relaunch(options)
    launcher.calabash_notify(self)
end

Locally it is able to launch app with argument 'someargument' and then proceed with test. But in AWS Device farm it is not passing argument. App launches without argument and then test runs. Is this feature not supported in AWS Device Farm or am I doing something wrong?

Thanks!!

I work for the AWS Device Farm team. The functionality you are looking at is passing in arguments to calabash test through device farm.

If you look closely at the Device Farm console you will notice that you can upload profile which is a .yaml configuration file. You can pass in your arguments in here and that should be picked up by your tests.

Let me know if you run in to any issues with using it.

Update:

The official documentation is currently being updated but we do support profiles in calabash

Update 2

Based on the users exact description and clarification from jmoody (Thank you!) if you were looking for passing an argument to the application through the launcher that is not possible today but is certainly that can be looked at based on user feedback.

You can pass in your arguments in here and that should be picked up by your tests.

The :args option in Launcher#relaunch represent arguments that are passed to the application at launch. These are not environment variables to control the behavior of Calabash or options for cucumber. I don't think it is possible to set application runtime arguments from a cucumber configuration file - unless, of course, Amazon is doing something under the hood.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM