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
eeabd6b3
Commit
eeabd6b3
authored
Jun 17, 2025
by
之约
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
3c0b4611
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
133 deletions
+59
-133
untils.py
common/untils.py
+7
-7
AITopicplanningPaga.py
paga/AITopicplanningPaga.py
+9
-50
test_AIBookreview.py
script/test_AIBookreview.py
+43
-43
test_AITopicplanning.py
script/test_AITopicplanning.py
+0
-33
No files found.
common/untils.py
View file @
eeabd6b3
...
@@ -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
...
...
paga/AITopicplanningPaga.py
View file @
eeabd6b3
...
@@ -21,7 +21,7 @@ class AITopicplanning(BasePage):
...
@@ -21,7 +21,7 @@ class AITopicplanning(BasePage):
# 示例按钮
# 示例按钮
self
.
example_btn
=
(
By
.
XPATH
,
"(//div[@id='exampleButton'])[1]"
)
self
.
example_btn
=
(
By
.
XPATH
,
"(//div[@id='exampleButton'])[1]"
)
# 发送按钮
# 发送按钮
self
.
send_file
=
(
By
.
XPATH
,
"
//button[contains(text(),'发送')
]"
)
self
.
send_file
=
(
By
.
XPATH
,
"
(//i[@class='ic ic-icon-send'])[1
]"
)
# 图书查询按钮
# 图书查询按钮
self
.
book_file
=
(
By
.
XPATH
,
"/html[1]/body[1]/div[2]/div[1]/section[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/span[1]/span[1]/span[2]/input[1]"
)
self
.
book_file
=
(
By
.
XPATH
,
"/html[1]/body[1]/div[2]/div[1]/section[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/span[1]/span[1]/span[2]/input[1]"
)
# 图书示例按钮
# 图书示例按钮
...
@@ -63,56 +63,14 @@ class AITopicplanning(BasePage):
...
@@ -63,56 +63,14 @@ class AITopicplanning(BasePage):
self
.
find_ele
(
self
.
send_file
)
.
click
()
self
.
find_ele
(
self
.
send_file
)
.
click
()
time
.
sleep
(
3
)
time
.
sleep
(
3
)
# AI选题策划编辑-写选题策划案
def
ai_freshnews2
(
self
):
self
.
find_ele
(
self
.
freshnews_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
example_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
send_file
)
.
click
()
time
.
sleep
(
3
)
# AI选题策划编辑-生成选题报告
def
ai_report
(
self
,
Aibook_file_text
):
self
.
find_ele
(
self
.
book_file
)
.
send_keys
(
Aibook_file_text
)
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
searchfor_btn
)
.
click
()
time
.
sleep
(
10
)
self
.
find_ele
(
self
.
report_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
template_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
reporting_btn
)
.
click
()
time
.
sleep
(
5
)
#AI选题策划编辑-去竞品分析
def
ai_analysis
(
self
,
Aibook_file_text
):
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
book_file
)
.
send_keys
(
Aibook_file_text
)
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
searchfor_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
Accumulated_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
style_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
analysis_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
goanalysis_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
goanalysis1_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
competitiveanalysis_btn
)
.
click
()
time
.
sleep
(
5
)
# AI选题策划编辑-导出数据
def
ai_exportdata
(
self
,
Aibook_file_text
):
self
.
find_ele
(
self
.
book_file
)
.
send_keys
(
Aibook_file_text
)
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
searchfor_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
exportdata_btn
)
.
click
()
time
.
sleep
(
3
)
# if __name__ == '__main__':
# driver = DriverTools.get_driver().get("https://aistudio.5rs.me/")
# Login().login("17671436261", "Xf123456")
# AIER().to_AI_Topicplanning()
# AITopicplanning().ai_booktitle()
# time.sleep(3)
# DriverTools.quit_driver()
\ No newline at end of file
script/test_AIBookreview.py
View file @
eeabd6b3
#
import time
import
time
#
import allure
import
allure
#
from common.DButils import DButils
from
common.DButils
import
DButils
#
from common.untils import DriverTools
from
common.untils
import
DriverTools
#
from config import user_name, password,login_url,AiNewmediae_text,updata_AiNewmediae_path
from
config
import
user_name
,
password
,
login_url
,
AiNewmediae_text
,
updata_AiNewmediae_path
#
from paga.AIEditingRoomPage import AIER
from
paga.AIEditingRoomPage
import
AIER
#
from paga.AIBookreviewPaga import AIBookreview
from
paga.AIBookreviewPaga
import
AIBookreview
#
from paga.LoginPage import Login
from
paga.LoginPage
import
Login
#
from common.cutils import ws_error
from
common.cutils
import
ws_error
#
#
AI书评编辑页面ui自动化测试
# AI书评编辑页面ui自动化测试
#
class TestAIBookreview:
class
TestAIBookreview
:
#
# 类前置
# 类前置
#
def setup_class(self):
def
setup_class
(
self
):
#
self.login = Login()
self
.
login
=
Login
()
#
self.AIroom = AIER()
self
.
AIroom
=
AIER
()
#
self.aibookreview = AIBookreview()
self
.
aibookreview
=
AIBookreview
()
#
self.dbtuils = DButils()
self
.
dbtuils
=
DButils
()
#
def setup_method(self):
def
setup_method
(
self
):
#
self.driver = DriverTools.get_driver().get(login_url)
self
.
driver
=
DriverTools
.
get_driver
()
.
get
(
login_url
)
#
self.login.login(user_name, password)
self
.
login
.
login
(
user_name
,
password
)
#
self.AIroom.to_AI_Bookreview()
self
.
AIroom
.
to_AI_Bookreview
()
#
# 类后置
# 类后置
#
def teardown_class(self):
def
teardown_class
(
self
):
#
DriverTools.quit_driver()
DriverTools
.
quit_driver
()
#
# AI书评编辑-文学书评
# AI书评编辑-文学书评
#
@allure.feature("文学书评流程")
@allure.feature
(
"文学书评流程"
)
#
def test_find_Literary(self):
def
test_find_Literary
(
self
):
#
self.aibookreview.ai_Literary()
self
.
aibookreview
.
ai_Literary
()
#
time.sleep(40)
time
.
sleep
(
40
)
#
# AI书评编辑-上传社科书评
# AI书评编辑-上传社科书评
#
@allure.feature("上传社科书评流程")
@allure.feature
(
"上传社科书评流程"
)
#
def test_find_AiNewmediae(self):
def
test_find_AiNewmediae
(
self
):
#
self.aibookreview.update_social_btn(updata_AiNewmediae_path)
self
.
aibookreview
.
update_social_btn
(
updata_AiNewmediae_path
)
#
time.sleep(80)
time
.
sleep
(
80
)
#
ws_error(2)
ws_error
(
2
)
#
time.sleep(3)
time
.
sleep
(
3
)
...
...
script/test_AITopicplanning.py
View file @
eeabd6b3
...
@@ -36,39 +36,6 @@ class TestaiSelectedtopic:
...
@@ -36,39 +36,6 @@ class TestaiSelectedtopic:
ws_error
(
1
)
ws_error
(
1
)
time
.
sleep
(
3
)
time
.
sleep
(
3
)
# AI选题策划编辑-写选题策划案
@allure.feature
(
"写选题策划案流程"
)
def
test_freshnews2
(
self
):
self
.
aitopicplanning
.
ai_freshnews2
()
time
.
sleep
(
90
)
ws_error
(
2
)
time
.
sleep
(
3
)
# AI选题策划编辑-生成选题报告
@allure.feature
(
"生成选题报告流程"
)
def
test_report
(
self
):
self
.
aitopicplanning
.
ai_report
(
Aibook_file_text
)
time
.
sleep
(
150
)
ws_error
(
1
)
time
.
sleep
(
3
)
# AI选题策划编辑-去竞品分析
@allure.feature
(
"去竞品分析流程"
)
def
test_ai_analysis
(
self
):
self
.
aitopicplanning
.
ai_analysis
(
Aibook_file_text
)
time
.
sleep
(
50
)
ws_error
(
1
)
time
.
sleep
(
3
)
# AI选题策划编辑-导出数据
@allure.feature
(
"导出数据流程"
)
def
test_ai_exportdata
(
self
):
self
.
aitopicplanning
.
ai_exportdata
(
Aibook_file_text
)
time
.
sleep
(
15
)
ws_error
(
1
)
time
.
sleep
(
3
)
...
...
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