From 85e400ca2def4d0464e522defa068c1d432f1032 Mon Sep 17 00:00:00 2001 From: Dor Blayzer <59066376+Dor-bl@users.noreply.github.com> Date: Mon, 28 Oct 2024 07:53:21 +0200 Subject: [PATCH] Move Keys tests to correct folder (#860) Add missing tests for HideKeyboardWithStrategyAndKey --- .../Android/Device/{ => Keys}/KeyPressTest.cs | 0 .../Android/Device/{ => Keys}/KeyboardTests.cs | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) rename test/integration/Android/Device/{ => Keys}/KeyPressTest.cs (100%) rename test/integration/Android/Device/{ => Keys}/KeyboardTests.cs (74%) diff --git a/test/integration/Android/Device/KeyPressTest.cs b/test/integration/Android/Device/Keys/KeyPressTest.cs similarity index 100% rename from test/integration/Android/Device/KeyPressTest.cs rename to test/integration/Android/Device/Keys/KeyPressTest.cs diff --git a/test/integration/Android/Device/KeyboardTests.cs b/test/integration/Android/Device/Keys/KeyboardTests.cs similarity index 74% rename from test/integration/Android/Device/KeyboardTests.cs rename to test/integration/Android/Device/Keys/KeyboardTests.cs index 6eea118d..d799907a 100644 --- a/test/integration/Android/Device/KeyboardTests.cs +++ b/test/integration/Android/Device/Keys/KeyboardTests.cs @@ -63,5 +63,21 @@ public void HideKeyBoardWithKeyTestCase() Assert.That(!is_visible); } + + [TestCase("press", "Done", TestName = "HideKeyboardWithStrategyPressAndKeyDone")] + [TestCase("swipeDown", null, TestName = "HideKeyboardWithStrategySwipeDownAndNoKey")] + [TestCase("tapOut", "Hide", TestName = "HideKeyboardWithStrategyTapOutAndKeyHide")] + public void HideKeyboardWithStrategyAndKeyTestCase(string strategy, string key) + { + + _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(strategy, key); + bool is_visible = _driver.IsKeyboardShown(); + Assert.That(!is_visible); + } + } } \ No newline at end of file