File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/main/java/io/appium/java_client Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1818
1919import static io .appium .java_client .MobileCommand .GET_DEVICE_TIME ;
2020
21+ import com .google .common .collect .ImmutableList ;
2122import com .google .common .collect .ImmutableMap ;
2223
24+ import org .openqa .selenium .remote .DriverCommand ;
2325import org .openqa .selenium .remote .Response ;
2426
27+ import java .util .Map ;
28+
2529public interface HasDeviceTime extends ExecutesMethod {
2630
2731 /**
@@ -31,10 +35,15 @@ public interface HasDeviceTime extends ExecutesMethod {
3135 * https://momentjs.com/docs/ to get the full list of supported
3236 * datetime format specifiers. The default format is
3337 * `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601
38+ * @since Appium 1.18
3439 * @return Device time string
3540 */
3641 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 );
3847 return response .getValue ().toString ();
3948 }
4049
You can’t perform that action at this time.
0 commit comments