添加镜像管理部分业务
This commit is contained in:
parent
60769f58a7
commit
7997338cd1
|
@ -2,7 +2,6 @@
|
|||
*.ini
|
||||
*allure-report
|
||||
*report
|
||||
*.xlsx
|
||||
*.json
|
||||
*.idea
|
||||
*.vscode
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.8 (cmp_env)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
<option name="projectConfiguration" value="pytest" />
|
||||
<option name="PROJECT_TEST_RUNNER" value="pytest" />
|
||||
</component>
|
||||
</module>
|
|
@ -3,5 +3,5 @@
|
|||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (cmp_ui_test)" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (cmp_env)" project-jdk-type="Python SDK" />
|
||||
</project>
|
Binary file not shown.
|
@ -19,6 +19,7 @@ class FolderAction(object):
|
|||
self.pdclasspage = folderpage.ProdCategPage(self.dr)
|
||||
self.pdmanagepage = folderpage.ProductManagePage(self.dr)
|
||||
self.spmanage = folderpage.SpecificationPage(self.dr)
|
||||
self.ospage = folderpage.OperationSystemPage(self.dr)
|
||||
|
||||
|
||||
class ProdCategAction(FolderAction):
|
||||
|
@ -221,6 +222,44 @@ class SpecificationAction(FolderAction):
|
|||
except Exception as e:
|
||||
self.log.error("查询失败:%s,异常错误"%e)
|
||||
|
||||
class OSAction(FolderAction):
|
||||
def create_os(self,vdc,vpool,imagetype,ostype,imagename):
|
||||
try:
|
||||
self.ospage.open_pv_managevolume_page()
|
||||
self.ospage.click_new_create_button()
|
||||
self.ospage.click_vdc_box()
|
||||
self.ospage.select_vdc(vdc)
|
||||
self.ospage.click_vpool_box()
|
||||
self.ospage.select_vpool(vpool)
|
||||
if imagetype == "模板":
|
||||
self.ospage.click_image_type_box()
|
||||
self.ospage.select_image_type("模板")
|
||||
self.ospage.click_os_type()
|
||||
self.ospage.select_os_type(ostype)
|
||||
self.ospage.click_template_box()
|
||||
self.ospage.select_template(imagename)
|
||||
elif imagetype == "ISO":
|
||||
self.ospage.click_image_type_box()
|
||||
self.ospage.select_image_type("ISO")
|
||||
self.ospage.click_os_type()
|
||||
self.ospage.select_os_type(ostype)
|
||||
self.ospage.click_iso_box()
|
||||
self.ospage.select_iso(imagename)
|
||||
elif imagetype == "自安装":
|
||||
self.ospage.click_image_type_box()
|
||||
self.ospage.select_image_type("ISO")
|
||||
self.ospage.click_os_type()
|
||||
self.ospage.select_os_type(ostype)
|
||||
else:
|
||||
self.log.error("imagetype is not in ‘模板’ iso 自安装")
|
||||
self.ospage.click_save_button()
|
||||
except Exception as e:
|
||||
self.log.error("创建操作系统失败:%s"%e)
|
||||
|
||||
def search_os(self):
|
||||
self.ospage.open_pv_managevolume_page()
|
||||
self
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -233,11 +272,11 @@ if __name__ == '__main__':
|
|||
login = Login(dr).login("hubei01", "1qaz!QAZ")
|
||||
#
|
||||
sleep(3)
|
||||
product =SpecificationAction(dr)
|
||||
product =OSAction(dr)
|
||||
# # product.create_product("云主机","Openstack L","云主机","云主机测试","12","测试")
|
||||
# product.product_offline("云主机测试")
|
||||
# product.create_specification(productname="云主机",spname="云主机规格test",sptype=3,sptag="测试",spdes="自动化测试",vpool="湖北")
|
||||
print(product.search_sp(spname="云主机规格test"))
|
||||
print(product.create_os())
|
||||
sleep(2)
|
||||
# product.create_product_class("123","1","234")
|
||||
dr.quit()
|
|
@ -0,0 +1,116 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2020/2/27 10:26
|
||||
# @Author : mrwuzs
|
||||
# @Email : mrwuzs@outlook.com
|
||||
# @File : sysimageaction.py
|
||||
# @Software: PyCharm
|
||||
|
||||
import allure
|
||||
import time
|
||||
from time import sleep
|
||||
|
||||
from public.pages import sysimagepage
|
||||
from public.common import log
|
||||
|
||||
|
||||
class ImageManageAction():
|
||||
def __init__(self, driver):
|
||||
self.dr = driver
|
||||
self.sip = sysimagepage.SysimagePage(self.dr)
|
||||
self.log = log.Log()
|
||||
|
||||
def global_setting(self,provisiontype,networkadapter,diskcontrl=False,**kwargs):
|
||||
try:
|
||||
self.sip.open_sys_image()
|
||||
self.sip.click_global_setting()
|
||||
sleep(globalparam.middle)
|
||||
self.sip.click_edit_button()
|
||||
self.sip.click_preparation_type_box()
|
||||
self.sip.select_preparation_type(provisiontype)
|
||||
self.sip.click_network_adapter_type_box()
|
||||
self.sip.select_network_adapter_type(networkadapter)
|
||||
CLASS = self.sip.get_class_advanced_options_i_tag()
|
||||
if "fa-angle-up" in CLASS:
|
||||
self.sip.click_advanced_options_button()
|
||||
elif "fa-angle-down" in CLASS:
|
||||
self.log.debug("CLASS is :%s nothing to do"%CLASS)
|
||||
else:
|
||||
self.log.error("CLASS:%s is error please check ")
|
||||
if diskcontrl:
|
||||
self.sip.click_dc_os_box()
|
||||
self.sip.select_dc_os(kwargs["dcos"])
|
||||
self.sip.click_dc_os_version_box()
|
||||
self.sip.select_dc_os_version(kwargs["osverion"])
|
||||
if kwargs["controllertype"] == "IDE":
|
||||
self.sip.click_dc_controllertype_box()
|
||||
self.sip.select_dc_controllertype("IDE")
|
||||
if kwargs["controllertype"] == "SCSI":
|
||||
self.sip.click_dc_controllertype_box()
|
||||
self.sip.select_dc_controllertype("SCSI")
|
||||
self.sip.click_dc_controller_box()
|
||||
self.sip.select_dc_controller("controller")
|
||||
self.sip.click_save_button()
|
||||
except Exception as e:
|
||||
self.log.error("配置全局配置失败:%s"%e)
|
||||
|
||||
|
||||
def upload_file(self,imagename,path,timeout):
|
||||
try:
|
||||
self.sip.open_sys_image()
|
||||
sleep(globalparam.middle)
|
||||
self.sip.click_upload_button()
|
||||
sleep(globalparam.small)
|
||||
self.sip.input_image_name(imagename)
|
||||
self.sip.click_template_button()
|
||||
self.sip.click_vmdk_button()
|
||||
self.sip.upload_file_image(path)
|
||||
sleep(globalparam.tiny)
|
||||
self.sip.click_upload_button_for_childpage()
|
||||
sleep(timeout)
|
||||
t1 = time.time()
|
||||
response = self.sip.get_after_upload()
|
||||
while ("上传成功" not in response) and (time.time() - t1 < timeout):
|
||||
response = self.sip.get_after_upload()
|
||||
sleep(1)
|
||||
self.log.debug("response:%s"%response)
|
||||
if "上传成功" not in response:
|
||||
self.log.error("上次镜像失败或超时")
|
||||
self.sip.click_close_button()
|
||||
# self.sip.
|
||||
except Exception as e:
|
||||
self.log.error(":%s"%e)
|
||||
|
||||
|
||||
def get_image_meg(self,imagename,regionname,resnode,dc):
|
||||
try:
|
||||
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)
|
||||
|
|
@ -12,7 +12,9 @@ from public.pages import vdcPage
|
|||
from public.common import log
|
||||
|
||||
|
||||
class VdcACction(object):
|
||||
class VdcACction(
|
||||
|
||||
):
|
||||
def __init__(self, driver):
|
||||
self.dr = driver
|
||||
self.vdcpage = vdcPage.VdcPage(self.dr)
|
||||
|
|
|
@ -187,6 +187,36 @@ class PySelenium(object):
|
|||
"Please enter the correct targeting elements,'id','name','class','link_text','xpaht','css'.")
|
||||
return element
|
||||
|
||||
def get_elements(self, css):
|
||||
"""
|
||||
Judge element positioning way, and returns the element.
|
||||
|
||||
Usage:
|
||||
driver.get_element('id->kw')
|
||||
"""
|
||||
if "->" not in css:
|
||||
raise NameError("Positioning syntax errors, lack of '->'.")
|
||||
|
||||
by = css.split("->")[0].strip()
|
||||
value = css.split("->")[1].strip()
|
||||
|
||||
if by == "id":
|
||||
element = self.driver.find_elements_by_id(value)
|
||||
elif by == "name":
|
||||
element = self.driver.find_elements_by_name(value)
|
||||
elif by == "class":
|
||||
element = self.driver.find_elements_by_class_name(value)
|
||||
elif by == "link_text":
|
||||
element = self.driver.find_elements_by_link_text(value)
|
||||
elif by == "xpath":
|
||||
element = self.driver.find_elements_by_xpath(value)
|
||||
elif by == "css":
|
||||
element = self.driver.find_elements_by_css_selector(value)
|
||||
else:
|
||||
raise NameError(
|
||||
"Please enter the correct targeting elements,'id','name','class','link_text','xpaht','css'.")
|
||||
return element
|
||||
|
||||
def open(self, url):
|
||||
"""
|
||||
open url.
|
||||
|
|
|
@ -334,3 +334,63 @@ class OperationSystemPage(FolderPgae):
|
|||
self.dr.click("xpath->//button[contains(.,'新建')]")
|
||||
#
|
||||
# @allure.step("")
|
||||
def click_vdc_box(self):
|
||||
self.log.debug("单机vdc输入框")
|
||||
self.dr.click("xpath->//div[@id='opeSystemModal']/div[2]/form/div/div/div[2]/div/div/div/span/span[2]/span")
|
||||
|
||||
def select_vdc(self,value):
|
||||
self.log.debug("选择vdc")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[4]",value)
|
||||
|
||||
def select_vpool(self,value):
|
||||
self.log.debug("选择vpool")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[5]",value)
|
||||
|
||||
def click_vpool_box(self):
|
||||
self.log.debug("单机vpool输入框")
|
||||
self.dr.click("xpath->//div[@id='opeSystemModal']/div[2]/form/div/div/div[3]/div/div/div/span/span[2]/span")
|
||||
|
||||
def click_image_type_box(self):
|
||||
self.log.debug("单击模板类型输入框")
|
||||
self.dr.click("xpath->//div[@id='opeSystemModal']/div[2]/form/div/div/div[4]/div/div/div/span/span[2]/span")
|
||||
|
||||
def select_image_type(self,value):
|
||||
self.log.debug("选择镜像类型")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[6]",value)
|
||||
|
||||
def click_os_type(self):
|
||||
self.log.debug("单击操作系统类型选择框")
|
||||
self.dr.click("xpath->//div[@id='opeSystemModal']/div[2]/form/div/div/div[5]/div/div/div/span/span[2]/span")
|
||||
|
||||
def click_os_box(self):
|
||||
self.log.debug("单击操作系统选择框")
|
||||
self.dr.click("xpath->//div[@id='opeSystemModal']/div[2]/form/div/div/div[6]/div/div/div/span/span[2]/span")
|
||||
|
||||
def click_template_box(self):
|
||||
self.log.debug("单击模板选择框")
|
||||
self.dr.click("xpath->//div[@id='opeSystemModal']/div[2]/form/div/div/div[7]/div/div/div/span/span[2]/span")
|
||||
|
||||
def click_iso_box(self):
|
||||
self.log.debug("单击iso选择框")
|
||||
self.dr.click("xpath->//div[@id='opeSystemModal']/div[2]/form/div/div/div[7]/div/div/div/span/span[2]/span")
|
||||
|
||||
|
||||
def select_os_type(self,value):
|
||||
self.log.debug("操作系统类型")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[7]",value)
|
||||
|
||||
def select_os(self,value):
|
||||
self.log.debug("选择镜像类型")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[8]",value)
|
||||
|
||||
def select_template(self,value):
|
||||
self.log.debug("选择模板")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[9]",value)
|
||||
|
||||
def select_iso(self,value):
|
||||
self.log.debug("选择ISO")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[9]",value)
|
||||
|
||||
def click_save_button(self):
|
||||
self.log.debug("单击保存按钮")
|
||||
self.dr.click("xpath->//div[19]/div/div[3]/button")
|
|
@ -16,5 +16,189 @@ class SysimagePage(basepage.Page):
|
|||
|
||||
def select_image_name(self,value):
|
||||
self.log.debug("搜索镜像:%s"%value)
|
||||
self.dr.type_and_enter("xpath=(//input[@type='text'])[12]",value)
|
||||
self.dr.type_and_enter("xpath->(//input[@type='text'])[12]",value)
|
||||
|
||||
def click_global_setting(self):
|
||||
self.log.debug("双击击全局配置")
|
||||
self.dr.move_to_element("xpath->//a[contains(text(),'全局配置')]")
|
||||
self.dr.double_click("xpath->//div[5]/div/a")
|
||||
|
||||
def click_edit_button(self):
|
||||
self.log.debug("单击编辑按钮")
|
||||
self.dr.click("xpath->//div[@id='globalConfigModal']/form/div[2]/button")
|
||||
|
||||
def click_preparation_type_box(self):
|
||||
self.log.debug("单击系统盘制备类型选择框")
|
||||
self.dr.click("xpath->//div[@id='editConfigModal']/form/div/div/div[2]/div/div/div/span/span[2]/span")
|
||||
|
||||
def select_preparation_type(self,value):
|
||||
self.log.debug("选择置备类型")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[8]",value)
|
||||
|
||||
def click_network_adapter_type_box(self):
|
||||
self.log.debug("单击网络适配器选择框")
|
||||
self.dr.click("xpath->//div[@id='editConfigModal']/form/div/div/div[3]/div/div/div/span/span[2]/span")
|
||||
|
||||
def select_network_adapter_type(self,value):
|
||||
self.log.debug("选择网络适配器选择框")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[9]",value)
|
||||
|
||||
def click_advanced_options_button(self):
|
||||
self.log.debug("单击高级选项")
|
||||
self.dr.click("xpath->//a[contains(text(),'高级选项')]")
|
||||
|
||||
def get_class_advanced_options_i_tag(self):
|
||||
self.log.debug("获取高级选项后的箭头的属性")
|
||||
return self.dr.get_attribute("xpath->//div[4]/div/label/a/i","class")
|
||||
|
||||
def click_dc_os_box(self):
|
||||
self.log.debug("单击磁盘控制器下的操作系统选择框")
|
||||
self.dr.click("xpath->//div[@id='ui-select-choices-row-18-0']/span/span")
|
||||
|
||||
def click_dc_os_version_box(self):
|
||||
self.log.debug("单击磁盘控制器下的操作系统版本选择框")
|
||||
self.dr.click("xpath->//div[@id='editConfigModal']/form/div/div/div[6]/div[2]/div/div/span/span[2]/span")
|
||||
|
||||
def click_dc_controllertype_box(self):
|
||||
self.log.debug("单击磁盘控制器下的控制器类型选择框")
|
||||
self.dr.click("xpath->//div[@id='editConfigModal']/form/div/div/div[6]/div[3]/div/div/span/span[2]/span")
|
||||
|
||||
def click_dc_controller_box(self):
|
||||
self.log.debug("单击磁盘控制器下的控制器选择框")
|
||||
self.dr.click("xpath->//div[@id='editConfigModal']/form/div/div/div[6]/div[4]/div/div/span/span[2]/span")
|
||||
|
||||
def select_dc_os(self,value):
|
||||
self.log.debug("选择操作系统")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[10]",value)
|
||||
|
||||
def select_dc_os_version(self,value):
|
||||
self.log.debug("选择操作系统版本")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[11]",value)
|
||||
|
||||
def select_dc_controllertype(self,value):
|
||||
"""
|
||||
value in IDE,SCSI
|
||||
"""
|
||||
self.log.debug("选择操作控制器类型")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[12]",value)
|
||||
|
||||
def select_dc_controller(self,value):
|
||||
"""
|
||||
:param value: SI Logic 并行,LSI Logic SAS , VMware 准虚拟 ,BusLogic 并行
|
||||
:return:
|
||||
"""
|
||||
self.log.debug("选择操作控制器")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[14]",value)
|
||||
|
||||
def click_add_button(self):
|
||||
self.log.debug("单击加号按钮")
|
||||
self.dr.click("xpath->//div[@id='editConfigModal']/form/div/div/div[6]/div[5]/button[2]/i")
|
||||
|
||||
def click_save_button(self):
|
||||
self.log.debug("单击保存按钮")
|
||||
self.dr.click("xpath->//div[@id='editConfigModal']/form/div[2]/button")
|
||||
|
||||
#上次镜像
|
||||
def click_upload_button(self):
|
||||
self.log.debug("单击上传按钮")
|
||||
self.dr.click("xpath->//div[5]/div/button")
|
||||
|
||||
def input_image_name(self,value):
|
||||
self.log.debug("输入镜像名称")
|
||||
self.dr.clear_type("xpath->//input[@name='mirrorName']",value)
|
||||
|
||||
def click_template_button(self):
|
||||
self.log.debug("单击模板按钮")
|
||||
self.dr.click("xpath->//form[@id='fileuploadMirror']/div[2]/div/div[4]/div/button")
|
||||
|
||||
def click_iso_button(self):
|
||||
self.log.debug("单击ISO按钮")
|
||||
self.dr.click("xpath->//form[@id='fileuploadMirror']/div[2]/div/div[4]/div/button[2]")
|
||||
|
||||
def click_vmdk_button(self):
|
||||
self.log.debug("单击vmdk按钮")
|
||||
self.dr.click("xpath->//form[@id='fileuploadMirror']/div[2]/div/div[5]/div/button")
|
||||
|
||||
def click_ova_button(self):
|
||||
self.log.debug("单击ova按钮")
|
||||
self.dr.click("xpath->//form[@id='fileuploadMirror']/div[2]/div/div[5]/div/button[2]")
|
||||
|
||||
def click_ostype_box_upload(self):
|
||||
self.log.debug("点击操作系统类型选择框")
|
||||
self.dr.click("xpath->//form[@id='fileuploadMirror']/div[2]/div/div[6]/div/div/div/span/span[2]/span")
|
||||
|
||||
def select_ostype_upload(self,value):
|
||||
self.log.debug("选择操作系系统类型")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[10]",value)
|
||||
|
||||
def click_osversion_box_upload(self):
|
||||
self.log.debug("点击操作系统版本选择框")
|
||||
self.dr.click("xpath->//form[@id='fileuploadMirror']/div[2]/div/div[6]/div[2]/div/div/span/span[2]/span")
|
||||
|
||||
def select_osversion_upload(self,value):
|
||||
self.log.debug("选择操作系系统版本")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[11]",value)
|
||||
|
||||
def input_minimum_memory(self,value):
|
||||
self.log.debug("输入最小内存")
|
||||
self.dr.clear_type("xpath->//input[@name='minRam']",value)
|
||||
|
||||
def input_minimum_disk(self,value):
|
||||
self.log.debug("输入最小磁盘")
|
||||
self.dr.clear_type("xpath->//input[@name='size']",value)
|
||||
|
||||
def upload_file_image(self,vlaue):
|
||||
self.log.debug("单击上传文件按钮")
|
||||
ele = self.dr.get_element("xpath->//input[@name='inputFile']")
|
||||
ele.send_keys(vlaue)
|
||||
|
||||
def click_upload_button_for_childpage(self):
|
||||
self.log.debug("单击上传按钮")
|
||||
self.dr.click("xpath->//form[@id='fileuploadMirror']/div[2]/div/div[9]/div/table/tbody/tr/td[5]/button/span")
|
||||
|
||||
def get_after_upload(self):
|
||||
self.log.debug("获取上次后的结果")
|
||||
TEXT = self.dr.get_text("xpath->//form[@id='fileuploadMirror']/div[2]/div/div[9]/div/table/tbody/tr/td[2]")
|
||||
return TEXT
|
||||
|
||||
def click_close_button(self):
|
||||
self.log.debug("单击关闭按钮")
|
||||
self.dr.click("xpath->//form[@id='fileuploadMirror']/div[3]/button")
|
||||
|
||||
def select_image_name_box(self,value):
|
||||
self.log.debug("搜索镜像")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='text'])[12]",value)
|
||||
|
||||
def click_region_box(self):
|
||||
self.log.debug("单击区域选择框")
|
||||
self.dr.click("xpath->//div[2]/div/div/span/span[2]/span")
|
||||
|
||||
def click_resnode_box(self):
|
||||
self.log.debug("单击资源节点选择框")
|
||||
self.dr.click("xpath->//div[3]/div/div/span/span[2]/span")
|
||||
|
||||
def click_datacenter_box(self):
|
||||
self.log.debug("单击数据中心选择框")
|
||||
self.dr.click("xpath->//div[4]/div/div/span/span[2]/span")
|
||||
|
||||
def select_region(self,value):
|
||||
self.log.debug("选择区域")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[3]",value)
|
||||
|
||||
def select_resnode(self,value):
|
||||
self.log.debug("选择资源节点")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[4]",value)
|
||||
|
||||
def select_datacenter(self,value):
|
||||
self.log.debug("选择数据中心")
|
||||
self.dr.type_and_enter("xpath->(//input[@type='search'])[5]",value)
|
||||
|
||||
def get_text_iamge_table(self):
|
||||
self.log.debug("获取镜像列表的文本信息")
|
||||
eles = self.dr.get_elements("xpath->//mirror-table/div/table/tbody/tr")
|
||||
texts = []
|
||||
for ele in eles:
|
||||
texts.append(ele.text)
|
||||
# texts.append(ele.text())
|
||||
return texts
|
||||
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
allure-pytest==2.8.6
|
||||
allure-python-commons==2.8.6
|
||||
atomicwrites==1.3.0
|
||||
attrs==19.3.0
|
||||
colorama==0.4.1
|
||||
importlib-metadata==0.23
|
||||
more-itertools==7.2.0
|
||||
nose==1.3.7
|
||||
packaging==19.2
|
||||
pluggy==0.13.0
|
||||
py==1.8.0
|
||||
pyparsing==2.4.2
|
||||
pytesseract==0.3.0
|
||||
pytest==5.2.2
|
||||
pytest-html==2.0.0
|
||||
pytest-metadata==1.8.0
|
||||
pytest-rerunfailures==7.0
|
||||
selenium==3.141.0
|
||||
six==1.12.0
|
||||
urllib3==1.25.6
|
||||
wcwidth==0.1.7
|
||||
xlrd==1.2.0
|
||||
zipp==0.6.0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue