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
481eebc2
Commit
481eebc2
authored
Jul 02, 2025
by
之约
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
d173d6f7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
196 additions
and
192 deletions
+196
-192
AIBookreviewPaga.py
paga/AIBookreviewPaga.py
+14
-3
AIDigitalcreationPaga.py
paga/AIDigitalcreationPaga.py
+112
-119
test_AIDigitalcreation.py
script/test_AIDigitalcreation.py
+70
-70
No files found.
paga/AIBookreviewPaga.py
View file @
481eebc2
...
...
@@ -19,17 +19,19 @@ class AIBookreview(BasePage):
# 示例按钮
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
.
social_btn
=
(
By
.
XPATH
,
"(//div[@class='name'][contains(text(),'社科书评')])[1]"
)
# 上传书稿按钮
self
.
update_btn
=
(
By
.
XPATH
,
"(//
span[contains(text(),'上传书稿')
])[1]"
)
self
.
update_btn
=
(
By
.
XPATH
,
"(//
i[@class='ic ic-shangchuanwenjian1'
])[1]"
)
# 书评模板按钮
self
.
template_btn
=
(
By
.
XPATH
,
"(//span[@title='人民日报'])[1]"
)
# 豆瓣书评模板
self
.
bean_btn
=
(
By
.
XPATH
,
"(//div[@class='ant-select-item-option-content'][contains(text(),'豆瓣书评')])[1]"
)
# 上传书稿文件
self
.
update_file
=
(
By
.
XPATH
,
"//input[@id='file']"
)
# 图书名称
self
.
book_btn
=
(
By
.
XPATH
,
"(//div[@contenteditable='true'])[2]"
)
...
...
@@ -48,11 +50,20 @@ class AIBookreview(BasePage):
self
.
find_ele
(
self
.
template_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
bean_btn
)
.
click
()
time
.
sleep
(
3
)
time
.
sleep
(
4
)
self
.
find_ele
(
self
.
update_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
update_file
)
.
send_keys
(
updata_path
)
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
book_btn
)
.
send_keys
(
"四川故事"
)
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
send_file
)
.
click
()
# if __name__ == '__main__':
# driver = DriverTools.get_driver().get("https://aistudio.5rs.me/")
# Login().login("17671436261", "Xf123456")
# AIER().to_AI_Bookreview()
# AIBookreview().update_social_btn(updata_AiNewmediae_path)
# time.sleep(10)
# DriverTools.quit_driver()
paga/AIDigitalcreationPaga.py
View file @
481eebc2
# 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
# from config import Aiperiodicals_text
#
#
#
# # AI数字创作编辑
# class AIDigitalcreation(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]")
# # 制作教辅课件类PPT按钮
# self.ppt_btn = (By.XPATH, "(//div[@class='name'][contains(text(),'制作教辅课件类PPT')])[2]")
# # 示例按钮
# self.example_btn = (By.XPATH, "(//div[@id='exampleButton'])[1]")
# # 发送按钮
# self.send_file = (By.XPATH, "(//button[contains(text(),'发送')])[1]")
# # 点击PPT确认内容按钮
# self.content_btn = (By.XPATH, "(//div[@class='fileName'])[1]")
# # 生成PPT按钮
# self.generatePPT_btn=(By.XPATH,"(//button[@type='button'])[1]")
# # 现代纸书一键制作与资源配置按钮
# self.modern_btn = (By.XPATH, "//div[contains(@class,'ant-popover button-list-more-popover ant-popover-placement-topRight')]//div[2]//div[2]//div[1]//div[1]//div[1]")
# # 书刊名称输入框
# self.periodicals_input = (By.XPATH, "(//input[@placeholder='请输入书刊名称'])[1]")
# # 点击查询按钮
# self.inquire_btn = (By.XPATH, "(//span[contains(text(),'点击查询')])[1]")
# # 点击配置资源按钮
# self.natural_btn = (By.XPATH, "(//label[@class='ant-checkbox-wrapper ant-checkbox-group-item'])[1]")
# # 点击一键制作按钮
# self.make_btn = (By.XPATH, "(//button[@class='ant-btn ant-btn-primary'])[1]")
# # 点击提供资源选题方案灵感按钮
# self.scheme_btn = (By.XPATH, "(//div[@class='name'][contains(text(),'提供资源选题方案灵感')])[2]")
# # 点击书刊分类-K12中小学教辅按钮
# self.periodicals_btn = (By.XPATH, "(//div[@class='ant-cascader-menu-item-content'][contains(text(),'K12中小学教辅')])[1]")
# # 点击书刊分类-幼小衔接按钮
# self.school_btn = (By.XPATH, "(//div[@class='ant-cascader-menu-item-content'][contains(text(),'幼小衔接')])[1]")
# # 点击书刊分类-语文按钮
# self.chinese_btn = (By.XPATH, "(//div[@class='ant-cascader-menu-item-content'][contains(text(),'语文')])[1]")
# # 点击确定按钮
# self.sure_btn = (By.XPATH, "(//span[contains(text(),'确定')])[1]")
# # 点击制作浓缩书配音按钮
# self.concentratedbook_btn = (By.XPATH, "(//div[@class='name'][contains(text(),'制作浓缩书配音')])[2]")
#
#
#
# # 制作教辅课件类PPT
# def ai_ppt(self):
# self.find_ele(self.more_btn).click()
# time.sleep(5)
# self.find_ele(self.ppt_btn).click()
# time.sleep(5)
# self.find_ele(self.example_btn).click()
# time.sleep(5)
# self.find_ele(self.send_file).click()
# time.sleep(30)
# self.find_ele(self.content_btn).click()
# time.sleep(3)
# self.find_ele(self.generatePPT_btn).click()
#
#
# # 现代纸书一键制作
# def modern_paper_book(self,txt):
# self.find_ele(self.more_btn).click()
# time.sleep(5)
# self.find_ele(self.modern_btn).click()
# time.sleep(5)
# self.find_ele(self.periodicals_input).send_keys(txt)
# time.sleep(5)
# self.find_ele(self.inquire_btn).click()
# time.sleep(5)
# self.find_ele(self.natural_btn).click()
# time.sleep(3)
# self.find_ele(self.make_btn).click()
#
# # 提供资源选题方案灵感
# def ai_scheme(self):
# self.find_ele(self.more_btn).click()
# time.sleep(3)
# self.find_ele(self.scheme_btn).click()
# time.sleep(3)
# self.find_ele(self.periodicals_btn).click()
# time.sleep(3)
# self.find_ele(self.school_btn).click()
# time.sleep(3)
# self.find_ele(self.chinese_btn).click()
# time.sleep(3)
# self.find_ele(self.sure_btn).click()
# time.sleep(3)
#
# # 制作浓缩书配音
# def ai_concentratedbook(self):
# self.find_ele(self.more_btn).click()
# time.sleep(3)
# self.find_ele(self.concentratedbook_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)
#
#
#
# if __name__ == '__main__':
# driver = DriverTools.get_driver().get("https://aistudio.5rs.me/")
# Login().login("17671436261", "Xf123456")
# AIER().to_AI_Digitalcreation()
# AIDigitalcreation().ai_concentratedbook()
# time.sleep(10)
# DriverTools.quit_driver()
#
#
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
from
config
import
Aiperiodicals_text
# AI数字创作编辑
class
AIDigitalcreation
(
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]"
)
# 制作教辅课件类PPT按钮
self
.
ppt_btn
=
(
By
.
XPATH
,
"(//div[@class='name'][contains(text(),'制作教辅课件类PPT')])[2]"
)
# 示例按钮
self
.
example_btn
=
(
By
.
XPATH
,
"(//div[@id='exampleButton'])[1]"
)
# 发送按钮
self
.
send_file
=
(
By
.
XPATH
,
"(//button[contains(text(),'发送')])[1]"
)
# 点击PPT确认内容按钮
self
.
content_btn
=
(
By
.
XPATH
,
"(//div[@class='fileName'])[1]"
)
# 生成PPT按钮
self
.
generatePPT_btn
=
(
By
.
XPATH
,
"(//button[@type='button'])[1]"
)
# 现代纸书一键制作与资源配置按钮
self
.
modern_btn
=
(
By
.
XPATH
,
"//div[contains(@class,'ant-popover button-list-more-popover ant-popover-placement-topRight')]//div[2]//div[2]//div[1]//div[1]//div[1]"
)
# 书刊名称输入框
self
.
periodicals_input
=
(
By
.
XPATH
,
"(//input[@placeholder='请输入书刊名称'])[1]"
)
# 点击查询按钮
self
.
inquire_btn
=
(
By
.
XPATH
,
"(//span[contains(text(),'点击查询')])[1]"
)
# 点击配置资源按钮
self
.
natural_btn
=
(
By
.
XPATH
,
"(//label[@class='ant-checkbox-wrapper ant-checkbox-group-item'])[1]"
)
# 点击一键制作按钮
self
.
make_btn
=
(
By
.
XPATH
,
"(//button[@class='ant-btn ant-btn-primary'])[1]"
)
# 点击提供资源选题方案灵感按钮
self
.
scheme_btn
=
(
By
.
XPATH
,
"(//div[@class='name'][contains(text(),'提供资源选题方案灵感')])[2]"
)
# 点击书刊分类-K12中小学教辅按钮
self
.
periodicals_btn
=
(
By
.
XPATH
,
"(//div[@class='ant-cascader-menu-item-content'][contains(text(),'K12中小学教辅')])[1]"
)
# 点击书刊分类-幼小衔接按钮
self
.
school_btn
=
(
By
.
XPATH
,
"(//div[@class='ant-cascader-menu-item-content'][contains(text(),'幼小衔接')])[1]"
)
# 点击书刊分类-语文按钮
self
.
chinese_btn
=
(
By
.
XPATH
,
"(//div[@class='ant-cascader-menu-item-content'][contains(text(),'语文')])[1]"
)
# 点击确定按钮
self
.
sure_btn
=
(
By
.
XPATH
,
"(//span[contains(text(),'确定')])[1]"
)
# 点击制作浓缩书配音按钮
self
.
concentratedbook_btn
=
(
By
.
XPATH
,
"(//div[@class='name'][contains(text(),'制作浓缩书配音')])[2]"
)
# 制作教辅课件类PPT
def
ai_ppt
(
self
):
self
.
find_ele
(
self
.
more_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
ppt_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
example_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
send_file
)
.
click
()
time
.
sleep
(
30
)
self
.
find_ele
(
self
.
content_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
generatePPT_btn
)
.
click
()
# 现代纸书一键制作
def
modern_paper_book
(
self
,
txt
):
self
.
find_ele
(
self
.
more_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
modern_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
periodicals_input
)
.
send_keys
(
txt
)
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
inquire_btn
)
.
click
()
time
.
sleep
(
5
)
self
.
find_ele
(
self
.
natural_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
make_btn
)
.
click
()
# 提供资源选题方案灵感
def
ai_scheme
(
self
):
self
.
find_ele
(
self
.
more_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
scheme_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
periodicals_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
school_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
chinese_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
sure_btn
)
.
click
()
time
.
sleep
(
3
)
# 制作浓缩书配音
def
ai_concentratedbook
(
self
):
self
.
find_ele
(
self
.
more_btn
)
.
click
()
time
.
sleep
(
3
)
self
.
find_ele
(
self
.
concentratedbook_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
)
script/test_AIDigitalcreation.py
View file @
481eebc2
import
time
import
allure
from
common.DButils
import
DButils
from
common.untils
import
DriverTools
from
config
import
user_name
,
password
,
login_url
,
Aiperiodicals_text
from
paga.AIEditingRoomPage
import
AIER
from
paga.AIDigitalcreationPaga
import
AIDigitalcreation
from
paga.LoginPage
import
Login
from
common.cutils
import
ws_error
# AI数字创作编辑页面ui自动化测试
class
TestaiDigitalcreation
:
# 类前置
def
setup_class
(
self
):
self
.
login
=
Login
()
self
.
AIroom
=
AIER
()
self
.
aiDigitalcreation
=
AIDigitalcreation
()
self
.
dbtuils
=
DButils
()
def
setup_method
(
self
):
self
.
driver
=
DriverTools
.
get_driver
()
.
get
(
login_url
)
self
.
login
.
login
(
user_name
,
password
)
self
.
AIroom
.
to_AI_Digitalcreation
()
# 类后置
def
teardown_class
(
self
):
DriverTools
.
quit_driver
()
# AI数字创作编辑-制作教辅课件类PPT
@allure.feature
(
"制作教辅课件类PPT流程"
)
def
test_ai_ppt
(
self
):
self
.
aiDigitalcreation
.
ai_ppt
()
time
.
sleep
(
160
)
ws_error
(
1
)
time
.
sleep
(
3
)
# AI数字创作编辑-现代纸书一键制作
@allure.feature
(
"现代纸书一键制作流程"
)
def
test_modern_paper_book
(
self
):
self
.
aiDigitalcreation
.
modern_paper_book
(
Aiperiodicals_text
)
time
.
sleep
(
25
)
ws_error
(
1
)
time
.
sleep
(
2
)
# AI数字创作编辑-提供资源选题方案灵感
@allure.feature
(
"提供资源选题方案灵感流程"
)
def
test_ai_scheme
(
self
):
self
.
aiDigitalcreation
.
ai_scheme
()
time
.
sleep
(
25
)
ws_error
(
1
)
time
.
sleep
(
3
)
# AI数字创作编辑-制作浓缩书配音
@allure.feature
(
"制作浓缩书配音流程"
)
def
test_ai_concentratedbook
(
self
):
self
.
aiDigitalcreation
.
ai_concentratedbook
()
time
.
sleep
(
200
)
ws_error
(
1
)
#
import time
#
#
import allure
#
#
from common.DButils import DButils
#
from common.untils import DriverTools
#
from config import user_name, password,login_url,Aiperiodicals_text
#
from paga.AIEditingRoomPage import AIER
#
from paga.AIDigitalcreationPaga import AIDigitalcreation
#
from paga.LoginPage import Login
#
from common.cutils import ws_error
#
#
#
AI数字创作编辑页面ui自动化测试
#
class TestaiDigitalcreation:
#
# 类前置
#
def setup_class(self):
#
self.login = Login()
#
self.AIroom = AIER()
#
self.aiDigitalcreation = AIDigitalcreation()
#
self.dbtuils = DButils()
#
#
def setup_method(self):
#
self.driver = DriverTools.get_driver().get(login_url)
#
self.login.login(user_name, password)
#
self.AIroom.to_AI_Digitalcreation()
#
#
# 类后置
#
def teardown_class(self):
#
DriverTools.quit_driver()
#
#
# AI数字创作编辑-制作教辅课件类PPT
#
@allure.feature("制作教辅课件类PPT流程")
#
def test_ai_ppt(self):
#
self.aiDigitalcreation.ai_ppt()
#
time.sleep(160)
#
ws_error(1)
#
time.sleep(3)
#
#
# AI数字创作编辑-现代纸书一键制作
#
@allure.feature("现代纸书一键制作流程")
#
def test_modern_paper_book(self):
#
self.aiDigitalcreation.modern_paper_book(Aiperiodicals_text)
#
time.sleep(25)
#
ws_error(1)
#
time.sleep(2)
#
#
# AI数字创作编辑-提供资源选题方案灵感
#
@allure.feature("提供资源选题方案灵感流程")
#
def test_ai_scheme(self):
#
self.aiDigitalcreation.ai_scheme()
#
time.sleep(25)
#
ws_error(1)
#
time.sleep(3)
#
#
# AI数字创作编辑-制作浓缩书配音
#
@allure.feature("制作浓缩书配音流程")
#
def test_ai_concentratedbook(self):
#
self.aiDigitalcreation.ai_concentratedbook()
#
time.sleep(200)
#
ws_error(1)
#
#
#
#
#
#
#
#
#
#
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