Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wsmonitor
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
宋鹏博
wsmonitor
Commits
e5f9382a
Commit
e5f9382a
authored
Feb 07, 2025
by
之约
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新推送企业微信
parent
d5b97213
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
28 deletions
+93
-28
untils.py
common/untils.py
+7
-7
config.py
config.py
+24
-20
AIEditingRoomPage.py
paga/AIEditingRoomPage.py
+8
-1
AiNewmediaeditorPage.py
paga/AiNewmediaeditorPage.py
+36
-0
AiPrequalificationPage.py
paga/AiPrequalificationPage.py
+2
-0
AiReviewPage.py
paga/AiReviewPage.py
+16
-0
No files found.
common/untils.py
View file @
e5f9382a
...
@@ -15,14 +15,14 @@ class DriverTools:
...
@@ -15,14 +15,14 @@ class DriverTools:
def
get_driver
(
cls
):
def
get_driver
(
cls
):
if
cls
.
__driver
is
None
:
if
cls
.
__driver
is
None
:
cls
.
__options
=
Options
()
cls
.
__options
=
Options
()
cls
.
__options
.
add_argument
(
'--headless'
)
#
cls.__options.add_argument('--headless')
cls
.
__options
.
add_argument
(
'--disable-gpu'
)
#
cls.__options.add_argument('--disable-gpu')
cls
.
__options
.
add_argument
(
'--no-sandbox'
)
#
cls.__options.add_argument('--no-sandbox')
cls
.
__options
.
add_argument
(
'--disable-dev-shm-usage'
)
#
cls.__options.add_argument('--disable-dev-shm-usage')
cls
.
__options
.
add_argument
(
'--remote-debugging-port=9222'
)
#
cls.__options.add_argument('--remote-debugging-port=9222')
cls
.
__options
.
add_argument
(
'--window-size=1366x768'
)
#
cls.__options.add_argument('--window-size=1366x768')
cls
.
__driver
=
webdriver
.
Chrome
(
options
=
cls
.
__options
)
cls
.
__driver
=
webdriver
.
Chrome
(
options
=
cls
.
__options
)
#
cls.__driver.maximize_window()
cls
.
__driver
.
maximize_window
()
cls
.
__driver
.
implicitly_wait
(
10
)
cls
.
__driver
.
implicitly_wait
(
10
)
return
cls
.
__driver
return
cls
.
__driver
...
...
config.py
View file @
e5f9382a
...
@@ -35,42 +35,46 @@ knowledge_text = "六四"
...
@@ -35,42 +35,46 @@ knowledge_text = "六四"
find_word_text
=
"测试工程师"
find_word_text
=
"测试工程师"
# 测试环境编辑empid
# 测试环境编辑empid
AI_review_empid
=
7555
#
AI_review_empid = 7555
AI_Prequalification_empid
=
16583
#
AI_Prequalification_empid = 16583
# 生产环境编辑empid
# 生产环境编辑empid
# AI_review_empid = 4236
#AI审校编辑
# AI_Prequalification_empid = 87834
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
# 测试环境用户id
userid
=
1002156
#
userid = 1002156
# 生产环境用户id
# 生产环境用户id
# userid = 1000032332
userid
=
1000033979
# 测试环境账号密码
# 测试环境账号密码
user_name
=
"1767143626
6
"
user_name
=
"1767143626
1
"
password
=
"123456"
password
=
"
Xf
123456"
# 生产环境账号密码
# 生产环境账号密码
# user_name = "17711331133"
# user_name = "17711331133"
# password = "Qwe123456"
# password = "Qwe123456"
# 测试环境数据库
# # 测试环境数据库
host
=
"122.112.227.235"
# host = "122.112.227.235"
user
=
"userop"
# user = "userop"
database_pwd
=
"0#ztXqUzECGen8E"
# database_pwd = "0#ztXqUzECGen8E"
database
=
"aireview"
port
=
3306
# # 生产环境数据库
# host = "192.168.8.234"
# user = "aireview110"
# database_pwd = "4yFSvSBc"
# database = "aireview"
# database = "aireview"
# port = 3306
# port = 3306
# 生产环境数据库
host
=
"192.168.8.234"
user
=
"aicaptain110"
database_pwd
=
"ABs4B79c"
database
=
"aicaptain"
port
=
3306
# 微信机器人url
# 微信机器人url
...
...
paga/AIEditingRoomPage.py
View file @
e5f9382a
from
selenium.webdriver.common.by
import
By
from
selenium.webdriver.common.by
import
By
from
Base.BasePage
import
BasePage
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编辑工作室首页
# AI编辑工作室首页
...
@@ -12,6 +12,9 @@ class AIER(BasePage):
...
@@ -12,6 +12,9 @@ class AIER(BasePage):
# AI预审编辑
# AI预审编辑
self
.
AI_Prequalification
=
(
self
.
AI_Prequalification
=
(
By
.
CSS_SELECTOR
,
f
"div[id='studio-empId-{AI_Prequalification_empid}'] div[class='studio-item-inner']"
)
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预审
# 点击AI预审
def
to_AI_Prequalification
(
self
):
def
to_AI_Prequalification
(
self
):
...
@@ -20,3 +23,7 @@ class AIER(BasePage):
...
@@ -20,3 +23,7 @@ class AIER(BasePage):
# 点击AI审校
# 点击AI审校
def
to_AI_review
(
self
):
def
to_AI_review
(
self
):
self
.
find_ele
(
self
.
AI_review
)
.
click
()
self
.
find_ele
(
self
.
AI_review
)
.
click
()
# 点击新媒体编辑
def
to_AI_Newmediaeditor
(
self
):
self
.
find_ele
(
self
.
AI_Newmediaeditor
)
.
click
()
paga/AiNewmediaeditorPage.py
0 → 100644
View file @
e5f9382a
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
()
paga/AiPrequalificationPage.py
View file @
e5f9382a
...
@@ -21,3 +21,5 @@ class Aiprequalification(BasePage):
...
@@ -21,3 +21,5 @@ class Aiprequalification(BasePage):
self
.
find_ele
(
self
.
update_file
)
.
send_keys
(
updata_path
)
self
.
find_ele
(
self
.
update_file
)
.
send_keys
(
updata_path
)
time
.
sleep
(
5
)
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
send_file
)
.
click
()
self
.
find_ele
(
self
.
send_file
)
.
click
()
paga/AiReviewPage.py
View file @
e5f9382a
...
@@ -117,3 +117,19 @@ class Aireview(BasePage):
...
@@ -117,3 +117,19 @@ class Aireview(BasePage):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
find_ele
(
self
.
send_btn
)
.
click
()
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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment