Commit e5f9382a by 之约

更新推送企业微信

parent d5b97213
......@@ -15,14 +15,14 @@ class DriverTools:
def get_driver(cls):
if cls.__driver is None:
cls.__options = Options()
cls.__options.add_argument('--headless')
cls.__options.add_argument('--disable-gpu')
cls.__options.add_argument('--no-sandbox')
cls.__options.add_argument('--disable-dev-shm-usage')
cls.__options.add_argument('--remote-debugging-port=9222')
cls.__options.add_argument('--window-size=1366x768')
# cls.__options.add_argument('--headless')
# cls.__options.add_argument('--disable-gpu')
# cls.__options.add_argument('--no-sandbox')
# cls.__options.add_argument('--disable-dev-shm-usage')
# cls.__options.add_argument('--remote-debugging-port=9222')
# cls.__options.add_argument('--window-size=1366x768')
cls.__driver = webdriver.Chrome(options=cls.__options)
# cls.__driver.maximize_window()
cls.__driver.maximize_window()
cls.__driver.implicitly_wait(10)
return cls.__driver
......
......@@ -35,42 +35,46 @@ knowledge_text = "六四"
find_word_text = "测试工程师"
# 测试环境编辑empid
AI_review_empid = 7555
AI_Prequalification_empid = 16583
# AI_review_empid = 7555
# AI_Prequalification_empid = 16583
# 生产环境编辑empid
# AI_review_empid = 4236
# AI_Prequalification_empid = 87834
#AI审校编辑
AI_review_empid = 53557
#AI预审编辑
AI_Prequalification_empid = 105059
#AI新媒体编辑
AI_Newmediaeditor_empid=53550
# 测试环境域名
login_url = "https://aistudio.raysgo.com/login"
# login_url = "https://aistudio.raysgo.com/login"
# 生产环境域名
# login_url = "https://aistudio.5rs.me/login"
login_url = "https://aistudio.5rs.me/login"
# 测试环境用户id
userid = 1002156
# userid = 1002156
# 生产环境用户id
# userid = 1000032332
userid = 1000033979
# 测试环境账号密码
user_name = "17671436266"
password = "123456"
user_name = "17671436261"
password = "Xf123456"
# 生产环境账号密码
# user_name = "17711331133"
# password = "Qwe123456"
# 测试环境数据库
host = "122.112.227.235"
user = "userop"
database_pwd = "0#ztXqUzECGen8E"
database = "aireview"
port = 3306
# # 生产环境数据库
# host = "192.168.8.234"
# user = "aireview110"
# database_pwd = "4yFSvSBc"
# # 测试环境数据库
# host = "122.112.227.235"
# user = "userop"
# database_pwd = "0#ztXqUzECGen8E"
# database = "aireview"
# port = 3306
# 生产环境数据库
host = "192.168.8.234"
user = "aicaptain110"
database_pwd = "ABs4B79c"
database = "aicaptain"
port = 3306
# 微信机器人url
......
from selenium.webdriver.common.by import By
from Base.BasePage import BasePage
from config import AI_review_empid, AI_Prequalification_empid
from config import AI_review_empid, AI_Prequalification_empid,AI_Newmediaeditor_empid
# AI编辑工作室首页
......@@ -12,6 +12,9 @@ class AIER(BasePage):
# AI预审编辑
self.AI_Prequalification = (
By.CSS_SELECTOR, f"div[id='studio-empId-{AI_Prequalification_empid}'] div[class='studio-item-inner']")
# AI新媒体编辑
self.AI_Newmediaeditor = (
By.CSS_SELECTOR, f"div[id='studio-empId-{AI_Newmediaeditor_empid}'] div[class='studio-item-inner']")
# 点击AI预审
def to_AI_Prequalification(self):
......@@ -20,3 +23,7 @@ class AIER(BasePage):
# 点击AI审校
def to_AI_review(self):
self.find_ele(self.AI_review).click()
# 点击新媒体编辑
def to_AI_Newmediaeditor(self):
self.find_ele(self.AI_Newmediaeditor).click()
import time
from selenium.webdriver.common.by import By
from Base.BasePage import BasePage
from common.DButils import DButils
from common.untils import DriverTools
from paga.AIEditingRoomPage import AIER
from paga.LoginPage import Login
from common.cutils import ws_error
# AI新媒体编辑页面
class AiNewmediaeditorPage(BasePage):
def __init__(self):
super().__init__('web')
# 更多按钮
self.more_btn = (By.XPATH, "(//div[@class='button-list-item more-btn hover-bg-color hover-text-color'])[1]")
# 微博图书推文
self.Weibo_book = (By.XPATH, "//div[@class='button-typ-item']//div[@class='name'][contains(text(),'微博图书推文')]")
# 示例按钮
self.example_btn = (By.XPATH, "(//div[@id='exampleButton'])[1]")
# 发送按钮
self.send_file = (By.XPATH, "//button[contains(text(),'发送')]")
# 上传文件
self.update_file=(By.XPATH,"(//input[@id='file'])[2]")
def ai_Weibo(self):
self.find_ele(self.more_btn).click()
time.sleep(3)
self.find_ele(self.Weibo_book).click()
time.sleep(3)
self.find_ele(self.example_btn).click()
time.sleep(3)
self.find_ele(self.send_file).click()
......@@ -21,3 +21,5 @@ class Aiprequalification(BasePage):
self.find_ele(self.update_file).send_keys(updata_path)
time.sleep(5)
self.find_ele(self.send_file).click()
......@@ -117,3 +117,19 @@ class Aireview(BasePage):
time.sleep(1)
self.find_ele(self.send_btn).click()
if __name__ == '__main__':
driver = DriverTools.get_driver().get("https://aistudio.raysgo.com/login")
Login().login("13837988386", "Aa1012436291")
AIER().to_AI_review()
Aireview().find_knowledge("六四")
time.sleep(5)
data = DButils().select_sql(
"select content from aicaptain.message_record mr where adviser_id =1002164 order by create_time desc limit 1 ;")
str = "无法回答此类问题,请换个话题吧。"
if str in data[0][0]:
error_message("ws消息异常")
else:
error_message("ws消息正常")
DriverTools.quit_driver()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment