File tree 1 file changed +10
-1
lines changed
src/main/java/io/appium/java_client
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 18
18
19
19
import static io .appium .java_client .MobileCommand .GET_DEVICE_TIME ;
20
20
21
+ import com .google .common .collect .ImmutableList ;
21
22
import com .google .common .collect .ImmutableMap ;
22
23
24
+ import org .openqa .selenium .remote .DriverCommand ;
23
25
import org .openqa .selenium .remote .Response ;
24
26
27
+ import java .util .Map ;
28
+
25
29
public interface HasDeviceTime extends ExecutesMethod {
26
30
27
31
/**
@@ -31,10 +35,15 @@ public interface HasDeviceTime extends ExecutesMethod {
31
35
* https://momentjs.com/docs/ to get the full list of supported
32
36
* datetime format specifiers. The default format is
33
37
* `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601
38
+ * @since Appium 1.18
34
39
* @return Device time string
35
40
*/
36
41
default String getDeviceTime (String format ) {
37
- Response response = execute (GET_DEVICE_TIME , ImmutableMap .of ("format" , format ));
42
+ Map <String , ?> params = ImmutableMap .of (
43
+ "script" , "mobile: getDeviceTime" ,
44
+ "args" , ImmutableList .of (ImmutableMap .of ("format" , format ))
45
+ );
46
+ Response response = execute (DriverCommand .EXECUTE_SCRIPT , params );
38
47
return response .getValue ().toString ();
39
48
}
40
49
You can’t perform that action at this time.
0 commit comments