From 30dbc28131a53925dd8cb17f3ca3e84922f0cb3d Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 18 Apr 2018 14:02:16 +0300 Subject: Started working on UI automation testing! --- .../Visual_Studio/Tango.UnitTesting/App.config | 40 +++++++++++++++++++ Software/Visual_Studio/Tango.UnitTesting/Helper.cs | 9 +++++ .../Tango.UnitTesting/MachineStudio_TST.cs | 46 ++++++++++++++++++++++ .../Tango.UnitTesting/Tango.UnitTesting.csproj | 7 ++++ .../Tango.UnitTesting/packages.config | 2 + 5 files changed, 104 insertions(+) create mode 100644 Software/Visual_Studio/Tango.UnitTesting/MachineStudio_TST.cs (limited to 'Software/Visual_Studio/Tango.UnitTesting') diff --git a/Software/Visual_Studio/Tango.UnitTesting/App.config b/Software/Visual_Studio/Tango.UnitTesting/App.config index 80fd5e3fa..516b46de6 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/App.config +++ b/Software/Visual_Studio/Tango.UnitTesting/App.config @@ -23,6 +23,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.UnitTesting/Helper.cs b/Software/Visual_Studio/Tango.UnitTesting/Helper.cs index 7c0e639c5..8a4cd57e8 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Helper.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Helper.cs @@ -34,6 +34,15 @@ namespace Tango.UnitTesting return Path.GetFullPath(@"..\..\..\PMR\Messages\"); } + /// + /// Gets the machine studio exe path. + /// + /// + public static String GetMachineStudioPath() + { + return Path.GetFullPath(@"..\..\Build\Debug\Tango.MachineStudio.UI.exe"); + } + /// /// Gets the SQLite database file path in DB folder. /// diff --git a/Software/Visual_Studio/Tango.UnitTesting/MachineStudio_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/MachineStudio_TST.cs new file mode 100644 index 000000000..c56a177f8 --- /dev/null +++ b/Software/Visual_Studio/Tango.UnitTesting/MachineStudio_TST.cs @@ -0,0 +1,46 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using TestStack.White; +using TestStack.White.Factory; +using TestStack.White.UIItems; +using TestStack.White.UIItems.Finders; +using TestStack.White.UIItems.WindowItems; + +namespace Tango.UnitTesting +{ + [TestClass] + [TestCategory("Machine Studio")] + public class MachineStudio_TST + { + [TestMethod] + public void Login() + { + var app = Application.Launch(Helper.GetMachineStudioPath()); + + var window = app.GetWindow("Tango", InitializeOption.NoCache); + + window.WaitTill(() => window.Get