public void TestNewAzureProject() { using (var app = new VisualStudioApp()) { using (var newProjDialog = app.FileNewProject()) { newProjDialog.FocusLanguageNode("JavaScript"); var azureApp = newProjDialog.ProjectTypes.FindItem(NodejsVisualStudioApp.JavaScriptAzureWebAppTemplate); azureApp.Select(); newProjDialog.OK(); } // wait for new solution to load... for (int i = 0; i < 40 && app.Dte.Solution.Projects.Count == 0; i++) { System.Threading.Thread.Sleep(250); } app.SolutionExplorerTreeView.WaitForItem( "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)", app.Dte.Solution.Projects.Item(1).Name, "server.js" ); app.SolutionExplorerTreeView.WaitForItem( "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)", app.Dte.Solution.Projects.Item(1).Name, "Web.config" ); } }
internal static void CreateProject(VisualStudioApp app, string languageName, string templateName, string location, string projectName, string expectedProjectItem) { using (var newProjDialog = app.FileNewProject()) { newProjDialog.FocusLanguageNode(languageName); newProjDialog.Location = location; newProjDialog.ProjectName = projectName; var djangoApp = newProjDialog.ProjectTypes.FindItem(templateName); djangoApp.Select(); newProjDialog.OK(); } // wait for new solution to load... for (int i = 0; i < 40 && app.Dte.Solution.Projects.Count == 0; i++) { System.Threading.Thread.Sleep(250); } app.OpenSolutionExplorer().WaitForItem( "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)", app.Dte.Solution.Projects.Item(1).Name, expectedProjectItem ); }
public void DeferredSaveWithDot() { // http://pytools.codeplex.com/workitem/623 // enable deferred saving on projects using (var app = new VisualStudioApp()) { var props = app.Dte.get_Properties("Environment", "ProjectsAndSolution"); var prevValue = props.Item("SaveNewProjects").Value; props.Item("SaveNewProjects").Value = false; app.OnDispose(() => props.Item("SaveNewProjects").Value = prevValue); // now run the test var newProjDialog = app.FileNewProject(); newProjDialog.FocusLanguageNode("JavaScript"); var consoleApp = newProjDialog.ProjectTypes.FindItem("Blank Node.js Application"); consoleApp.Select(); newProjDialog.ProjectName = "Fob.Baz"; newProjDialog.ClickOK(); // wait for new solution to load... for (int i = 0; i < 100 && app.Dte.Solution.Projects.Count == 0; i++) { System.Threading.Thread.Sleep(1000); } TestUtils.DteExecuteCommandOnThreadPool("File.SaveAll"); var saveProjDialog = new SaveProjectDialog(app.WaitForDialog()); saveProjDialog.Save(); app.WaitForDialogDismissed(); var fullname = app.Dte.Solution.FullName; app.Dte.Solution.Close(false); Directory.Delete(Path.GetDirectoryName(fullname), true); } }
public void TestNewProject() { using (var app = new VisualStudioApp()) { using (var newProjDialog = app.FileNewProject()) { newProjDialog.FocusLanguageNode("JavaScript"); var nodejsApp = newProjDialog.ProjectTypes.FindItem("Basic Node.js Web Server (Windows Universal)"); nodejsApp.Select(); newProjDialog.OK(); } // wait for new solution to load... for (int i = 0; i < 40 && app.Dte.Solution.Projects.Count == 0; i++) { System.Threading.Thread.Sleep(250); } app.SolutionExplorerTreeView.WaitForItem( "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)", app.Dte.Solution.Projects.Item(1).Name, "server.js" ); } }
public void NewProject() { var app = new VisualStudioApp(VsIdeTestHostContext.Dte); var newProjDialog = app.FileNewProject(); var item = newProjDialog.InstalledTemplates.FindItem("Other Languages", "Python"); item.SetFocus(); var consoleApp = newProjDialog.ProjectTypes.FindItem("Python Application"); consoleApp.SetFocus(); newProjDialog.ClickOK(); // wait for new solution to load... for (int i = 0; i < 100 && app.Dte.Solution.Projects.Count == 0; i++) { System.Threading.Thread.Sleep(1000); } Assert.AreEqual(1, app.Dte.Solution.Projects.Count); Assert.AreNotEqual(null, app.Dte.Solution.Projects.Item(1).ProjectItems.Item("Program.py")); }
public void TestNewProject() { using (var app = new VisualStudioApp()) { using (var newProjDialog = app.FileNewProject()) { newProjDialog.FocusLanguageNode("JavaScript"); var nodejsApp = newProjDialog.ProjectTypes.FindItem("Basic Node.js Web Server (Universal Windows)"); nodejsApp.Select(); newProjDialog.OK(); } // wait for new solution to load... for (int i = 0; i < 40 && app.Dte.Solution.Projects.Count == 0; i++) { System.Threading.Thread.Sleep(250); } app.SolutionExplorerTreeView.WaitForItem( "Solution '" + app.Dte.Solution.Projects.Item(1).Name + "' (1 project)", app.Dte.Solution.Projects.Item(1).Name, "server.js" ); } }
public static NewProjectDialog FromDte(VisualStudioApp app) { return app.FileNewProject(); }
public static NewProjectDialog FromDte(VisualStudioApp app) { return(app.FileNewProject()); }