@@ -4,14 +4,17 @@ module EnvironmentSetup
44 # to change is the *redirect_uri* which contains the static IP address of the Canvas-lms
55 # environment, but do not change it; modify the *host_url* method instead.
66 def create_developer_key
7- @key = DeveloperKey . create! (
8- name : 'appium_developer_key' ,
9- tool_id : '68413514' ,
10- email : 'admin@instructure.com' ,
11- redirect_uri : "http://#{ host_url } " ,
12- api_key : 'w33UkRtGDXIjQPm32of6qDi6CIAqfeQw4lFDu8CP8IXOkerc8Uw7c3ZNvp1tqBcE'
13- ) if @key . nil?
14- @key
7+ if @appium_dev_key . nil?
8+ truncate_table ( DeveloperKey ) if @appium_dev_key . nil?
9+ @appium_dev_key = DeveloperKey . create! (
10+ name : 'appium_developer_key' ,
11+ tool_id : '68413514' ,
12+ email : 'admin@instructure.com' ,
13+ redirect_uri : "http://#{ host_url } " ,
14+ api_key : 'w33UkRtGDXIjQPm32of6qDi6CIAqfeQw4lFDu8CP8IXOkerc8Uw7c3ZNvp1tqBcE'
15+ )
16+ end
17+ @appium_dev_key
1518 end
1619
1720 # Static IP addresses entered into Mobile Verify. Comment/Uncomment to set the url.
@@ -46,44 +49,42 @@ def android_device_name
4649 @device_name
4750 end
4851
49- # Appium settings are device specific. To get device version, goto on device:
52+ # Appium settings are device specific. To get iOS device info :
5053 # Settings > General > Version
51- def ios_version
52- # @ios_version = '8.3'
53- @ios_version = '8.4'
54- @ios_version
55- end
56-
57- # Appium settings are device specific. To get the device name for connect iOS device run:
5854 # $ idevice_id -l ### lists connected devices by UDID
5955 # $ idevice_id [UDID] ### prints device name
60- def ios_device_name
61- # @device_name = 'QA iPhone 6'
62- # @device_name = 'iPad'
63- @device_name = 'Mobile User Testing 39'
64- @device_name
65- end
66-
67- # Appium settings are device specific. To list connected iOS devices by UDID run:
68- # idevice_id -l ### lists connected devices by UDID
69- def ios_udid
70- # @ios_udid = 'd227f9716519ddf8959f941074d712fc5d215672' # Device: QA iPhone 6
71- # @ios_udid = 'b94ee387573a4a0a87c877becf36eb7224e0a80b' # Device: iPad
72- @ios_udid = 'e192d707cd42f99c957bddc51e4fbe8aba43d9db' # Device: Mobile User Testing 39
73- @ios_udid
74- end
56+ # $ idevice_id -l ### lists connected devices by UDID
57+ def ios_device
58+ device = 'iPad' # <--- TODO: change this line to setup environment for ios device
59+ case device
60+ when 'QA iPhone 6'
61+ @ios_version = '8.3'
62+ @device_name = 'QA iPhone 6'
63+ @ios_udid = 'd227f9716519ddf8959f941074d712fc5d215672'
64+ @ios_type = 'iPhone'
65+ when 'iPad'
66+ @ios_version = '8.4'
67+ @device_name = 'iPad'
68+ @ios_udid = 'b94ee387573a4a0a87c877becf36eb7224e0a80b'
69+ @ios_type = 'iPad'
70+ when 'Mobile User Testing 39'
71+ @ios_version = '8.4'
72+ @device_name = 'Mobile User Testing 39'
73+ @ios_udid = 'e192d707cd42f99c957bddc51e4fbe8aba43d9db'
74+ @ios_type = 'iPad'
75+ else
76+ raise ( 'Unsupported ios device.' )
77+ end
7578
76- # Appium is not yet integrated with Jenkins, so the only way to specify the app path for iOS
77- # is to compile it locally with XCode, and update this method with the absolute path to the icanvas.app
78- # file in your DerivedData folder. Make sure you choose the right subfolder (iphoneos for real devices).
79- def ios_app_path
79+ # Appium is not yet integrated with Jenkins, so the only way to specify the app path for iOS
80+ # is to compile it locally with XCode, and update this method with the absolute path to the icanvas.app
81+ # file in your DerivedData folder. Make sure you choose the right subfolder (iphoneos for real devices).
8082 @ios_app_path = '/Users/twilson/Library/Developer/Xcode/DerivedData/iCanvas-fkfdbqxlcxqugldosdstapazsjaz/Build/Products/Debug-iphoneos/iCanvas.app'
81- # @ios_app_path = '/Users/twilson/Library/Developer/Xcode/DerivedData/iCanvas-fkfdbqxlcxqugldosdstapazsjaz/Build/Products/Debug-iphonesimulator/iCanvas.app'
82- @ios_app_path
83+ { versionNumber : @ios_version , deviceName : @device_name , udid : @ios_udid , app : @ios_app_path }
8384 end
8485
8586 def implicit_wait_time
8687 @implicit_wait_time = 3
8788 @implicit_wait_time
8889 end
89- end
90+ end
0 commit comments