Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Songselenium
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
宋鹏博
Songselenium
Commits
997f2f57
Commit
997f2f57
authored
Jan 23, 2025
by
宋鹏博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
3d74f37c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
47 deletions
+57
-47
untils.py
common/untils.py
+3
-12
config.py
config.py
+44
-27
AIEditingRoomPage.py
paga/AIEditingRoomPage.py
+5
-3
AiPrequalificationPage.py
paga/AiPrequalificationPage.py
+1
-1
test_Aireview.py
script/test_Aireview.py
+2
-2
test_prequalification.py
script/test_prequalification.py
+2
-2
No files found.
common/untils.py
View file @
997f2f57
import
time
from
selenium
import
webdriver
from
appium
import
webdriver
as
appwebdriver
...
...
@@ -9,13 +8,14 @@ from config import appium_server_url, caps
class
DriverTools
:
__driver
=
None
__app_driver
=
None
chrome_options
=
None
chrome_options
=
None
# 初始化web驱动
@classmethod
def
get_driver
(
cls
):
if
cls
.
__driver
is
None
:
cls
.
chrome_options
=
Options
()
cls
.
chrome_options
.
add_argument
(
"--headless"
)
#
cls.chrome_options.add_argument("--headless")
cls
.
__driver
=
webdriver
.
Chrome
(
chrome_options
=
cls
.
chrome_options
)
cls
.
__driver
.
maximize_window
()
cls
.
__driver
.
implicitly_wait
(
10
)
...
...
@@ -44,12 +44,3 @@ class DriverTools:
cls
.
__app_driver
=
None
if
__name__
==
'__main__'
:
# 测试web驱动
DriverTools
.
get_driver
()
.
get
(
'https://rays7.5rs.me/login'
)
time
.
sleep
(
2
)
# # 测试app驱动
# DriverTools.get_app_driver()
# time.sleep(2)
# DriverTools.quit_app_driver()
config.py
View file @
997f2f57
...
...
@@ -12,47 +12,64 @@ caps = {
"appActivity"
:
"com.android.settings.Settings"
# 启动应用界面名
}
appium_server_url
=
"http://127.0.0.1:4723/wd/hub"
# 本机测试路径
# path = r"D:\uifile\\"
# path = path[0:-1]
# 服务器路径
path
=
"/root/uifile/"
# 审校文件
updata_pdf_path
=
r"D:\uifile\七下英语活页.pdf"
updata_word_path
=
r"D:\uifile\司令的女人.docx"
updata_picture_path
=
r"D:\uifile\图片检测.png"
updata_video_path
=
r"D:\uifile\血腥.mp4"
updata_qrcode_path
=
r"D:\uifile\首屏涉黄涉政二维码.png"
updata_traditional_path
=
r"D:\uifile\繁体字测试.docx"
updata_music_path
=
r"D:\uifile\审校音频.mp3"
updata_pdf_name
=
"七下英语活页.pdf"
updata_pdf_path
=
path
+
updata_pdf_name
updata_word_name
=
"司令的女人.docx"
updata_word_path
=
path
+
updata_word_name
updata_picture_name
=
"图片检测.png"
updata_picture_path
=
path
+
updata_picture_name
updata_video_name
=
"血腥.mp4"
updata_video_path
=
path
+
updata_video_name
updata_qrcode_name
=
"首屏涉黄涉政二维码.png"
updata_qrcode_path
=
path
+
updata_qrcode_name
updata_traditional_name
=
"繁体字测试.docx"
updata_traditional_path
=
path
+
updata_traditional_name
updata_music_name
=
"审校音频.mp3"
updata_music_path
=
path
+
updata_music_name
word_text
=
r'司令在省城犯了死罪的消息传到村里之前,我们一直认为他是我们这茬人里最有福气的一个。司令是外号,他的乳名叫八月,学名叫孙国栋。我们在村子里念小学时,他的外号就叫响了,连我们那个爱好写诗、开口就合辙押韵的李诗经老师也叫。李老师给我们上语文课,看到黑板不干净,就说:"司令同学,请你上前;抬起你脸,擦擦黑板;小心灰尘,迷了你眼!""唉!"他爽快地答应着走上讲台擦黑板。受李诗经老师影响,我们也喜欢说四言句。李老师说,天下的诗歌、文章,都是从四言句化出来的,只要四言诗作得好,那就是一鞭一道痕,一掌一掴血,一刀一个窟窿,那就没有什么文体能难住你了。星期天我们约司令去放牛,站在大街上 - -他家临街 - -齐声喊叫:"司令司令,你这懒种;日上三竿,太阳晒腚。东洼放牛,南洼割草;沟里摸鱼,河里洗澡;你去不去?不去拉倒。"司令的娘孙寡妇从屋子里走出来,将半截身体探出土墙,不高兴地说:"你们这些孩子,怎么叫俺司令呢?俺有大号的,俺叫孙国栋。""大婶大婶,不要翻脸,我们保证,不再乱喊。"我们真诚地向她道着歉,然后大声喊叫:"司令司令,你真能磨,大闺女上轿,没你罗嗦!"司令攥着一块地瓜从屋子里蹿出来,大声嚷着:"别急别急,各位伙计,若不等我,不够意思!"司令娘对司令说:"往后他们叫你司令不许答应!"司令在我们那班差不多大小的孩子里是个头蹿得最高的,据说他的爹就是个大个子,大个子爹做出大个子儿,天经地义。他的爹外号叫旅长,爹旅长,儿司令,一代更比一代强。也许他的外号就是从他爹的外号的基础上提拔起来的?谁知道呢!司令的爹六○年生活困难时撑死了 - -一架飞机掉在我们村头上,司令的爹和几个村民用担架将受伤的飞行员送到机场,机场里抬出一筐馒头慰劳他们,司令的爹贪食,一口气吃了十七个。口家的路上,走着走着,嘭的一 '
knowledge_text
=
"测试"
find_word_text
=
"测试工程师"
file_name
=
"七下英语活页.pdf"
# 测试环境编辑empid
# AI_review_empid = 2372
# AI_Prequalification_empid = 16583
# 生产环境编辑empid
AI_review_empid
=
4236
AI_Prequalification_empid
=
87834
# 测试环境域名
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
=
1002164
#
userid = 1002164
# 生产环境用户id
#
userid = 1000032332
userid
=
1000032332
# 测试环境账号密码
user_name
=
"13837988386"
password
=
"Aa1012436291"
#
user_name = "13837988386"
#
password = "Aa1012436291"
# # 生产环境账号密码
#
user_name = "17711331133"
#
password = "Qwe123456"
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
=
"aireview110"
database_pwd
=
"4yFSvSBc"
database
=
"aireview"
port
=
3306
paga/AIEditingRoomPage.py
View file @
997f2f57
from
selenium.webdriver.common.by
import
By
from
Base.BasePage
import
BasePage
from
config
import
AI_review_empid
,
AI_Prequalification_empid
# AI编辑工作室首页
class
AIER
(
BasePage
):
def
__init__
(
self
):
super
()
.
__init__
(
'web'
)
# AI编辑室
self
.
AI_review
=
(
By
.
CSS_SELECTOR
,
"div[id='studio-empId-2372'] div[class='studio-item-inner']"
)
self
.
AI_Prequalification
=
(
By
.
CSS_SELECTOR
,
"div[id='studio-empId-16583'] div[class='studio-item-inner']"
)
# AI审校编辑
self
.
AI_review
=
(
By
.
CSS_SELECTOR
,
f
"div[id='studio-empId-{AI_review_empid}'] div[class='studio-item-inner']"
)
# AI预审编辑
self
.
AI_Prequalification
=
(
By
.
CSS_SELECTOR
,
f
"div[id='studio-empId-{AI_Prequalification_empid}'] div[class='studio-item-inner']"
)
# 点击AI预审
def
to_AI_Prequalification
(
self
):
...
...
paga/AiPrequalificationPage.py
View file @
997f2f57
...
...
@@ -19,5 +19,5 @@ class Aiprequalification(BasePage):
self
.
find_ele
(
self
.
update_key
)
.
click
()
time
.
sleep
(
2
)
self
.
find_ele
(
self
.
update_file
)
.
send_keys
(
updata_path
)
time
.
sleep
(
2
)
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
send_file
)
.
click
()
script/test_Aireview.py
View file @
997f2f57
...
...
@@ -4,7 +4,7 @@ from common.DButils import DButils
from
common.untils
import
DriverTools
from
config
import
user_name
,
password
,
updata_word_path
,
word_text
,
\
updata_traditional_path
,
updata_music_path
,
updata_qrcode_path
,
updata_video_path
,
updata_picture_path
,
\
knowledge_text
,
login_url
,
userid
knowledge_text
,
login_url
,
userid
,
updata_word_name
from
paga.AIEditingRoomPage
import
AIER
from
paga.AiPrequalificationPage
import
Aiprequalification
from
paga.AiReviewPage
import
Aireview
...
...
@@ -38,7 +38,7 @@ class TestAireview:
f
'SELECT file_name ,status FROM aireview.assistant_task where create_user ={userid} and assistant_code '
'="diction" order by biz_id desc limit 1;'
)
assert
data
[
0
][
0
]
==
"司令的女人.docx"
assert
data
[
0
][
0
]
==
updata_word_name
# 文本审校流程
def
test_text_revierw
(
self
):
...
...
script/test_prequalification.py
View file @
997f2f57
...
...
@@ -2,7 +2,7 @@ import time
from
common.DButils
import
DButils
from
common.untils
import
DriverTools
from
config
import
user_name
,
password
,
updata_pdf_path
,
file_name
,
login_url
,
userid
from
config
import
user_name
,
password
,
updata_pdf_path
,
login_url
,
userid
,
updata_pdf_name
from
paga.AIEditingRoomPage
import
AIER
from
paga.AiPrequalificationPage
import
Aiprequalification
from
paga.LoginPage
import
Login
...
...
@@ -34,5 +34,5 @@ class TestPrequalification:
data
=
self
.
dbtuils
.
select_sql
(
f
"SELECT file_name,status FROM aireview.assistant_task where create_user ={userid} and assistant_code "
"='preliminarytrial' order by biz_id desc limit 1;"
)
assert
data
[
0
][
0
]
==
file
_name
assert
data
[
0
][
0
]
==
updata_pdf
_name
assert
data
[
0
][
1
]
==
99
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