def test_02_organizeGS(self): # 重置 organizepage = organizePage(self.driver) rosterpage = RosterPage(self.driver) rosterpage.loginin() organizepage.waite_time_seconds(10, "_worker_management") organizepage.get_button_click("_worker_management") organizepage.get_button_click("_organize_button") organizepage.waite_time_seconds(10, "_organize_GS") organizepage.get_button_click("_organize_GS") organizepage.waite_time_seconds(10, "_depart_finance") organizepage.get_button_click("_depart_finance") organizepage.waite_time_seconds(10, "_departe_finance_edite") organizepage.get_button_click("_departe_finance_edite") organizepage.waite_time_seconds(10, "_depart_name_edite") organizepage.clear_text("_depart_name_edite") # 清除 organizepage.edite_elements("_depart_name_edite", "商务部测试") organizepage.get_button_click("_depart_hold_edite") organizepage.get_button_click("_depart_hold_GS") # 选择部门归属为国盛天丰 organizepage.get_button_click("_depart_reset_button") #点击重置按钮 try: # assert "财务部" in organizepage.get_text("_depart_finance") self.assertTrue("财务部" in organizepage.get_text("_depart_finance")) self.assertTrue("陈璟深" in organizepage.get_text( "_depart_management_Chenjingshen1")) # assert "陈璟深" in organizepage.get_text("_depart_management_Chenjingshen1") print("Test Pass") except Exception as e: print("Test Fail")
def test_03_organizeGS(self): # 组织是否对应 organizepage = organizePage(self.driver) rosterpage = RosterPage(self.driver) rosterpage.loginin() organizepage.waite_time_seconds(10, "_worker_management") organizepage.get_button_click("_worker_management") organizepage.get_button_click("_organize_button") organizepage.waite_time_seconds(10, "_organize_GS") organizepage.get_button_click("_organize_GS") try: self.assertTrue("财务部" in organizepage.get_text("_depart_finance")) print("Test Pass") except Exception as e: print("Test Fail")
def test_01_organizeGS(self): # 提交用例 organizepage = organizePage(self.driver) rosterpage = RosterPage(self.driver) # 登陆用户 rosterpage.loginin() organizepage.waite_time_seconds(10, "_worker_management") organizepage.get_button_click("_worker_management") organizepage.get_button_click("_organize_button") organizepage.waite_time_seconds(10, "_organize_GS") organizepage.get_button_click("_organize_GS") organizepage.waite_time_seconds(10, "_depart_finance") organizepage.get_button_click("_depart_finance") organizepage.waite_time_seconds(10, "_departe_finance_edite") organizepage.get_button_click("_departe_finance_edite") organizepage.waite_time_seconds(10, "_depart_name_edite") organizepage.clear_text("_depart_name_edite") # 清除 organizepage.edite_elements("_depart_name_edite", "商务部测试") organizepage.get_button_click("_depart_hold_edite") organizepage.get_button_click("_depart_hold_GS") # 选择部门归属为国盛天丰 # organizepage.get_button_click("_depart_management_close") # 删除部门领导 # organizepage.get_button_click("_depart_hold_edite") # organizepage.edite_elements("_depart_hold_edite","陈璟深") # organizepage.waite_time_seconds(10,"_depart_management_Chenjingshen") # organizepage.get_button_click("_depart_management_Chenjingshen") # organizepage.get_button_click("") # 删除部门分层领导 # organizepage.edite_elements("_depart_othermanager_edite","钟") # organizepage.waite_time_seconds(10,"_depart_othermanager_zhongyongjun") # organizepage.get_button_click("_depart_othermanager_zhongyongjun") # organizepage.get_button_click("") # organizepage.edite_elements("_depart_HRBP_edite","赵文婷") # organizepage.get_button_click("_depart_HRBP_zhaowenting") organizepage.get_button_click("_depart_enable_edite") organizepage.get_button_click("_depart_isuseful_edite") organizepage.edite_elements("_depart_description", "测试是否能使用") organizepage.get_button_click("_depart_submit_button") try: # assert "提交成功" in organizepage.get_text("_submit_message") self.assertTrue( "提交成功!" in organizepage.get_text("_submit_message")) print("Test Pass") except Exception as e: print("Test Fail")
def test_03_inputRoster(self): #上传非法的xlsx文件: rosterpage = RosterPage(self.driver) # 登陆用户 rosterpage.loginin() time.sleep(3) # 点击人员组织管理按钮 rosterpage.click_management_button() # 点击花名册导入按钮 rosterpage.click_inputroster_button() # 点击花名册上传按钮 rosterpage.click_upload_file_button() report_path = os.path.dirname(os.path.abspath('.')) + '/myfile/' rosterpage.open_file(report_path + 'exefile/table_title_erro.exe') time.sleep(5) try: assert "table_title_erro.xlsx" in rosterpage.get_file_name() time.sleep(3) print("Test Pass") rosterpage.close() except Exception as e: print("Test Fail")
def test_02_inputRoster(self): #上传非xlxs文件类型的文件 rosterpage = RosterPage(self.driver) # 登陆用户 rosterpage.loginin() time.sleep(3) # 点击人员组织管理按钮 rosterpage.click_management_button() # 点击花名册导入按钮 rosterpage.click_inputroster_button() # 点击花名册上传按钮 rosterpage.click_upload_file_button() report_path = os.path.dirname(os.path.abspath('.')) + '/myfile/' rosterpage.open_file(report_path + 'exefile/uploadjpeg.exe') time.sleep(3) try: assert "上传文件格式不正确,只能上传.xlsx后缀的文件!" in rosterpage.get_erro_text() time.sleep(1) print("Test Pass") rosterpage.close() except Exception as e: print("Test Fail")
def test_01_inputRoster(self): rosterpage = RosterPage(self.driver) # 登陆用户 rosterpage.loginin() time.sleep(1) # 点击人员组织管理按钮 rosterpage.click_management_button() # 点击花名册导入按钮 rosterpage.click_inputroster_button() # 点击花名册上传按钮 rosterpage.click_upload_file_button() report_path = os.path.dirname(os.path.abspath('.')) + '/myfile/' rosterpage.open_file(report_path + 'exefile/uploadfile.exe') time.sleep(3) try: assert "normal.xlsx" in rosterpage.get_file_name() time.sleep(3) print('Test Pass') rosterpage.close() except Exception as e: print('Test Fail.', format(e))