Пример #1
0
        public void CreateNewProject(AccountData account, ProjectData projectData)
        {
            Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
            Mantis.ProjectData project = new Mantis.ProjectData();

            project.name      = projectData.Name;
            project.status    = new Mantis.ObjectRef();
            project.status.id = projectData.Status;
            if (projectData.InheritGlobal == "1")
            {
                project.inherit_global = true;
            }
            else
            {
                project.inherit_global = false;
            }
            project.view_state    = new Mantis.ObjectRef();
            project.view_state.id = projectData.ViewState;
            project.description   = projectData.Description;

            client.mc_project_add(account.Username, account.Password, project);

            driver.Navigate().Refresh();
        }
Пример #2
0
        public void ProjectRemovalTest()
        {
            if (app.Projects.GetProjectsCount() == 0)
            {
                ProjectData project = new ProjectData("ProjectToRemove");
                app.Projects.Create(project);
            }

            List <ProjectData> oldProjects = ProjectData.GetAll();
            ProjectData        toBeRemoved = oldProjects[0];

            app.Projects.Remove(toBeRemoved);

            Assert.AreEqual(oldProjects.Count - 1, app.Projects.GetProjectsCount());

            List <ProjectData> newProjects = ProjectData.GetAll();

            oldProjects.Remove(toBeRemoved);
            Assert.AreEqual(oldProjects, newProjects);
            foreach (ProjectData project in newProjects)
            {
                Assert.AreNotEqual(project.Id, toBeRemoved.Id);
            }
        }
Пример #3
0
        public void TestDeleteProject()
        {
            AccountData account = new AccountData()
            {
                Name     = "administrator",
                Password = "******"
            };

            ProjectData project = new ProjectData()
            {
                Name        = "second",
                Status      = "stable",
                Description = "my"
            };

            List <ProjectData> oldProjectTable = new List <ProjectData>();

            oldProjectTable = app.API.ListFromTable(account);

            if (!app.API.DeleteProjectFromTable(account, project))
            {
                app.API.CreateNewProject(account, project);
                oldProjectTable.Add(project);
            }

            app.API.DeleteProjectFromTable(account, project);

            List <ProjectData> newProjectTable = new List <ProjectData>();

            newProjectTable = app.API.ListFromTable(account);

            oldProjectTable.Remove(project);
            oldProjectTable.Sort();
            newProjectTable.Sort();
            Assert.AreEqual(oldProjectTable, newProjectTable);
        }
 public ProjectManagementHelper FillField(ProjectData projectData)
 {
     Type(By.Name("name"), projectData.Pjdata_name);
     Type(By.Name("description"), projectData.Pjdata_desc);
     return(this);
 }
Пример #5
0
        public void TestProjectRemoving()
        {
            /*
             * int i = 3;
             * List<ProjectData> oldprojects = new List<ProjectData>();
             * oldprojects = app.Project.GetProjectList();
             *
             * while (oldprojects.Count <= i)
             * {
             *  ProjectData project = new ProjectData
             *  {
             *      Name = "projectForDelete " + oldprojects.Count.ToString(),
             *      Description = "forRemovingTest"
             *  };
             *
             *  app.Project.AddProject(project);
             *  oldprojects = app.Project.GetProjectList();
             * }
             *
             * ProjectData removedProject = oldprojects[i];
             *
             * app.Project.RemoveProject(i);
             *
             * oldprojects.Remove(removedProject);
             * List<ProjectData> newprojects = app.Project.GetProjectList();
             *
             * oldprojects.Sort();
             * newprojects.Sort();
             * Assert.AreEqual(oldprojects, newprojects);
             */

            AccountData admin = new AccountData
            {
                Name     = "administrator",
                Password = "******"
            };

            int i = 3;

            List <ProjectData> oldprojects = new List <ProjectData>();

            oldprojects = app.API.APIGetProjectList(admin);

            while (oldprojects.Count <= i)
            {
                ProjectData project = new ProjectData
                {
                    Name        = "projectForDelete " + oldprojects.Count.ToString(),
                    Description = "forRemovingTest"
                };

                app.Project.AddProject(project);
                oldprojects = app.Project.GetProjectList();
            }

            ProjectData removedProject = oldprojects[i];

            app.Project.RemoveProject(i);

            oldprojects.Remove(removedProject);
            List <ProjectData> newprojects = app.API.APIGetProjectList(admin);

            oldprojects.Sort();
            newprojects.Sort();
            Assert.AreEqual(oldprojects, newprojects);
        }
Пример #6
0
 private void FillCreationForm(ProjectData project)
 {
     Type(By.Id("project-name"), project.Name);
 }
 public int AddProjectToDb(ProjectData project)
 {
     return(project.AddProject(project).GetValueOrDefault());
 }
Пример #8
0
 public void RemoveProject(ProjectData project)
 {
     manager.Navigate.OpenProjectEditPage(project);
     driver.FindElement(By.CssSelector("input.btn.btn-primary.btn-sm.btn-white.btn-round")).Click();
     driver.FindElement(By.CssSelector("input.btn.btn-primary.btn-white.btn-round")).Click();
 }
Пример #9
0
 public void FillProjectData(ProjectData project)
 {
     Tipe(By.Id("project-name"), project.Name);
     Tipe(By.Id("project-description"), project.Description);
 }
Пример #10
0
 public void SelectProgect(ProjectData proj)
 {
     GotoProjectPage();
     driver.FindElement(By.XPath(@"//tr/td/a[contains(text(), '" + proj.Name + "')]")).Click();
 }
Пример #11
0
 public void CreateProject(ProjectData project)
 {
     FindByCss("fieldset > button[type='submit']");
     Type(By.Name("name"), project.Name);
     FindByCss("input[value='Добавить проект']");
 }
Пример #12
0
 public void SelectProject(ProjectData project)
 {
     driver.FindElement(By.XPath("//a[@href='manage_proj_edit_page.php?project_id=" + project.Id + "']")).Click();
 }
 public ProjectManagementHelper FillProjectForm(ProjectData project)
 {
     Type(By.Name("name"), project.Name);
     return(this);
 }
Пример #14
0
 public ProjectHelper FillProjectForm(ProjectData project)
 {
     driver.FindElement(By.Name("name")).SendKeys(project.Name);
     driver.FindElement(By.Name("description")).SendKeys(project.Description);
     return(this);
 }
Пример #15
0
 private void FillProjectModification(ProjectData project)
 {
     driver.FindElement(By.Id("project-name")).Click();
     driver.FindElement(By.Id("project-name")).Clear();
     driver.FindElement(By.Id("project-name")).SendKeys(project.Name);
 }
Пример #16
0
 public void RemoveProject(ProjectData project1)
 {
     Mantis_tests.Mantis.MantisConnectPortTypeClient client = new Mantis_tests.Mantis.MantisConnectPortTypeClient();
     client.mc_project_delete("administrator", "root", project1.Id);
 }
Пример #17
0
 private void FillProjectRegistrtionForm(ProjectData project)
 {
     driver.FindElement(By.Name("name")).SendKeys(project.Name);
     driver.FindElement(By.Name("description")).SendKeys(project.Description);
 }
Пример #18
0
 public void FillProjectCreationForm(ProjectData project)
 {
     Type(By.Name("name"), project.Name);
     Type(By.Name("description"), project.Description);
 }
 public void Remove(ProjectData projectData)
 {
     SelectProject(projectData.Id);
     RemoveProject();
     SubmitProjectRemoval();
 }
Пример #20
0
 private void FillNewProjectForm(ProjectData project)
 {
     Type(By.Id("project-name"), project.Name);
 }
Пример #21
0
 public void FillProjectForm(ProjectData project)
 {
     driver.FindElement(By.Name("name")).SendKeys(project.Name);
     driver.FindElement(By.Name("description")).SendKeys(project.Description);
 }
Пример #22
0
 public void Delete(ProjectData project)
 {
     manager.Navigator.GoToProjPage();
     OpenProjectForm(project.Name);
     DeleteProject();
 }
Пример #23
0
 public void Remove(ProjectData projectForRemove)
 {
     OpenProject(projectForRemove);
     Remove();
     Submit();
 }
Пример #24
0
 public void RemoveProject(AccountData account, ProjectData project)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     client.mc_project_delete(account.Name, account.Password, project.Id);
 }
Пример #25
0
 public void FillNewProjectForm(ProjectData project)
 {
     driver.FindElement(By.Name("name")).SendKeys(project.Name);
     //driver.FindElement(By.Name("description")).SendKeys(project.Description);
     driver.FindElement(By.CssSelector("input.btn.btn-primary.btn-white.btn-round")).Click();
 }
        public bool EnsureThereHasProject()
        {
            List <ProjectData> projects = ProjectData.GetAll();

            return(projects.Count != 0);
        }
 private void FillProjectData(ProjectData project)
 {
     Driver.FindElement(By.Id("project-name")).SendKeys(project.Name);
     Driver.FindElement(By.Id("project-description")).SendKeys(project.Description);
 }
Пример #28
0
 public void DeleteProject(AccountData account, ProjectData projectData)
 {
     Mantis.MantisConnectPortTypeClient client = new Mantis.MantisConnectPortTypeClient();
     Mantis.ProjectData project = new Mantis.ProjectData();
     project.name = projectData.Name;
 }
Пример #29
0
 private void FillProjectForm(ProjectData project)
 {
     driver.FindElement(By.Name("name")).SendKeys(project.Name);
 }
Пример #30
0
 public void CreateNewProject(ProjectData project)
 {
     driver.FindElement(By.XPath("//button[contains(text(),'Create New Project')]")).Click();
     Type(By.Name("name"), project.Name);
     driver.FindElement(By.XPath("//input[@value='Add Project']")).Click();
 }