Created
December 10, 2023 20:51
-
-
Save Dor-bl/236313356202f810fd76a97a73b31b80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Appium.Net.Integration.Tests.helpers; | |
using NUnit.Framework; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Appium.Android; | |
using OpenQA.Selenium.Appium.Service; | |
namespace Appium.Net.Integration.Tests.Service | |
{ | |
[TestFixture] | |
class AppiumCommandExecutorTest | |
{ | |
private AndroidDriver _driver; | |
[OneTimeSetUp] | |
public void BeforeAll() | |
{ | |
var capabilities = Caps.GetAndroidUIAutomatorCaps(Apps.Get("androidApiDemos")); | |
var serverUri = Env.ServerIsRemote() ? AppiumServers.RemoteServerUri : AppiumServers.LocalServiceUri; | |
var clientConfig = AppiumClientConfig.DefaultConfig(); | |
var commandExecutor = new AppiumCommandExecutor(serverUri, Env.InitTimeoutSec, clientConfig); | |
_driver = new AndroidDriver(commandExecutor, capabilities); | |
_driver.Manage().Timeouts().ImplicitWait = Env.ImplicitTimeoutSec; | |
} | |
[OneTimeTearDown] | |
public void AfterAll() | |
{ | |
_driver?.Quit(); | |
if (!Env.ServerIsRemote()) | |
{ | |
AppiumServers.StopLocalService(); | |
} | |
} | |
[Test] | |
public void HideKeyBoardTestCase() | |
{ | |
_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(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment