Created
December 2, 2016 13:14
-
-
Save ianceicys/90ba61ede2008b5f6a05af5224ca090c 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 System; | |
using OpenQA.Selenium.Remote; | |
using OpenQA.Selenium.Appium.iOS; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace WPFNotepadTest | |
{ | |
[TestClass] | |
public class Scenario | |
{ | |
protected const string AppDriverUrl = "http://127.0.0.1:4723"; | |
protected const string WpfNotepadAppId = @"C:\dev\wpfnotepad.exe"; //copy and build binary from source https://codeoverload.wordpress.com/2010/05/01/wpf-notepad/ | |
protected const string ExplorerAppId = @"wpfnotepad.exe"; | |
protected const string TargetSaveLocation = @"%TEMP%\"; | |
protected static IOSDriver<IOSElement> WpfnotepadSession; | |
[ClassInitialize] | |
public static void Setup(TestContext context) | |
{ | |
// Launch Word Classic Windows Application | |
DesiredCapabilities appCapabilities = new DesiredCapabilities(); | |
appCapabilities.SetCapability("app", WpfNotepadAppId); | |
WpfnotepadSession = new IOSDriver<IOSElement>(new Uri(AppDriverUrl), appCapabilities); | |
Assert.IsNotNull(WpfnotepadSession); | |
} | |
[TestMethod] | |
public void BasicScenario() | |
{ | |
WpfnotepadSession.FindElementByName("File").Click(); | |
WpfnotepadSession.FindElementByName("New").Click(); | |
var editBox = WpfnotepadSession.FindElementByClassName("TextBox"); | |
editBox.SendKeys("Hello WPF Notepad"); | |
Assert.AreEqual("Hello WPF Notepad", editBox.Text); | |
WpfnotepadSession.Quit(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment