# -*- 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)