public void CreateProject(TemplateSelectionOptions templateOptions,
                                  ProjectDetails projectDetails, GitOptions gitOptions = null, object miscOptions = null)
        {
            var newProject = new NewProjectController();

            if (projectDetails.AddProjectToExistingSolution)
            {
                newProject.Open(projectDetails.SolutionName);
            }
            else
            {
                newProject.Open();
            }
            TakeScreenShot("Open");

            OnSelectTemplate(newProject, templateOptions);

            OnEnterTemplateSpecificOptions(newProject, projectDetails.ProjectName, miscOptions);

            OnEnterProjectDetails(newProject, projectDetails, gitOptions, miscOptions);

            OnClickCreate(newProject, projectDetails);

            FoldersToClean.Add(projectDetails.SolutionLocation);
        }
示例#2
0
 ProjectDetails CreateProject(TemplateSelectionOptions templateOptions = null, ProjectDetails projectDetails = null)
 {
     templateOptions = templateOptions ?? new TemplateSelectionOptions {
         CategoryRoot     = OtherCategoryRoot,
         Category         = ".NET",
         TemplateKindRoot = GeneralKindRoot,
         TemplateKind     = "Console Project"
     };
     projectDetails = projectDetails ?? new ProjectDetails(templateOptions);
     CreateProject(templateOptions,
                   projectDetails,
                   new GitOptions {
         UseGit = true, UseGitIgnore = true
     });
     Session.WaitForElement(IdeQuery.TextArea);
     FoldersToClean.Add(projectDetails.SolutionLocation);
     return(projectDetails);
 }
示例#3
0
        public override bool Execute()
        {
            // TODO: Add support for wildcards in directories.

            List <ITaskItem> filesDeleted = new List <ITaskItem>();

            foreach (string directory in FoldersToClean.Split(';'))
            {
                if (!Directory.Exists(directory))
                {
                    continue;
                }

                deleteFilesOnDir(filesDeleted, directory);
            }

            DeletedFiles = filesDeleted.ToArray();

            return(true);
        }
示例#4
0
        public void CreateBuildProject(TemplateSelectionOptions templateOptions, ProjectDetails projectDetails,
                                       Action beforeBuild, GitOptions gitOptions = null, object miscOptions = null)
        {
            try {
                CreateProject(templateOptions, projectDetails, gitOptions, miscOptions);

                try {
                    beforeBuild();
                    TakeScreenShot("BeforeBuild");
                } catch (TimeoutException e) {
                    TakeScreenShot("BeforeBuildActionFailed");
                    Assert.Fail(e.ToString());
                }
                OnBuildTemplate((int)projectDetails.BuildTimeout.TotalSeconds);
            } catch (Exception e) {
                TakeScreenShot("TestFailedWithGenericException");
                Assert.Fail(e.ToString());
            } finally {
                FoldersToClean.Add(projectDetails.SolutionLocation);
            }
        }
示例#5
0
        protected void TestClone(string repoUrl, string cloneToLocation = null, VersionControlType cvsType = VersionControlType.Git, int cloneTimeoutSecs = 180)
        {
            var checkoutFolder = CheckoutOrClone(repoUrl, cloneToLocation, cvsType, cloneTimeoutSecs);

            FoldersToClean.Add(checkoutFolder);
        }