Esempio n. 1
0
        public void DeleteProject()
        {
            AccountData account = new AccountData()
            {
                Name     = "administrator",
                Password = "******"
            };

            bool projectExists = appmanager.API.GetProjectsList(account).Any();

            if (!projectExists)
            {
                appmanager.API.CreateProject(account);
            }

            AddData add = new AddData("Project Test");

            add.Description = "Description Test";

            appmanager.Project.CreateProjectIfAbsent(add);

            List <AddData> oldProjects = appmanager.API.GetProjectsList(account);

            appmanager.Project.Remove(0);

            List <AddData> newProjects = appmanager.API.GetProjectsList(account);

            oldProjects.RemoveAt(0);
            oldProjects.Sort();
            newProjects.Sort();
            Assert.AreEqual(oldProjects, newProjects);
        }
 public void Create(AddData add)
 {
     manager.Menu.GoToProjectManagement();
     driver.FindElement(By.XPath("//form[@action ='manage_proj_create_page.php']")).Click();
     Type(By.Name("name"), add.ProjectName);
     Type(By.Name("description"), add.Description);
     driver.FindElement(By.XPath("//input[@type='submit']")).Click();
 }
 public ProjectManagementHelper CreateProjectIfAbsent(AddData add)
 {
     if (IfProjectPresent())
     {
         return(this);
     }
     Create(add);
     return(this);
 }
        public void AddProject()
        {
            AccountData account = new AccountData()
            {
                Name     = "administrator",
                Password = "******"
            };

            List <AddData> oldProjects = appmanager.API.GetProjectsList(account);

            AddData add = new AddData("Project Test Mantis");

            add.Description = "Description Test";

            appmanager.Project.Create(add);

            List <AddData> newProjects = appmanager.API.GetProjectsList(account);

            oldProjects.Add(add);
            oldProjects.Sort();
            newProjects.Sort();
            Assert.AreEqual(oldProjects, newProjects);
        }