public bool TerminateApp(string appId, TimeSpan timeout) =>
 Convert.ToBoolean(Execute(AppiumDriverCommand.TerminateApp,
                           AppiumCommandExecutionHelper.PrepareArguments(new string[] { "appId", "options" },
                                                                         new object[] { appId, new Dictionary <string, object>()
                                                                                        {
                                                                                            { "timeout", (long)timeout.TotalMilliseconds }
                                                                                        } })).Value.ToString());
예제 #2
0
        public void PerformTouchAction(ITouchAction touchAction)
        {
            if (touchAction == null)
            {
                return;
            }
            var parameters = AppiumCommandExecutionHelper.PrepareArgument("actions", touchAction.GetParameters());

            Execute(AppiumDriverCommand.PerformTouchAction, parameters);
        }
예제 #3
0
 public void BackgroundApp(TimeSpan timeSpan) =>
 Execute(AppiumDriverCommand.BackgroundApp,
         AppiumCommandExecutionHelper.PrepareArgument("seconds", timeSpan.TotalSeconds));
예제 #4
0
 public void BackgroundApp(int seconds) =>
 Execute(AppiumDriverCommand.BackgroundApp,
         AppiumCommandExecutionHelper.PrepareArgument("seconds", seconds));
예제 #5
0
 public void ToggleData() =>
 AppiumCommandExecutionHelper.ToggleData(this);
예제 #6
0
 public void FingerPrint(int fingerprintId) =>
 AppiumCommandExecutionHelper.FingerPrint(this, fingerprintId);
예제 #7
0
 /// <summary>
 /// Hides the device keyboard.
 /// </summary>
 /// <param name="strategy">Hide keyboard strategy (optional, UIAutomation only). Available strategies - 'press', 'pressKey', 'swipeDown', 'tapOut', 'tapOutside', 'default'.</param>
 /// <param name="key">The button pressed by the mobile driver to attempt hiding the keyboard.</param>
 public void HideKeyboard(string strategy, string key)
 => AppiumCommandExecutionHelper.HideKeyboard(executeMethod: this, strategy: strategy, key: key);
예제 #8
0
 public byte[] PullFile(string pathOnDevice) =>
 Convert.FromBase64String(Execute(AppiumDriverCommand.PullFile,
                                  AppiumCommandExecutionHelper.PrepareArgument("path", pathOnDevice)).Value.ToString());
예제 #9
0
 public byte[] PullFolder(string remotePath) =>
 Convert.FromBase64String(Execute(AppiumDriverCommand.PullFolder,
                                  AppiumCommandExecutionHelper.PrepareArgument("path", remotePath)).Value.ToString());
예제 #10
0
 public bool TerminateApp(string appId) =>
 Convert.ToBoolean(Execute(AppiumDriverCommand.TerminateApp,
                           AppiumCommandExecutionHelper.PrepareArgument("appId", appId)).Value.ToString());
예제 #11
0
 public bool IsAppInstalled(string bundleId) =>
 Convert.ToBoolean(Execute(AppiumDriverCommand.IsAppInstalled,
                           AppiumCommandExecutionHelper.PrepareArgument("bundleId", bundleId)).Value.ToString());
예제 #12
0
 public void ActivateApp(string appId) =>
 Execute(AppiumDriverCommand.ActivateApp, AppiumCommandExecutionHelper.PrepareArgument("appId", appId));
예제 #13
0
 public void InstallApp(string appPath) =>
 Execute(AppiumDriverCommand.InstallApp, AppiumCommandExecutionHelper.PrepareArgument("appPath", appPath));
 public void BackgroundApp() =>
 Execute(AppiumDriverCommand.BackgroundApp,
         AppiumCommandExecutionHelper.PrepareArgument("seconds", AppiumCommandExecutionHelper.PrepareArgument("timeout", null)));
예제 #15
0
 public AppState GetAppState(string appId) =>
 (AppState)Convert.ToInt32(Execute(AppiumDriverCommand.GetAppState,
                                   AppiumCommandExecutionHelper.PrepareArgument("appId", appId)).Value.ToString());
예제 #16
0
 public void PushFile(string pathOnDevice, string stringData) => AppiumCommandExecutionHelper.PushFile(this,
                                                                                                       pathOnDevice, Convert.FromBase64String(Convert.ToBase64String(Encoding.UTF8.GetBytes(stringData))));
예제 #17
0
 /// <summary>
 /// Hides the device keyboard.
 /// </summary>
 public void HideKeyboard()
 => AppiumCommandExecutionHelper.HideKeyboard(this, null, null);
예제 #18
0
 public void PushFile(string pathOnDevice, byte[] base64Data) =>
 AppiumCommandExecutionHelper.PushFile(this, pathOnDevice, base64Data);
예제 #19
0
 /// <summary>
 /// Activate the given IME on Device
 /// </summary>
 /// <param name="imeEngine">IME to activate</param>
 public void ActivateIMEEngine(string imeEngine) =>
 Execute(AppiumDriverCommand.ActivateEngine,
         AppiumCommandExecutionHelper.PrepareArgument("engine", imeEngine));
예제 #20
0
 public void PushFile(string pathOnDevice, FileInfo file) =>
 AppiumCommandExecutionHelper.PushFile(this, pathOnDevice, file);
예제 #21
0
        public string StopRecordingScreen(IScreenRecordingOptions options)
        {
            var parameters = AppiumCommandExecutionHelper.PrepareArgument("options", options.GetParameters());

            return(Execute(AppiumDriverCommand.StopRecordingScreen, parameters).Value.ToString());
        }
예제 #22
0
 /// <summary>
 /// Whether or not the soft keyboard is shown.
 /// </summary>
 /// <returns>True if the keyboard is shown. (boolean)</returns>
 public bool IsKeyboardShown()
 => AppiumCommandExecutionHelper.IsKeyboardShown(executeMethod: this);