From 6af50f4ba3b53ef1be9f58ec865b7f2952354d05 Mon Sep 17 00:00:00 2001 From: Dor-bl Date: Sat, 30 Mar 2024 19:00:47 +0300 Subject: [PATCH 1/2] test: Add a test for HideKeyboard(string key) method --- test/integration/Android/Device/KeyboardTests.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/integration/Android/Device/KeyboardTests.cs b/test/integration/Android/Device/KeyboardTests.cs index 0de1f999..a18ac97e 100644 --- a/test/integration/Android/Device/KeyboardTests.cs +++ b/test/integration/Android/Device/KeyboardTests.cs @@ -50,5 +50,18 @@ public void IsKeyBoardShownTestCase() bool keyboard_bool = _driver.IsKeyboardShown(); Assert.That(keyboard_bool); } + + [Test] + public void HideKeyBoardWithKeyTestCase() + { + _driver.StartActivity("io.appium.android.apis", ".app.CustomTitle"); + var text_edit_btn = By.Id("io.appium.android.apis:id/left_text_edit"); + _driver.FindElement(text_edit_btn).Clear(); + _driver.FindElement(text_edit_btn).Click(); + _driver.HideKeyboard("Enter"); + bool keyboard_bool = _driver.IsKeyboardShown(); + Assert.That(!keyboard_bool); + } + } } \ No newline at end of file From c4f5749525c150a0a982e485c130a592e8e7501e Mon Sep 17 00:00:00 2001 From: Dor-bl Date: Sun, 31 Mar 2024 07:10:27 +0300 Subject: [PATCH 2/2] fix: update bool naming --- test/integration/Android/Device/KeyboardTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/Android/Device/KeyboardTests.cs b/test/integration/Android/Device/KeyboardTests.cs index a18ac97e..6eea118d 100644 --- a/test/integration/Android/Device/KeyboardTests.cs +++ b/test/integration/Android/Device/KeyboardTests.cs @@ -47,8 +47,8 @@ public void IsKeyBoardShownTestCase() var text_edit_btn = By.Id("io.appium.android.apis:id/left_text_edit"); _driver.FindElement(text_edit_btn).Clear(); _driver.FindElement(text_edit_btn).Click(); - bool keyboard_bool = _driver.IsKeyboardShown(); - Assert.That(keyboard_bool); + bool is_visible = _driver.IsKeyboardShown(); + Assert.That(is_visible); } [Test] @@ -59,8 +59,8 @@ public void HideKeyBoardWithKeyTestCase() _driver.FindElement(text_edit_btn).Clear(); _driver.FindElement(text_edit_btn).Click(); _driver.HideKeyboard("Enter"); - bool keyboard_bool = _driver.IsKeyboardShown(); - Assert.That(!keyboard_bool); + bool is_visible = _driver.IsKeyboardShown(); + Assert.That(!is_visible); } }