diff options
author | Manish Sinha <manish.sinha@xamarin.com> | 2015-07-28 23:59:34 +0300 |
---|---|---|
committer | Manish Sinha <manish.sinha@xamarin.com> | 2015-07-29 00:00:23 +0300 |
commit | 14d5b800d1e6f797df943ce1afdd1ce552474601 (patch) | |
tree | 681b6d377f60354ab5a7d5a99e5d6a65250ef78c /main/tests/UserInterfaceTests/Controllers | |
parent | fa846d70ca506d8908de40760f91f0d613b797ff (diff) |
[UITest] Add the ability to add a new Project to existing solution
Diffstat (limited to 'main/tests/UserInterfaceTests/Controllers')
-rw-r--r-- | main/tests/UserInterfaceTests/Controllers/NewProjectController.cs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/main/tests/UserInterfaceTests/Controllers/NewProjectController.cs b/main/tests/UserInterfaceTests/Controllers/NewProjectController.cs index 7f5c165bc1..4ce0854926 100644 --- a/main/tests/UserInterfaceTests/Controllers/NewProjectController.cs +++ b/main/tests/UserInterfaceTests/Controllers/NewProjectController.cs @@ -45,6 +45,13 @@ namespace UserInterfaceTests Session.WaitForElement (c => c.Window ().Marked ("MonoDevelop.Ide.Projects.GtkNewProjectDialogBackend")); } + public void Open (string addToSolutionName) + { + Session.SelectElement (SolutionExplorerController.GetSolutionQuery (addToSolutionName)); + Session.ExecuteCommand (ProjectCommands.AddNewProject); + Session.WaitForElement (c => c.Window ().Marked ("New Project")); + } + public bool SelectTemplateType (string categoryRoot, string category) { return Session.SelectElement (c => c.TreeView ().Marked ("templateCategoriesTreeView").Model ("templateCategoriesListStore__Name").Contains (categoryRoot).NextSiblings ().Text (category)); @@ -80,9 +87,14 @@ namespace UserInterfaceTests return Session.EnterText (c => c.Textfield ().Marked ("projectNameTextBox"), projectName); } - public bool SetSolutionName (string solutionName) + public bool SetSolutionName (string solutionName, bool addToExistingSolution) { - return Session.EnterText (c => c.Textfield ().Marked ("solutionNameTextBox"), solutionName); + Func<AppQuery, AppQuery> solutionNameTextBox = c => c.Textfield ().Marked ("solutionNameTextBox"); + if (addToExistingSolution) { + return Session.Query (c => solutionNameTextBox (c).Sensitivity (false)).Length > 0 && + Session.Query (c => solutionNameTextBox (c).Text (solutionName)).Length > 0; + } + return Session.EnterText (solutionNameTextBox, solutionName); } public bool SetSolutionLocation (string solutionLocation) |