protected virtual void OnEnterProjectDetails(NewProjectController newProject, ProjectDetails projectDetails,
                                                     GitOptions gitOptions = null, object miscOptions = null)
        {
            if (!newProject.SetProjectName(projectDetails.ProjectName))
            {
                throw new CreateProjectException(string.Format("Failed at entering ProjectName as '{0}'", projectDetails.ProjectName));
            }

            if (!string.IsNullOrEmpty(projectDetails.SolutionName))
            {
                if (!newProject.SetSolutionName(projectDetails.SolutionName, projectDetails.AddProjectToExistingSolution))
                {
                    throw new CreateProjectException(string.Format("Failed at entering SolutionName as '{0}'", projectDetails.SolutionName));
                }
            }

            if (!string.IsNullOrEmpty(projectDetails.SolutionLocation))
            {
                if (!newProject.SetSolutionLocation(projectDetails.SolutionLocation))
                {
                    throw new CreateProjectException(string.Format("Failed at entering SolutionLocation as '{0}'", projectDetails.SolutionLocation));
                }
            }

            if (!newProject.CreateProjectInSolutionDirectory(projectDetails.ProjectInSolution))
            {
                throw new CreateProjectException(string.Format("Failed at entering ProjectInSolution as '{0}'", projectDetails.ProjectInSolution));
            }

            if (gitOptions != null && !projectDetails.AddProjectToExistingSolution)
            {
                if (!newProject.UseGit(gitOptions))
                {
                    throw new CreateProjectException(string.Format("Failed at setting Git as - '{0}'", gitOptions));
                }
            }

            TakeScreenShot("AfterProjectDetailsFilled");
        }
示例#2
0
        public void CreateBuildProject(string projectName, string categoryRoot, string category, string kindRoot, string kind, Action beforeBuild)
        {
            var    solutionParentDirectory = Util.CreateTmpDir(projectName);
            string actualSolutionDirectory = string.Empty;

            try {
                var newProject = new NewProjectController();
                newProject.Open();

                SelectTemplate(newProject, categoryRoot, category, kindRoot, kind);

                Assert.IsTrue(newProject.Next());

                // Wait until the next page is displayed
                Session.WaitForElement(c => c.Textfield().Marked("solutionNameTextBox"));

                EnterProjectDetails(newProject, projectName, projectName, solutionParentDirectory);

                Assert.IsTrue(newProject.CreateProjectInSolutionDirectory(false));
                Assert.IsTrue(newProject.UseGit(true, false));

                Session.RunAndWaitForTimer(() => newProject.Next(), "Ide.Shell.SolutionOpened");

                actualSolutionDirectory = GetSolutionDirectory();

                beforeBuild();

                Assert.IsTrue(Ide.BuildSolution());
            } finally {
                Ide.CloseAll();
                try {
                    if (Directory.Exists(actualSolutionDirectory))
                    {
                        Directory.Delete(actualSolutionDirectory, true);
                    }
                } catch (IOException) { }
            }
        }
示例#3
0
        protected virtual void OnEnterProjectDetails(NewProjectController newProject, ProjectDetails projectDetails,
                                                     GitOptions gitOptions = null, object miscOptions = null)
        {
            Assert.IsTrue(newProject.SetProjectName(projectDetails.ProjectName));

            if (!string.IsNullOrEmpty(projectDetails.SolutionName))
            {
                Assert.IsTrue(newProject.SetSolutionName(projectDetails.SolutionName));
            }

            if (!string.IsNullOrEmpty(projectDetails.SolutionLocation))
            {
                Assert.IsTrue(newProject.SetSolutionLocation(projectDetails.SolutionLocation));
            }

            Assert.IsTrue(newProject.CreateProjectInSolutionDirectory(projectDetails.ProjectInSolution));

            if (gitOptions != null)
            {
                Assert.IsTrue(newProject.UseGit(gitOptions));
            }

            TakeScreenShot("AfterProjectDetailsFilled");
        }
		protected virtual void OnEnterProjectDetails (NewProjectController newProject, ProjectDetails projectDetails,
			GitOptions gitOptions = null, object miscOptions = null)
		{
			if (!newProject.SetProjectName (projectDetails.ProjectName, projectDetails.AddProjectToExistingSolution)) {
				throw new CreateProjectException (string.Format ("Failed at entering ProjectName as '{0}'", projectDetails.ProjectName));
			}

			if (!string.IsNullOrEmpty (projectDetails.SolutionName)) {
				if (!newProject.SetSolutionName (projectDetails.SolutionName, projectDetails.AddProjectToExistingSolution)) {
					throw new CreateProjectException (string.Format ("Failed at entering SolutionName as '{0}'", projectDetails.SolutionName));
				}
			}

			if (!string.IsNullOrEmpty (projectDetails.SolutionLocation)) {
				if (!newProject.SetSolutionLocation (projectDetails.SolutionLocation)) {
					throw new CreateProjectException (string.Format ("Failed at entering SolutionLocation as '{0}'", projectDetails.SolutionLocation));
				}
			}

			if (!newProject.CreateProjectInSolutionDirectory (projectDetails.ProjectInSolution)) {
				throw new CreateProjectException (string.Format ("Failed at entering ProjectInSolution as '{0}'", projectDetails.ProjectInSolution));
			}

			if (gitOptions != null && !projectDetails.AddProjectToExistingSolution) {
				if (!newProject.UseGit (gitOptions)) {
					throw new CreateProjectException (string.Format ("Failed at setting Git as - '{0}'", gitOptions));
				}
			}

			TakeScreenShot ("AfterProjectDetailsFilled");
		}
		protected virtual void OnEnterProjectDetails (NewProjectController newProject, ProjectDetails projectDetails,
			GitOptions gitOptions = null, object miscOptions = null)
		{
			Assert.IsTrue (newProject.SetProjectName (projectDetails.ProjectName));

			if (!string.IsNullOrEmpty (projectDetails.SolutionName)) {
				Assert.IsTrue (newProject.SetSolutionName (projectDetails.SolutionName));
			}

			if (!string.IsNullOrEmpty (projectDetails.SolutionLocation)) {
				Assert.IsTrue (newProject.SetSolutionLocation (projectDetails.SolutionLocation));
			}

			Assert.IsTrue (newProject.CreateProjectInSolutionDirectory (projectDetails.ProjectInSolution));

			if (gitOptions != null)
				Assert.IsTrue (newProject.UseGit (gitOptions));

			TakeScreenShot ("AfterProjectDetailsFilled");
		}