Skip to content

Commit 208d375

Browse files
faidybootstraponline
authored andcommitted
Read configs from cucumber.yml
1 parent 62e03b8 commit 208d375

5 files changed

Lines changed: 34 additions & 0 deletions

File tree

sample-code/examples/ruby/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ To run the Cucumber examples, you'll need to change directory to the cucumber
5050
directory (`cd APPIUM-LOCATION/sample-code/examples/ruby/cucumber`) and then,
5151
from the commandline, run `cucumber`.
5252

53+
Different running configurations are supported:
54+
- For iPad Air simulator: run `cucumber -p ipadsim`
55+
- For iPhone 6 simulator: run `cucumber -p iphonesim`
56+
5357
For more information, check out the comments at the top of the files in the
5458
cucumber directory.
5559

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# config/cucumber.yml
2+
##YAML Template
3+
---
4+
ipadsim: IDEVICENAME='ipad simulator'
5+
iphonesim: IDEVICENAME='iphone simulator'
6+

sample-code/examples/ruby/cucumber_ios/features/support/env.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ class AppiumWorld
1414

1515
# Load the desired configuration from appium.txt, create a driver then
1616
# Add the methods to the world
17+
if ENV['IDEVICENAME']=='ipad simulator'
18+
caps = Appium.load_appium_txt file: File.expand_path("./../ipadsim/appium.txt", __FILE__), verbose: true
19+
elsif ENV['IDEVICENAME']=='iphone simulator'
20+
caps = Appium.load_appium_txt file: File.expand_path("./../iphonesim/appium.txt", __FILE__), verbose: true
21+
else
1722
caps = Appium.load_appium_txt file: File.expand_path('./', __FILE__), verbose: true
23+
end
1824
Appium::Driver.new(caps)
1925
Appium.promote_appium_methods AppiumWorld
2026

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[caps]
2+
platformName = "ios"
3+
deviceName = "iPad Air"
4+
platformVersion = "8.1"
5+
app = "../../../apps/TestApp/build/release-iphonesimulator/TestApp.app"
6+
7+
[appium_lib]
8+
sauce_username = false
9+
sauce_access_key = false
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[caps]
2+
platformName = "ios"
3+
deviceName = "iPhone 6"
4+
platformVersion = "8.1"
5+
app = "../../../apps/TestApp/build/release-iphonesimulator/TestApp.app"
6+
7+
[appium_lib]
8+
sauce_username = false
9+
sauce_access_key = false

0 commit comments

Comments
 (0)