提交 c0a3ac7d authored 作者: 陈泽健's avatar 陈泽健

测试提交

上级 abac55d2
......@@ -22,6 +22,7 @@ from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from urllib.parse import urlencode
from datetime import datetime
from time import sleep
# 获取当前脚本的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
......@@ -187,6 +188,35 @@ def safe_click(element_locator, wd):
# Log a message if the element is not interactable
INFO(f"ElementNotInteractableException: Element {element_locator} is not interactable.")
def issue_send_and_upload(wd , issue_num, issue_name, issue_file_name):
"""
输入议题名称以及上传议题文件。
"""
# 获取当前脚本的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建项目的根目录路径
project_root = os.path.abspath(os.path.join(current_dir, '..', '..', '..'))
# 构建 issue_file 目录的绝对路径
issue_file_dir = os.path.join(project_root, 'reports', 'issue_file')
# 构建具体的议题文件路径
file_path = os.path.join(issue_file_dir, issue_file_name)
INFO(f"议题文件路径:{file_path}")
INFO(f"输入议题名称:{issue_name}")
# 输入议题名称
safe_send_keys((By.XPATH, f"(//input[@placeholder='请输入会议议题'])[1]"), f"{issue_name}", wd)
# 选择议题文件进行上传
INFO("点击【上传文件】按钮")
safe_click((By.XPATH,
"//div[@class='topicsHandleButton uploadFile']"),
wd)
sleep(2)
upload_button = WebDriverWait(wd, 60).until(
EC.element_to_be_clickable((By.XPATH, "//label[@id='global-uploader-btn']")))
INFO("选择议题文件上传")
upload_button.send_keys(file_path)
sleep(1)
def input_clear(element_locator, wd):
"""
清空输入框中的文本。
......
......@@ -93,20 +93,21 @@ class Exhibition_hall_inspection_000x:
sleep(1)
# 判断预约类型
if book_type == "普通会议":
INFO("预约类型为:普通会议")
# 选择普通会议
safe_click((By.XPATH, f"//span[contains(text(),'{book_type}')]"), wd)
sleep(1)
elif book_type == "周期会议":
INFO("预约类型为:周期会议")
# 选择周期会议
safe_click((By.XPATH, f"//span[contains(text(),'{book_type}')]"),wd)
sleep(1)
# 选择重复周期
safe_click((By.XPATH, f"//span[contains(text(),'{repetitive_cycle}')]"),wd)
sleep(1)
if message_type == "":
if book_type == "普通会议":
INFO("预约类型为:普通会议")
# 选择普通会议
safe_click((By.XPATH, f"//span[contains(text(),'{book_type}')]"), wd)
sleep(1)
elif book_type == "周期会议":
INFO("预约类型为:周期会议")
# 选择周期会议
safe_click((By.XPATH, f"//span[contains(text(),'{book_type}')]"), wd)
sleep(1)
# 选择重复周期
safe_click((By.XPATH, f"//span[contains(text(),'{repetitive_cycle}')]"), wd)
sleep(1)
# 输入会议主持人
safe_send_keys((By.XPATH, "//input[@placeholder='请输入']"),host_name,wd)
......@@ -114,11 +115,9 @@ class Exhibition_hall_inspection_000x:
safe_send_keys((By.XPATH, "//textarea[@placeholder='请输入会议内容']"),message_content,wd)
sleep(2)
# # 输入议题名称
# safe_send_keys((By.XPATH, "//input[@placeholder='请输入会议议题']"),issue_name,wd)
# # 选择议题文件进行上传
# safe_click((By.XPATH, "//div[@class='topicsHandleButton uploadFile']"),wd)
# sleep(1)
# 调用函数添加议题
INFO("添加议题文件")
issue_send_and_upload(wd, 2, issue_name, "议题图片.png")
# 将字符串转换为时间对象
start_time = datetime.strptime(book_start_time, time_format)
......
import sys
import os
from time import sleep
# 获取当前脚本的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建预定系统的绝对路径
预定系统_path = os.path.abspath(os.path.join(current_dir, '..','..'))
# 添加路径
sys.path.append(预定系统_path)
# 导入模块
from 预定系统.Base.base import *
def suite_setup():
STEP(1, "初始化浏览器")
browser_init()
wd = GSTORE['wd']
admin_login()
\ No newline at end of file
name,conference_name,message_name,message_type,book_type,repetitive_cycle,host_name,message_content,issue_name,book_start_time,book_end_time,inside_participant_name,outside_participant_name,outside_participant_phone,save_template,template_name,message_notification,notification_method,check_text
会议预约_001,产研中心会议室,这是周期会议测试1,SMC3.0,周期会议,每天,陈泽键,这是会议内容哈哈,议题1,19:00,20:15,admin@CZJ,陈泽坚,17319004674,否,这是模板,开会前一天提醒,短信,预定成功
\ No newline at end of file
展厅巡检_001,产研中心会议室,展厅巡检测试,SMC3.0,周期会议,每天,陈泽键,这是会议内容哈哈,议题1,19:00,20:15,admin@CZJ,陈泽坚,17319004674,否,这是模板,开会前一天提醒,短信,预定成功
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论