@@ -59,7 +59,7 @@ module Caps
59
59
platformName : :android ,
60
60
automationName : 'uiautomator2' ,
61
61
app : 'test/functional/app/api.apk' ,
62
- platformVersion : '6.0 ' ,
62
+ platformVersion : '7.1.1 ' ,
63
63
deviceName : 'Android Emulator' ,
64
64
appPackage : 'io.appium.android.apis' ,
65
65
appActivity : 'io.appium.android.apis.ApiDemos' ,
@@ -138,6 +138,39 @@ def android_mock_create_session
138
138
driver
139
139
end
140
140
141
+ def android_mock_create_session_w3c
142
+ response = {
143
+ value : {
144
+ sessionId : '1234567890' ,
145
+ capabilities : {
146
+ platformName : :android ,
147
+ automationName : 'uiautomator2' ,
148
+ app : 'test/functional/app/api.apk' ,
149
+ platformVersion : '7.1.1' ,
150
+ deviceName : 'Android Emulator' ,
151
+ appPackage : 'io.appium.android.apis' ,
152
+ appActivity : 'io.appium.android.apis.ApiDemos' ,
153
+ some_capability : 'some_capability' ,
154
+ unicodeKeyboard : true ,
155
+ resetKeyboard : true
156
+ }
157
+ }
158
+ } . to_json
159
+
160
+ stub_request ( :post , 'http://127.0.0.1:4723/wd/hub/session' )
161
+ . to_return ( headers : HEADER , status : 200 , body : response )
162
+
163
+ stub_request ( :post , "#{ SESSION } /timeouts" )
164
+ . with ( body : { implicit : 30_000 } . to_json )
165
+ . to_return ( headers : HEADER , status : 200 , body : { value : nil } . to_json )
166
+
167
+ driver = @core . start_driver
168
+
169
+ assert_requested ( :post , 'http://127.0.0.1:4723/wd/hub/session' , times : 1 )
170
+ assert_requested ( :post , "#{ SESSION } /timeouts" , body : { implicit : 30_000 } . to_json , times : 1 )
171
+ driver
172
+ end
173
+
141
174
def ios_mock_create_session
142
175
response = {
143
176
status : 0 , # To make bridge.dialect == :oss
@@ -165,5 +198,32 @@ def ios_mock_create_session
165
198
assert_requested ( :post , "#{ SESSION } /timeouts/implicit_wait" , times : 1 )
166
199
driver
167
200
end
201
+
202
+ def ios_mock_create_session_w3c
203
+ response = {
204
+ value : {
205
+ sessionId : '1234567890' ,
206
+ capabilities : {
207
+ device : 'iphone' ,
208
+ browserName : 'UICatalog' ,
209
+ sdkVersion : '10.3.1' ,
210
+ CFBundleIdentifier : 'com.example.apple-samplecode.UICatalog'
211
+ }
212
+ }
213
+ } . to_json
214
+
215
+ stub_request ( :post , 'http://127.0.0.1:4723/wd/hub/session' )
216
+ . to_return ( headers : HEADER , status : 200 , body : response )
217
+
218
+ stub_request ( :post , "#{ SESSION } /timeouts" )
219
+ . with ( body : { implicit : 30_000 } . to_json )
220
+ . to_return ( headers : HEADER , status : 200 , body : { value : nil } . to_json )
221
+
222
+ driver = @core . start_driver
223
+
224
+ assert_requested ( :post , 'http://127.0.0.1:4723/wd/hub/session' , times : 1 )
225
+ assert_requested ( :post , "#{ SESSION } /timeouts" , body : { implicit : 30_000 } . to_json , times : 1 )
226
+ driver
227
+ end
168
228
end
169
229
end
0 commit comments