# -*- coding:utf-8 -*-
# date = 2019/11/13
# name = "yedeng"
# project_name = sjkb-ui
# explain : 数据看板基础功能
import os
from utils.GetelementFromYaml import ReadyamlToElement
from utils.log import Log
from utils.Screenshot import Picture
from testcase_utils.HandleTable import Handletable
class Basis:
"""
看板基础功能回归测试
"""
def __init__(self, driver):
self.__driver = driver
self.__kbgl = ReadyamlToElement(self.__driver,
os.path.dirname(os.getcwd()) + os.sep + "yaml" + os.sep + "projectsjkb" +
os.sep + "Kbgl.yaml")
self.__picture = Picture(self.__driver)
def createkb(self, boardname, systemname, wide, high, boardinfo):
"""
新增自定义看板测试:步骤
点击新增自定义看板按钮
填写数据
看板操作,删除看板
:param boardname: 看板名称
:param systemname: 看板的系统名称
:param wide: 看板的宽
:param high: 看板的高
:param boardinfo: 看板的说明信息
"""
globalsystem = self.__kbgl.getelement("gloabesystemname").text # 当前项目名称
self.__kbgl.waitgetelement("createkbbutton").click()
# 等待新增自定义看板出现
self.__kbgl.waitgetelement("antmodal")
Log.info("开始填写看板属性")
self.__kbgl.getelement("boardname").send_keys(boardname)
# 判断看板的默认系统名称是否是项目名称
kbsystemname = self.__kbgl.getelement("systemname")
if kbsystemname.text != globalsystem:
Log.error("默认的看板系统名称不是" + globalsystem + ",请检查页面")
kbsystemname.clear()
# 填写看板的系统名称,宽,高,说明
kbsystemname.send_keys(systemname)
self.__kbgl.getelement("wide").send_keys(wide)
self.__kbgl.getelement("high").send_keys(high)
self.__kbgl.getelement("boardInfo").send_keys(boardinfo)
self.__kbgl.getelement("definebutton").click()
def table(self):
tablethead = self.__kbgl.waitgetelement("kanbantable")
# print(Handletable.tablelows(tablethead).__len__())
Handletable(self.__driver).tabless(tablethead, "//tbody[@class='ant-table-tbody']/tr[2]/td[4]/span/span[2]/a",
"AI看板", 7, [True, 1]).click()
# print(Handletable.tablecell(tablethead, 5, 7).text)
文章标题:table页面的处理
URL链接:
http://cdxtjz.cn/article/jspehg.html