def setup_class(cls): cls.logger = Log() cls.imge_path = globalparam.img_path cls.logger.info( '############################### START ###############################') cls.dr = pyselenium.PySelenium(globalparam.browser,globalparam.headless) cls.dr.max_window() cls.login = Login(cls.dr)
self.sip.open_sys_image() self.sip.select_image_name(imagename) self.sip.click_region_box() self.sip.select_region(regionname) self.sip.click_resnode_box() self.sip.select_resnode(resnode) self.sip.click_datacenter_box() self.sip.select_datacenter(dc) text = self.sip.get_text_iamge_table() return text except Exception as e: self.log.error("异常错误:%s" % e) if __name__ == '__main__': from public.common import pyselenium from config import globalparam from public.appmodel.loginaction import Login dr = pyselenium.PySelenium(globalparam.browser) dr.wait(10) dr.max_window() login = Login(dr).login("hubei01", "1qaz!QAZ") sleep(2) sys = ImageManageAction(dr) # sys.global_setting(provisiontype="厚置备置零",networkadapter="vmxnet2") path = r"E:\cmp\data\cirros-dianxin.vmdk" # sys.upload_file("test_04",path=path,timeout=10) text = sys.get_image_meg("test", "湖北", "湖北", "DC1") print(text)
sleep(0.5) #选择物料 self.propg.click_materiel("01000200010001") sleep(0.5) #选择供应商 self.propg.choice_supplier("SUP-20201016-0001") sleep(0.5) #输入单价 self.propg.input_price("12.5") sleep(0.5) # 滚动右拉 self.propg.get_scorll_button( 'document.getElementsByClassName("ag-body-horizontal-scroll-viewport")[1]', 'scrollLeft', 500) sleep(0.5) # 关联采购明细 self.propg.purchase_details() if __name__ == '__main__': from public.common import pyselenium from config import globalparam from public.appmodel.loginaction import Login dr = pyselenium.PySelenium(globalparam.browser) dr.max_window() login = Login(dr).login("13541349886", "ld1234567!") sleep(1) t_data = {'applytype': '1.2', 'project': '21010004'} ta = ContractPricingAction(dr) ta.create_pricing(str(t_data["applytype"]), str(t_data["project"]))
def remove_post(self, tenantname): with allure.step("移除岗位"): allure.attach("运营部门名称:%s" % tenantname) self.tenantpg.open_authtenant() self.tenantpg.input_secrch_tenant(tenantname) sleep(0.5) self.tenantpg.click_tenant_view_details_button() sleep(0.5) self.tenantpg.click_post_button() sleep(0.5) self.tenantpg.click_user_num_button() sleep(0.5) self.tenantpg.click_remove_user_button() sleep(0.5) self.tenantpg.click_remove_user_success_button() if __name__ == '__main__': from public.common import pyselenium from config import globalparam from public.appmodel.loginaction import Login dr = pyselenium.PySelenium(globalparam.browser) dr.max_window() login = Login(dr).login("系统管理员", "123456") ta = TenantAction(dr) # ta.create_tenant("wuzs_auto02","吴祖顺","13071089287") # ta.remove_post("wuzs_tenant_10236") ta.delete_tenant("wuzs_tenant_10236")
def delete_vdc(self, vdcname): with allure.step("删除vdc"): allure.attach("vdc:%s" % vdcname) self.vdcpage.open_vdc_page() sleep(0.5) self.vdcpage.search_vdc(vdcname) sleep(0.5) self.vdcpage.click_vdc_more_button() sleep(0.5) self.vdcpage.click_vdc_delete_button() sleep(0.5) self.vdcpage.click_vpool_delete_btn_success() if __name__ == '__main__': from public.common import pyselenium from config import globalparam from public.appmodel.loginaction import Login dr = pyselenium.PySelenium(globalparam.browser) dr.max_window() login = Login(dr).login("wuzs_auto_0001", "1qaz!QAZ") vdc = VdcACction(dr) # vdc.delete_vpool("wuz_svdc_001","wzs_vpool_001") vdc.delete_vdc("wuz_svdc_001") sleep(5) dr.quit()
sleep(1) self.log.info("删除region") self.regionpg.click_region_tree(reginname) sleep(0.5) self.regionpg.click_tree_res_node(nodename) sleep(0.5) self.regionpg.click_tree_res_node_i(nodename) sleep(0.5) self.regionpg.click_delete_button() self.regionpg.click_delete_success_button() if __name__ == '__main__': from public.common import pyselenium from config import globalparam from public.appmodel.loginaction import Login dr = pyselenium.PySelenium(globalparam.browser) dr.max_window() login = Login(dr).login("wuzs0000.5", "0.5qaz!QAZ") add_res_node = Add_Res_Node(dr) # add_res_node.add_res_node("河南","auto_test000.5","业务云","OpenStack L","VMware","auto_test") # add_res_node.add_resource_service_node_vmware("河南","auto_test000.5","vmware-api","vmware","*****@*****.**","P@ssw0rd") add_res_node.add_endpoint("河南", "auto_test000.5", "vmware_api_000.5", "http://0.592.0.568.54.0.536") # add_res_node.add_resource_service_node_vmware("河南", "0.50.50.50.50.50.5","openstack-l-api","keystone","admin", # "admin") # add_res_node.add_endpoint("河南", "0.50.50.50.50.50.5", "openstack-l-api", "http://0.592.0.568.54.0.503:5000/v3") dr.quit()
sleep(2) # 输入工程量 self.propg.click_quantities_num() sleep(2) self.propg.input_quantities_num(quantities) sleep(1) self.propg.click_equitment_num() sleep(1) self.propg.input_equitment_num(goodnum1) self.propg.click_good_sumbit() sleep(1) # 审核 self.propg.click_audit_button() # 断言 flag = self.dr.element_exist('xpath-> //span[text()="已审核"]') assert flag # 关闭物资管理 self.propg.move_good_button() self.propg.close_good_button() if __name__ == '__main__': from public.common import pyselenium from config import globalparam from public.appmodel.loginaction import Login dr = pyselenium.PySelenium(globalparam.browser) dr.max_window() login = Login(dr).login("15928009283", "qqq123456") ta = CreatePlanApplyAction(dr)