예제 #1
0
파일: SaasPO.py 프로젝트: skducn/project
    def setUpClass(self):
        global ruleType, isRun, caseFrom, caseTo, curl, rulesApi, archiveNum, jar, excel, excelSheet1
        self.Time_PO = TimePO()
        self.File_PO = FilePO()
        self.Excel_PO = ExcelPO()
        self.Device_PO = DevicePO()
        self.List_PO = ListPO()
        self.Color_PO = ColorPO()
        self.excelFile = localReadConfig.get_excel("webFile")
        self.Mysql_PO = MysqlPO(localReadConfig.get_db("host"),
                                localReadConfig.get_db("username"),
                                localReadConfig.get_db("password"),
                                localReadConfig.get_db("database"),
                                localReadConfig.get_db("port"))
        # self.Log_PO = LogPO(logFile, fmt='%(levelname)s - %(message)s - %(asctime)s')  # 输出日志

        self.Web_PO = WebPO("chrome")
        self.Web_PO.openURL(localReadConfig.get_http("webUrl"))
        self.Web_PO.driver.maximize_window()  # 全屏

        self.varExcel = os.path.abspath(
            File_PO.getLayerPath("../config") + "/" + self.excelFile)
        self.varTimeYMDHSM = datetime.datetime.now().strftime(
            '%Y%m%d%H%M%S')  # 获取当天日期时间,格式:20161020130318
        bk = xlrd.open_workbook(self.varExcel, formatting_info=True)
        self.newbk = copy(bk)
        self.sheetMain = bk.sheet_by_name("main")
        self.sheetTestCase = bk.sheet_by_name("testcase")
        self.styleRed = xlwt.easyxf(
            'font: name Times New Roman, color-index red')
        self.styleBlue = xlwt.easyxf(
            'font: name Times New Roman, color-index blue')
        self.styleGray25 = xlwt.easyxf(
            'font: name Times New Roman, color-index gray25')
예제 #2
0
파일: config.py 프로젝트: skducn/project
# Description: OA 配置文件
# *****************************************************************

import string, numpy
from string import digits
from PO.HtmlPO import *
from PO.ListPO import *
from PO.TimePO import *
from PO.ColorPO import *
from PO.LogPO import *
from PO.NetPO import *
from PO.DataPO import *
from PO.FilePO import *
from PO.StrPO import *
from PO.ExcelPO import *
from PO.TimePO import *
Time_PO = TimePO()
Color_PO = ColorPO()

from PO.MysqlPO import *
Mysql_PO = MysqlPO("192.168.0.233", "ceshi", "123456", "TD_APP", 3336)  # 测试数据库

# 39 环境
varURL = "http://192.168.0.233"

# 日志文件
logFile = './log/oa_' + Time_PO.getDate() + '.log'



예제 #3
0
from datetime import datetime
from time import sleep
from parameterized import parameterized
from BeautifulReport import BeautifulReport as bf
import instance.zyjk.SAAS.PageObject.ReadConfigPO as readConfig
localReadConfig = readConfig.ReadConfigPO()
from instance.zyjk.SAAS.PageObject.XlsPO import *
Xls_PO = XlsPO()
from PO.TimePO import *
Time_PO = TimePO()
from PO.DataPO import *
data_PO = DataPO()
from PO.ColorPO import *
Color_PO = ColorPO()
from PO.MysqlPO import *
Mysql_PO = MysqlPO("192.168.0.195", "root", "Zy123456", "saasuserdev",
                   3306)  # 测试环境
l_interIsRun = (Xls_PO.getInterIsRun())  # 获取inter中isRun执行筛选列表 ,[[], [], 3]


class testInterface(unittest.TestCase):
    @parameterized.expand(Xls_PO.getCaseParam())
    def test(self, excelNo, caseName, method, interName, param, jsonpathKey,
             expected, generation, selectSQL, updateSQL):

        ''
        # 判断对象属性是否存在,generation中所有变量。
        if hasattr(testInterface, "code"):
            param = param.replace("$$code", str(testInterface.code))
        if hasattr(testInterface, "token"):
            param = param.replace("$$token", str(testInterface.token))
        if hasattr(testInterface, "id"):
예제 #4
0
파일: zentao.py 프로젝트: skducn/project
# coding=utf-8
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# Author     : John
# Created on : 2020-6-3
# Description: 统计禅道中测试人员上一工作日的任务。
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

import sys, platform, os
sys.path.append("../../../")
from time import sleep
from PO.TimePO import *
Time_PO = TimePO()
from PO.FilePO import *
File_PO = FilePO()
from PO.MysqlPO import *
Mysql_PO = MysqlPO("192.168.0.211", "readonly", "benetech123", "zentaoep",
                   3306)

from PO.OpenpyxlPO import *
excelName = "禅道每日审查_测试.xlsx"
excelSheet = "每日禅道审查"
Openpyxl_PO = OpenpyxlPO(excelName)
Openpyxl_PO.closeExcelPid('EXCEL.EXE')  # 关闭所有打开的excel

# 获取当天的工作日
l_rowcol = Openpyxl_PO.l_getTotalRowCol(excelSheet)
for i in range(11):
    varStartDate = str(Time_PO.get_day_of_day(-i))
    # varStartDate = str(Time_PO.get_day_of_day(-1-i)) # 上一工作日
    if cal.is_working_day(
            date(int(varStartDate.split("-")[0]),
                 int(varStartDate.split("-")[1]),
예제 #5
0
# coding=utf-8
#***************************************************************
# Author     : John
# Created on : 2020-7-22
# Description: 小程序登录时清除账号权限
#***************************************************************

import os, sys
sys.path.append("../../../../")
from PO.MysqlPO import *

mysql_PO = MysqlPO("192.168.0.39", "ceshi", "123456", "TD_OA", 3336)
mysql_PO.cur.execute(
    "update user SET VX_MARK='', IMEI='', MODEL='',PLATFORM='', NOT_LOGIN=0, LIMIT_LOGIN=0 "
)
mysql_PO.conn.commit()
예제 #6
0
파일: config.py 프로젝트: skducn/project
import string, numpy
from string import digits
from PO.HtmlPO import *
from PO.ListPO import *
from PO.TimePO import *
from PO.ColorPO import *
from PO.LogPO import *
from PO.NetPO import *
from PO.DataPO import *
from PO.FilePO import *
from PO.ExcelPO.ExcelPO import *
from PO.TimePO import *
Time_PO = TimePO()

from PO.MysqlPO import *
Mysql_PO = MysqlPO("192.168.0.195", "root", "Zy123456", "bitest",
                   3306)  # 测试数据库
# Mysql_PO = MysqlPO("192.168.0.195", "root", "Zy123456", "bidev", 3306)  # 开发数据库

# 183 环境
# varURL = "https://192.168.0.183/admin/login?return=https%3A%2F%2F192.168.0.183%2Fportal_hosp%3Fcode%3D5749894d0d424f508d8139779150113b&system=portal&system=portal"
# varUser = "******"
# varPass = "******"

# 86 环境
varURL = "https://192.168.0.86/login"
varUser = "******"
varPass = "******"

# 日志文件
logFile = './log/bi_' + Time_PO.getDate() + '.log'