def test_1_tq(self):
     '''实时状态监控 > 实时气象曲线 > 天气预报温度'''
     driver=self.driver
     driver.maximize_window()
     start(driver,'http://192.168.60.21:8080/SPPS/weatherInfo/temCurveAction.action')
     click_list = ['实时状态监控', '实时气象曲线'] #点击菜单
     menu(driver,click_list)
     if now_time()[0]!=1:
         print("waiting 130")
         time.sleep(130)
     driver.find_element_by_id('search').click() #搜索
     time.sleep(2)
     hang='/html/body/div/div[2]/div[2]/div[2]/div[2]/div[2]/table/tbody/tr'
     global list_heng
     today=now_date()
     list_heng=get_heng(driver,hang) #获取表格数据
     list_tq_yuan = get_col_two(list_heng, 2).copy()  # 将表格数据生成列表
     list_tq = del_list_tup(list_tq_yuan, ' ')
     if list_tq == []:
         print("列表查询数据为空,无法比较")
     else:
         sql_kk = "SELECT a.PRE_TIME,a.ARI_TEM FROM GF_SPPS_NWP_DEAL a WHERE a.PRE_DATE='now_date()' ORDER BY a.PRE_TIME"
         sql = sql_kk.replace("now_date()", now_date())
         list_sql = get_oracle_h(sql, 1)  # 查询数据库
         print('天气预报温度表格数据为:', list_tq)
         print('天气预报温度sql数据为', list_sql)
         print('\n')
         self.assertEqual(list_tq, list_sql)
Beispiel #2
0
    def test_6_sjgl(self):
        '''功率曲线展示 > 短期上报曲线 > 实际功率>2天'''
        driver = self.driver
        driver.maximize_window()
        start(
            driver,
            'http://192.168.60.21:8080/SPPS/weatherInfo/temCurveAction.action')
        click_list = ['功率曲线展示', '上报曲线']  # 点击菜单
        menu(driver, click_list)
        if now_time()[0] != 1:
            print("waiting 70")
            time.sleep(70)
        set_date(driver, yes_date(), now_date())
        driver.find_element_by_id('search').click()  # 搜索
        time.sleep(2)
        hang = '/html/body/div/div[2]/div[2]/div[2]/div[2]/div[2]/table/tbody/tr'
        global list_heng
        list_heng = get_heng(driver, hang)  # 获取表格数据
        list_sjgl_yuan = get_col(list_heng, 3).copy()  # 将表格数据生成列表
        list_sjgl = del_list_tup(list_sjgl_yuan, ' ')
        if list_sjgl == []:
            print("列表查询数据为空,无法比较")
        else:
            sql_kk = "SELECT a.GATHER_DATE,a.GATHER_TIME,a.POWER_VALUE FROM GF_SPPS_POWER_HIS a \
WHERE a.GATHER_DATE in ('yes_date()','now_date()') ORDER BY a.GATHER_DATE,a.GATHER_TIME asc"

            sql = sql_kk.replace("now_date()", now_date())
            sql = sql.replace("yes_date()", yes_date())
            list_sql = get_oracle_h(sql, 2)  # 查询数据库
            print('实际功率表格数据为:', list_sjgl)
            print('实际功率sql数据为', list_sql)
            print('\n')
            self.assertEqual(list_sjgl, list_sql)
Beispiel #3
0
 def test_4_cdq(self):
     '''实时状态监控 > 预测理论功率曲线 > 超短期 > 两天'''
     driver = self.driver
     driver.maximize_window()
     start(
         driver,
         'http://192.168.60.21:8080/SPPS/weatherInfo/temCurveAction.action')
     click_list = ['实时状态监控', '预测理论功率曲线']  #点击菜单
     menu(driver, click_list)
     if now_time()[0] != 1:
         print("waiting 70")
         time.sleep(70)
     set_date(driver, yes_date(), now_date())
     driver.find_element_by_id('search').click()  #搜索
     time.sleep(2)
     hang = '/html/body/div/div[2]/div[2]/div[2]/div[2]/div[2]/table/tbody/tr'
     global list_heng
     list_heng = get_heng(driver, hang)  #获取表格数据
     list_cdq_yuan = get_col_two(list_heng, 2).copy()  # 将表格数据生成列表
     list_cdq = del_list_tup(list_cdq_yuan, ' ')
     if list_cdq == []:
         print("列表查询数据为空,无法比较")
     else:
         sql_kk = "SELECT a.PRE_TIME,a.PRE_POWER FROM SPPS_PREDICT_CDQ_DEAL a WHERE PRE_DATE" \
                  " in('yes_date()','now_date()') ORDER BY a.PRE_DATE,a.PRE_TIME"
         sql = sql_kk.replace("now_date()", now_date())
         sql = sql.replace("yes_date()", yes_date())
         list_sql = get_oracle_h(sql, 2)  # 查询数据库
         print('超短期表格数据为:', list_cdq)
         print('超短期sql数据为', list_sql)
         print('\n')
         self.assertEqual(list_cdq, list_sql)
Beispiel #4
0
 def test_5_cdq_two(self):
     '''实时状态监控 > 理论功率曲线 > 测光理论功率>两天'''
     driver = self.driver
     driver.maximize_window()
     start(driver, 'http://192.168.60.21:8080/SPPS/weatherInfo/temCurveAction.action')
     click_list = ['实时状态监控', '理论功率曲线']  # 点击菜单
     menu(driver, click_list)
     if now_time()[0] != 1:
         print("waiting 70")
         time.sleep(70)
     set_date(driver, yes_date(), now_date())
     driver.find_element_by_id('search').click()  # 搜索
     time.sleep(2)
     hang = '/html/body/div/div[2]/div[2]/div[2]/div[2]/div[2]/table/tbody/tr'
     global list_heng
     list_heng = get_heng(driver, hang)  # 获取表格数据
     list_cgll_yuan = get_col_two(list_heng, 2).copy()  # 将表格数据生成列表
     list_cgll = del_list_tup(list_cgll_yuan, ' ')
     if list_cgll == []:
         print("列表查询数据为空,无法比较")
     else:
         sql_kk = "SELECT a.FOCA_TIME,a.THEORY_NUM FROM GF_SPPS_PROD_THEORY a where a.FOCA_DATE in('yes_date()','now_date()') \
     and mod(to_char(to_date(a.foca_time,'HH24:mi:ss'),'mi'),15)=0 ORDER BY a.FOCA_DATE,a.FOCA_TIME asc"
         sql = sql_kk.replace("now_date()", now_date())
         sql = sql.replace("yes_date()", yes_date())
         list_sql = get_oracle_h(sql, 2)  # 查询数据库
         print('测光理论功率表格数据为:', list_cgll)
         print('测光理论功率sql数据为', list_sql)
         print('\n')
         self.assertEqual(list_cgll, list_sql)
 def test_1_ycgl(self):
     '''功率曲线展示 > 预测曲线 > 超短期预测曲线 > 预测功率'''
     driver = self.driver
     driver.maximize_window()
     start(
         driver,
         'http://192.168.60.21:8080/SPPS/weatherInfo/temCurveAction.action')
     click_list = ['功率曲线展示', '预测曲线', '超短期预测曲线']  #点击菜单
     menu(driver, click_list)
     if now_time()[0] != 1:
         print("waiting 70")
         time.sleep(70)
     driver.find_element_by_id('search').click()  #搜索
     time.sleep(2)
     hang = '/html/body/div/div[2]/div[2]/div[2]/div[2]/div[2]/table/tbody/tr'
     global list_heng
     list_heng = get_heng(driver, hang)  #获取表格数据
     list_ycgl_yuan = get_col(list_heng, 3).copy()  # 将表格数据生成列表
     list_ycgl = del_list_tup(list_ycgl_yuan, ' ')
     if list_ycgl == []:
         print("列表查询数据为空,无法比较")
     else:
         sql_kk = "SELECT a.PRE_DATE, a.PRE_TIME, a.PRE_POWER FROM SPPS_PREDICT_CDQ_DEAL a WHERE " \
                  "PRE_DATE = 'tom_date()' and a.pre_date || ' ' || a.pre_time >to_char(sysdate - 0 / 24, 'yyyy-mm-dd hh24:mi:ss') ORDER BY PRE_TIME "
         sql = sql_kk.replace("tom_date()", now_date())
         list_sql = get_oracle_h(sql, 2)  # 查询数据库
         print('超短期预测表格数据为:', list_ycgl)
         print('超短期预测sql数据为', list_sql)
         print('\n')
         self.assertEqual(list_ycgl, list_sql)
Beispiel #6
0
 def test_3_zyg(self):
     '''实时状态监控 > 实时功率曲线 > 总有功'''
     list_zyg_yuan = get_col_two(list_heng, 4)
     list_zyg = del_list_tup(list_zyg_yuan, ' ')
     if list_zyg == []:
         print("列表查询数据为空,无法比较")
     else:
         sql_kk = "SELECT GATHER_TIME,POWER_VALUE FROM gf_spps_power_his WHERE GATHER_DATE='now_date()' ORDER BY GATHER_TIME"
         sql = sql_kk.replace("now_date()", now_date())
         list_zyg_sql = get_oracle_h(sql, 2)
         print('总有功表格数据为:', list_zyg)
         print('总有功sql数据为', list_zyg_sql)
         print('\n')
         self.assertEqual(list_zyg, list_zyg_sql)
Beispiel #7
0
 def test_2_cdq(self):
     '''实时状态监控 > 实时功率曲线 > 超短期'''
     list_cdq_yuan = get_col_two(list_heng, 3)
     list_cdq = del_list_tup(list_cdq_yuan, ' ')
     if list_cdq == []:
         print("列表查询数据为空,无法比较")
     else:
         sql_kk = "SELECT PRE_TIME,PRE_POWER FROM SPPS_PREDICT_CDQ_DEAL WHERE PRE_DATE='now_date()' ORDER BY PRE_TIME"
         sql = sql_kk.replace("now_date()", now_date())
         list_cdq_sql = get_oracle_h(sql, 2)
         print('超短期表格数据为:', list_cdq)
         print('超短期sql数据为', list_cdq_sql)
         print('\n')
         self.assertEqual(list_cdq, list_cdq_sql)
Beispiel #8
0
 def test_2_ycll(self):
     '''实时状态监控 > 预测理论功率曲线 > 预测理论功率'''
     list_ycll_yuan = get_col_two(list_heng, 3)
     list_ycll = del_list_tup(list_ycll_yuan, ' ')
     if list_ycll == []:
         print("列表查询数据为空,无法比较")
     else:
         sql_kk = "SELECT a.PRE_TIME,a.PRE_POWER FROM SPPS_PREDICT_CDQ_DEAL_PH a WHERE PRE_DATE='now_date()' ORDER BY PRE_TIME"
         sql = sql_kk.replace("now_date()", now_date())
         list_ycll_sql = get_oracle_h(sql, 2)
         print('预测理论功率表格数据为:', list_ycll)
         print('预测理论功率sql数据为', list_ycll_sql)
         print('\n')
         self.assertEqual(list_ycll, list_ycll_sql)
Beispiel #9
0
 def test_3_zyg(self):
     '''实时状态监控 > 理论功率曲线 > 总有功'''
     list_zyg_yuan = get_col_two(list_heng, 5)
     list_zyg = del_list_tup(list_zyg_yuan, ' ')
     if list_zyg == []:
         print("列表查询数据为空,无法比较")
     else:
         sql_kk = "SELECT a.GATHER_TIME,a.POWER_VALUE FROM GF_SPPS_POWER_HIS a WHERE a.GATHER_DATE='now_date()' ORDER BY a.GATHER_TIME"
         sql = sql_kk.replace("now_date()", now_date())
         list_zyg_sql = get_oracle_h(sql, 2)
         print('总有功表格数据为:', list_zyg)
         print('总有功sql数据为', list_zyg_sql)
         print('\n')
         self.assertEqual(list_zyg, list_zyg_sql)
