/Winium.Cruciatus

C# Framework for automated testing of Windows application based on WinFroms and WPF platforms.

Primary LanguageC#Mozilla Public License 2.0MPL-2.0

English description | Описание на русском

Winium for Desktop

Build Status Inner Server NuGet downloads Inner Server NuGet version

Winium.Cruciatus is C# Framework for automated testing of Windows application based on WinFroms and WPF platforms

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.

Why Winium.Cruciatus?

  • Enough Visual Studio Professional offering
  • You can use any testing framework to write tests (example NUnit)

Quick Start

  1. Add reference to Winium.Cruciatus in UI test project (install NuGet package)

  2. Create a map application

  3. Use created map in tests

  4. Run your tests and watch the magic happening

Example

Very Quick Start

  1. Add reference to Winium.Cruciatus in UI test project (install NuGet package)

  2. 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();
            }
        }
    }
  3. Run ConsoleApplication and watch the magic happening

Contributing

Contributions are welcome!

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
  2. Fork the repository to start making your changes to the master branch (or branch off of it).
  3. We recommend to write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and bug the maintainer until it gets merged and published. 😃

Contact

Have some questions? Found a bug? Create new issue or contact us at g.golovin@2gis.ru

License

Winium is released under the MPL 2.0 license. See LICENSE for details.