Exemplo n.º 1
0
 def get_project_list_soap(self):
     project_list_soap = []
     l = self.app.soap.get_project_list("administrator", "root")
     for i in l:
         project_list_soap.append(
             Project(id=i.id,
                     project_name=i.name,
                     description=i.description))
     return project_list_soap
Exemplo n.º 2
0
def test_delet_project(app):
    if app.project.project_count() < 3:
        symbols = string.ascii_letters + string.digits
        project_name = '_'.join(
            [random.choice(symbols) for i in range(random.randrange(10))])
        description = '_'.join(
            [random.choice(symbols) for i in range(random.randrange(10))])
        project = Project(project_name=project_name, description=description)
        app.project.new_project_creation(project)
    old_project_list = app.project.get_project_list_soap()
    project = random.choice(old_project_list)
    app.project.delete_project_by_id(project.id)
    new_project_list = app.project.get_project_list_soap()
    old_project_list.remove(project)
    assert sorted(old_project_list,
                  key=Project.id_or_max) == sorted(new_project_list,
                                                   key=Project.id_or_max)
Exemplo n.º 3
0
def test_add_new_project(app):
    symbols = string.ascii_letters + string.digits
    project_name = '_'.join([random.choice(symbols) for i in range(random.randrange(10))])
    description = '_'.join([random.choice(symbols) for i in range(random.randrange(10))])
    #project_list_soap = []
    #base_url = app.base_url
    #l = app.soap.get_project_list(base_url, "administrator", "root")
    #for i in l:
    #    project_list_soap.append(Project(id=i.id, project_name=i.name, description=i.description))
        #return project_list_soap

    old_project_list = app.project.get_project_list_soap()
    #old_project_list = project_list_soap
    project = Project(project_name = project_name, description=description)
    app.project.new_project_creation(project)
    old_project_list.append(project)
    new_project_list = app.project.get_project_list_soap()
    assert sorted(old_project_list, key =Project.id_or_max) == sorted(new_project_list, key=Project.id_or_max)
Exemplo n.º 4
0
 def get_project_list(self):
     wd = self.app.wd
     self.project_manage_page()
     project_list = []
     list_tr = wd.find_elements_by_xpath("//table[@class='width100']//tr")
     for row in list_tr[3:]:
         cell = row.find_elements_by_tag_name("td")
         project_name = cell[0].text
         id_str = str(
             cell[0].find_element_by_tag_name("a").get_attribute("href"))
         long = len(id_str)
         point = id_str.index("=")
         dif = long - point
         id = id_str[-dif + 1:]
         description = cell[4].text
         project_list.append(
             Project(id=id,
                     project_name=project_name,
                     description=description))
     return project_list