diff options
author | Manish Sinha <manish.sinha@xamarin.com> | 2015-07-27 23:56:01 +0300 |
---|---|---|
committer | Manish Sinha <manish.sinha@xamarin.com> | 2015-07-27 23:56:01 +0300 |
commit | 4115da59c804d2c6c5637faef28389cca781799a (patch) | |
tree | 95d5933a8bc8ddeb38ca7d570dbed98242fa37af /main/tests/UserInterfaceTests/Controllers | |
parent | 3d31f4e4064fe7c2d3a9ef0158be7fa09a604a1d (diff) |
[UITest] Add ProjectOptionsController to wrap Project/Solution Options
Diffstat (limited to 'main/tests/UserInterfaceTests/Controllers')
-rw-r--r-- | main/tests/UserInterfaceTests/Controllers/ProjectOptionsController.cs | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/main/tests/UserInterfaceTests/Controllers/ProjectOptionsController.cs b/main/tests/UserInterfaceTests/Controllers/ProjectOptionsController.cs new file mode 100644 index 0000000000..5b66fa37bf --- /dev/null +++ b/main/tests/UserInterfaceTests/Controllers/ProjectOptionsController.cs @@ -0,0 +1,75 @@ +// +// ProjectOptionsController.cs +// +// Author: +// Manish Sinha <manish.sinha@xamarin.com> +// +// Copyright (c) 2015 Xamarin Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using MonoDevelop.Components.AutoTest; +using MonoDevelop.Ide.Commands; + +namespace UserInterfaceTests +{ + public class ProjectOptionsController + { + static AutoTestClientSession Session { + get { return TestService.Session; } + } + + Action<string> takeScreenshot; + + public ProjectOptionsController (Action<string> takeScreenshot = null) + { + this.takeScreenshot = takeScreenshot ?? delegate { }; + } + + public void OpenProjectOptions () + { + Session.Query (IdeQuery.TextArea); + Session.ExecuteCommand (ProjectCommands.ProjectOptions); + Session.WaitForElement (c => c.Window ().Marked ("MonoDevelop.Ide.Projects.ProjectOptionsDialog")); + takeScreenshot ("Opened-ProjectOptionsDialog"); + } + + public void OpenSolutionOptions () + { + throw new NotImplementedException (); + } + + public void SelectPane (string name) + { + Session.SelectElement (c => c.Window ().Marked ("MonoDevelop.Ide.Projects.ProjectOptionsDialog").Children ().Marked ( + "__gtksharp_16_MonoDevelop_Components_HeaderBox").Children ().TreeView ().Model ().Children ().Property ("Label", name)); + } + + public void ClickOK () + { + Session.ClickElement (c => c.Window ().Marked ("MonoDevelop.Ide.Projects.ProjectOptionsDialog").Children ().Button ().Text ("OK")); + } + + public void ClickCancel () + { + Session.ClickElement (c => c.Window ().Marked ("MonoDevelop.Ide.Projects.ProjectOptionsDialog").Children ().Button ().Text ("Cancel")); + } + } +} + |