Beispiel #10
0
 def test_2_jc(self):
     '''实时状态监控 > 实时气象曲线 > 实时监测温度'''
     list_jc_yuan = get_col_two(list_heng, 3)
     list_jc = del_list_tup(list_jc_yuan, ' ')
     if list_jc == []:
         print("列表查询数据为空,无法比较")
     else:
         sql_kk = "SELECT a.COLLECTION_TIME,a.ARI_TEM FROM SPPS_FZYI_MON_HIS a WHERE a.COLLECTION_DATE='now_date()' ORDER BY a.COLLECTION_TIME"
         sql = sql_kk.replace("now_date()", now_date())
         list_jc_sql = get_oracle_h(sql, 2)
         print('实时监测温度表格数据为:', list_jc)
         print('实时监测温度sql数据为', list_jc_sql)
         print('\n')
         self.assertEqual(list_jc, list_jc_sql)
Beispiel #11
0
    def test_3_rlj(self):
        '''实时状态监控 > 发电量曲线 > 日累计发电量'''
        list_rlj_yuan = get_col_two(list_heng, 4)
        list_rlj = del_list_tup(list_rlj_yuan, ' ')
        if list_rlj == []:
            print("列表查询数据为空,无法比较")
        else:
            sql_kk = "SELECT a.FOCA_TIME,a.POWER_GENERATION \
FROM GF_SPPS_PROD_THEORY a WHERE a.FOCA_DATE='now_date()' and mod(to_char(to_date(a.foca_time,'HH24:mi:ss'),'mi'),15)=0 ORDER BY a.FOCA_TIME asc"
            sql = sql_kk.replace("now_date()", now_date())
            list_rlj_sql = get_oracle_h(sql, 2)
            print('日累计发电量表格数据为:', list_rlj)
            print('日累计发电量sql数据为', list_rlj_sql)
            print('\n')
            self.assertEqual(list_rlj, list_rlj_sql)
Beispiel #12
0
    def test_2_llgl(self):
        '''功率曲线展示 > 短期上报曲线 > 理论功率'''
        list_llgl_yuan = get_col(list_heng, 4)
        list_llgl = del_list_tup(list_llgl_yuan, ' ')
        if list_llgl == []:
            print("列表查询数据为空,无法比较")
        else:
            sql_kk = "SELECT a.FOCA_DATE,a.FOCA_TIME,a.THEORY_NUM FROM GF_SPPS_PROD_THEORY a \
WHERE a.FOCA_DATE='now_date()' and mod(to_char(to_date(a.foca_time,'HH24:mi:ss'),'mi'),15)=0 ORDER BY a.FOCA_TIME asc"
            sql = sql_kk.replace("now_date()", now_date())
            list_llgl_sql = get_oracle_h(sql, 2)
            print('理论功率表格数据为:', list_llgl)
            print('理论功率sql数据为', list_llgl_sql)
            print('\n')
            self.assertEqual(list_llgl, list_llgl_sql)
Beispiel #13
0
    def test_4_qg(self):
        '''实时状态监控 > 理论功率曲线 > 弃光功率'''
        list_qg_yuan = get_col_two(list_heng, 4)
        list_qg = del_list_tup(list_qg_yuan, ' ')
        if list_qg == []:
            print("列表查询数据为空,无法比较")
        else:
            sql_kk = "SELECT a.FOCA_TIME,a.ABAN_NUM FROM GF_SPPS_PROD_THEORY a \
WHERE a.FOCA_DATE='now_date()' and mod(to_char(to_date(a.foca_time,'HH24:mi:ss'),'mi'),15)=0 ORDER BY a.FOCA_TIME asc"
            sql = sql_kk.replace("now_date()", now_date())
            list_qg_sql = get_oracle_h(sql, 3)
            print('弃光功率表格数据为:', list_qg)
            print('弃光功率sql数据为', list_qg_sql)
            print('\n')
            self.assertEqual(list_qg, list_qg_sql)
