Example #1
0
 def test_role01(self):
     """新增角色"""
     role = RolePage(self.driver)
     role.add_role("自动测试系统", "测试科")
     try:
         message = role.get_message()
         self.assertEqual("保存成功!", message)
     except Exception as e:
         role.get_windows_img()
         raise e
Example #2
0
 def test_role06(self):
     """分配权限"""
     self.driver.refresh()
     time.sleep(2)
     role = RolePage(self.driver)
     role.assign_privelege("自动化测试系统")
     try:
         message = role.get_message()
         self.assertEqual("分配权限成功!", message)
     except Exception as e:
         role.get_windows_img()
         raise e
Example #3
0
 def test_role05(self):
     """分配用户"""
     self.driver.refresh()
     time.sleep(2)
     role = RolePage(self.driver)
     role.assign_user("自动化测试系统", "cyl")
     try:
         message = role.peizhi_message()
         self.assertEqual("已配置", message)
     except Exception as e:
         role.get_windows_img()
         raise e
Example #4
0
 def test_role04(self):
     """编辑角色名称"""
     self.driver.refresh()
     time.sleep(2)
     role = RolePage(self.driver)
     role.edit_role("自动测试系统", "自动化测试系统")
     try:
         message = role.get_message()
         self.assertEqual("保存成功!", message)
     except Exception as e:
         role.get_windows_img()
         raise e
Example #5
0
 def test_role03(self):
     """通过所属单位查询"""
     self.driver.refresh()
     time.sleep(2)
     role = RolePage(self.driver)
     role.query_unit()
     try:
         name = role.get_name()
         self.assertEqual("自动测试系统", name)
     except Exception as e:
         role.get_windows_img()
         raise e
Example #6
0
 def test_role07(self):
     """删除角色"""
     self.driver.refresh()
     time.sleep(2)
     role = RolePage(self.driver)
     role.delete_role("自动化测试系统")
     try:
         message = role.get_message()
         self.assertEqual("删除成功!", message)
     except Exception as e:
         role.get_windows_img()
         raise e