Skip to content

Commit 4d62709

Browse files
Merge pull request #75 from TikhomirovSergey/#73-fix
#73 fix
2 parents df8c386 + cfb4881 commit 4d62709

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

appium-dotnet-driver/Appium/AppiumDriver.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,9 @@ protected void HideKeyboard(string strategy = null, string key = null)
320320
/// <summary>
321321
/// Hides the device keyboard.
322322
/// </summary>
323-
/// <param name="keyName">The button pressed by the mobile driver to attempt hiding the keyboard.</param>
324323
public void HideKeyboard()
325324
{
326-
this.HideKeyboard();
325+
this.HideKeyboard(null, null);
327326
}
328327

329328
#endregion MJsonMethod Members

samples/AndroidComplexTest.cs

+8
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ public void DrawSmileyTestCase ()
212212
Thread.Sleep (1000);
213213
driver.GetScreenshot();
214214
}
215+
216+
[Test()]
217+
public void HideKeyBoardTestCase()
218+
{
219+
((AndroidDriver)driver).StartActivity("io.appium.android.apis", ".app.CustomTitle");
220+
driver.FindElement(By.Id("io.appium.android.apis:id/left_text_edit")).Clear();
221+
driver.HideKeyboard();
222+
}
215223
}
216224
}
217225

samples/IosComplexTest.cs

+14
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using OpenQA.Selenium.Appium.MultiTouch;
1212
using System.Collections.ObjectModel;
1313
using OpenQA.Selenium.Appium.iOS;
14+
using OpenQA.Selenium.Appium.iOS.Enums;
1415

1516
namespace Appium.Samples
1617
{
@@ -189,5 +190,18 @@ public void SourceTestCase ()
189190
Assert.AreNotEqual (textFieldSectionSource, mainMenuSource);
190191
}
191192

193+
[Test()]
194+
public void HideKeyBoardTestCase()
195+
{
196+
ClickMenuItem("Text Fields, AAPLTextFieldViewController");
197+
IWebElement e = driver.FindElementByAccessibilityId("DEFAULT");
198+
e.Click();
199+
driver.HideKeyboard();
200+
e.Click();
201+
((IOSDriver) driver).HideKeyboard("Done");
202+
e.Click();
203+
((IOSDriver)driver).HideKeyboard("Done", HideKeyboardStrategy.Tap_outside);
204+
}
205+
192206
}
193207
}

0 commit comments

Comments
 (0)