English description | Описание на русском
Winium.Cruciatus is an open source C# Framework for automated testing of Windows application based on WinFroms and WPF platforms.
Winium.Cruciatus is a wrapper over Microsoft UI Automation library in the System.Windows.Automation namespace.
Add reference to Winium.Cruciatus
in UI test project (install NuGet package)
Create a map application
Use created map in tests
Run your tests and watch the magic happening
Add reference to Winium.Cruciatus
in UI test project (install NuGet package)
Create C# Console Application project and use this code:
namespace ConsoleApplication
{
using System.Windows.Automation;
using Winium.Cruciatus.Core;
using Winium.Cruciatus.Extensions;
public class Program
{
private static void Main(string[] args)
{
var calc = new Winium.Cruciatus.Application("C:/windows/system32/calc.exe");
calc.Start();
var winFinder = By.Name("Calculator").AndType(ControlType.Window);
var win = Winium.Cruciatus.CruciatusFactory.Root.FindElement(winFinder);
var menu = win.FindElementByUid("MenuBar").ToMenu();
menu.SelectItem("View$Scientific");
menu.SelectItem("View$History");
win.FindElementByUid("132").Click(); // 2
win.FindElementByUid("93").Click(); // +
win.FindElementByUid("134").Click(); // 4
win.FindElementByUid("97").Click(); // ^
win.FindElementByUid("138").Click(); // 8
win.FindElementByUid("121").Click(); // =
calc.Close();
}
}
}
Run ConsoleApplication and watch the magic happening
Contributions are welcome!
Have some questions? Found a bug? Create new issue or contact us at g.golovin@2gis.ru
Winium is released under the MPL 2.0 license. See LICENSE for details.