Beispiel #14
0
    def test_5_4h(self):
        '''功率曲线展示 > 短期上报曲线 > 4h预测功率'''
        list_4h_yuan = get_col(list_heng, 7)
        list_4h = del_list_tup(list_4h_yuan, ' ')
        if list_4h == []:
            print("列表查询数据为空,无法比较")
        else:
            sql_kk = "SELECT a.PRE_DATE,a.PRE_TIME,a.PRE_POWER \
FROM SPPS_PREDICT_CDQ_HIS a WHERE POINT='240' AND PRE_DATE='now_date()'  ORDER BY PRE_TIME asc"
            sql = sql_kk.replace("now_date()", now_date())
            list_4h_sql = get_oracle_h(sql, 2)
            print('4h理论功率表格数据为:', list_4h)
            print('4h理论功率sql数据为', list_4h_sql)
            print('\n')
            self.assertEqual(list_4h, list_4h_sql)
Beispiel #15
0
    def test_6_ybll_two(self):
        '''实时状态监控 > 理论功率曲线 > 样板理论功率>两天'''
        list_ybll_yuan = get_col_two(list_heng, 3)
        list_ybll = del_list_tup(list_ybll_yuan, ' ')
        if list_ybll == []:
            print("列表查询数据为空,无法比较")
        else:
            sql_kk = "SELECT a.FOCA_TIME,a.MODE_NUM FROM GF_SPPS_PROD_THEORY a WHERE a.FOCA_DATE in('yes_date()','now_date()') \
and mod(to_char(to_date(a.foca_time,'HH24:mi:ss'),'mi'),15)=0 ORDER BY a.FOCA_DATE,a.FOCA_TIME asc"
            sql = sql_kk.replace("now_date()", now_date())
            sql = sql.replace("yes_date()", yes_date())
            list_ybll_sql = get_oracle_h(sql, 2)
            print('样板理论功率表格数据为:', list_ybll)
            print('样板理论功率sql数据为', list_ybll_sql)
            print('\n')
            self.assertEqual(list_ybll, list_ybll_sql)
Beispiel #16
0
    def test_9_1h(self):
        '''功率曲线展示 > 短期上报曲线 > 1h预测功率>2天'''
        list_1h_yuan = get_col(list_heng, 6)
        list_1h = del_list_tup(list_1h_yuan, ' ')
        if list_1h == []:
            print("列表查询数据为空,无法比较")
        else:
            sql_kk = "SELECT a.PRE_DATE,a.PRE_TIME,a.PRE_POWER \
FROM SPPS_PREDICT_CDQ_HIS a WHERE POINT='60' AND PRE_DATE in ('yes_date()','now_date()') ORDER BY a.PRE_DATE,a.PRE_TIME asc"
            sql = sql_kk.replace("now_date()", now_date())
            sql = sql.replace("yes_date()", yes_date())
            list_1h_sql = get_oracle_h(sql, 2)
            print('1h理论功率表格数据为:', list_1h)
            print('1h理论功率sql数据为', list_1h_sql)
            print('\n')
            self.assertEqual(list_1h, list_1h_sql)
Beispiel #17
0
#coding=utf-8
from conf import getpath,menu
getpath()
import unittest
import time
from club.table_test.public.start import start,choose
# from club.table_test.public.menu import menu
from club.table_test.public.set_date import set_date,now_time,now_date
from club.table_test.public.get_heng import get_heng
from club.table_test.public.get_col import get_col,del_list_tup
from club.table_test.public.get_oracle import get_oracle_h
print(now_date())
# now
sql="SELECT a.PRE_DATE,a.PRE_TIME,a.ARI_TEM FROM GF_SPPS_NWP_DEAL a WHERE PRE_DATE='now_date()' ORDER BY PRE_TIME asc"
sql_kk=sql.replace("now_date()",now_date())
print(sql_kk)
list_shiche_sql=get_oracle_h('192.168.60.36',sql_kk,2)
print('实测监测温度表格数据为:',list_shiche_sql)
print('\n')
            # self.assertEqual(list_shiche,list_shiche_sql)
    # def tearDown(self):
    #     self.driver.close()
if __name__ == '__main__':
    unittest.main()