Commit 19ead183 by linguangwei

添加时间轴case

parent 4cff5de1
......@@ -4,11 +4,13 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="00f4febb-36b6-426d-bfe6-b023876a617e" name="Default Changelist" comment="发送钉钉测试报告,本机作为服务器">
<list default="true" id="00f4febb-36b6-426d-bfe6-b023876a617e" name="Default Changelist" comment="review">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/framework/dingTalk.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/framework/dingTalk.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/testcase/test_LivePage.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/testcase/test_LivePage.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/testcase/test_WhiteBoardPage.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/testcase/test_WhiteBoardPage.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/config.ini" beforeDir="false" afterPath="$PROJECT_DIR$/config/config.ini" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/readConfig.py" beforeDir="false" afterPath="$PROJECT_DIR$/config/readConfig.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/framework/common.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/framework/common.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/pageobject/basepage.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/pageobject/basepage.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/testcase/test_MainPage.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/testcase/test_MainPage.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -166,7 +168,7 @@
<recent name="C:\Users\Administrator\PycharmProjects\xm-uitest-live" />
</key>
</component>
<component name="RunManager" selected="Python.demo">
<component name="RunManager" selected="Python tests.pytest for test_MainBarPage.TestMainPage.test_SelectOtherDay">
<configuration name="demo" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="xm-uitest-live" />
<option name="INTERPRETER_OPTIONS" value="" />
......@@ -188,7 +190,7 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="dingTalk" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<configuration name="main" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="xm-uitest-live" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -196,11 +198,11 @@
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/framework" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/framework/dingTalk.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/main.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
......@@ -209,28 +211,23 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="main" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<configuration name="pytest for test_MainBarPage.TestMainPage" type="tests" factoryName="py.test" temporary="true" nameIsGenerated="true">
<module name="xm-uitest-live" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/testcase" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/main.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<option name="_new_keywords" value="&quot;&quot;" />
<option name="_new_parameters" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;test_MainBarPage.TestMainPage&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
<method v="2" />
</configuration>
<configuration name="pytest for test_WhiteBoardPage.TestLivePage" type="tests" factoryName="py.test" temporary="true" nameIsGenerated="true">
<configuration name="pytest for test_MainBarPage.TestMainPage.test_IfTrueSelectedDay" type="tests" factoryName="py.test" temporary="true" nameIsGenerated="true">
<module name="xm-uitest-live" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -242,11 +239,11 @@
<option name="_new_keywords" value="&quot;&quot;" />
<option name="_new_parameters" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;test_WhiteBoardPage.TestLivePage&quot;" />
<option name="_new_target" value="&quot;test_MainBarPage.TestMainPage.test_IfTrueSelectedDay&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
<method v="2" />
</configuration>
<configuration name="pytest for test_WhiteBoardPage.TestLivePage.testAddAndOpenWhiteBoard" type="tests" factoryName="py.test" temporary="true" nameIsGenerated="true">
<configuration name="pytest for test_MainBarPage.TestMainPage.test_SelectOtherDay" type="tests" factoryName="py.test" temporary="true" nameIsGenerated="true">
<module name="xm-uitest-live" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -258,17 +255,17 @@
<option name="_new_keywords" value="&quot;&quot;" />
<option name="_new_parameters" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;test_WhiteBoardPage.TestLivePage.testAddAndOpenWhiteBoard&quot;" />
<option name="_new_target" value="&quot;test_MainBarPage.TestMainPage.test_SelectOtherDay&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Python tests.pytest for test_MainBarPage.TestMainPage.test_SelectOtherDay" />
<item itemvalue="Python tests.pytest for test_MainBarPage.TestMainPage.test_IfTrueSelectedDay" />
<item itemvalue="Python.demo" />
<item itemvalue="Python tests.pytest for test_MainBarPage.TestMainPage" />
<item itemvalue="Python.main" />
<item itemvalue="Python.dingTalk" />
<item itemvalue="Python tests.pytest for test_WhiteBoardPage.TestLivePage" />
<item itemvalue="Python tests.pytest for test_WhiteBoardPage.TestLivePage.testAddAndOpenWhiteBoard" />
</list>
</recent_temporary>
</component>
......@@ -501,7 +498,14 @@
<option name="project" value="LOCAL" />
<updated>1625802042770</updated>
</task>
<option name="localTasksCounter" value="31" />
<task id="LOCAL-00031" summary="review">
<created>1626328922261</created>
<option name="number" value="00031" />
<option name="presentableId" value="LOCAL-00031" />
<option name="project" value="LOCAL" />
<updated>1626328922261</updated>
</task>
<option name="localTasksCounter" value="32" />
<servers />
</component>
<component name="TestHistory">
......@@ -617,10 +621,10 @@
<MESSAGE value="添加本地文件路径区分mac/windows" />
<MESSAGE value="增加了调试中的切换环境方法" />
<MESSAGE value="请求头添加enterpriseId,并且设置各个请求头参数为变量,在config.ini中设置" />
<MESSAGE value="review" />
<MESSAGE value="增加白板的测试用例-7个" />
<MESSAGE value="发送钉钉测试报告,本机作为服务器" />
<option name="LAST_COMMIT_MESSAGE" value="发送钉钉测试报告,本机作为服务器" />
<MESSAGE value="review" />
<option name="LAST_COMMIT_MESSAGE" value="review" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/server.log" />
......
......@@ -24,3 +24,7 @@ lgw-b = {"userId":"1394908740376522754","storeId":"1211601438838495999","storeUs
[chrome download]
url = http://chromedriver.storage.googleapis.com/
[day exchange]
week_name = {"0": "Mon", "1": "Tue", "2": "Wed", "3": "Thu", "4": "Fri", "5": "Sat", "6": "Sun"}
\ No newline at end of file
......@@ -37,3 +37,8 @@ def test_password():
def test_header():
return_test = config.get("header_require", "lgw-b")
return json.loads(return_test)
def test_day_exchange():
return_test = config.get("day exchange", "week_name")
return json.loads(return_test)
import datetime
import json
import math
import operator
......@@ -19,6 +20,24 @@ def year_to_minute():
return time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))
def month_day():
return time.localtime().tm_mday
def month_not_today(para):
today = datetime.datetime.today()
if para >= 0:
return today + datetime.timedelta(days=para)
else:
para = abs(para)
return today - datetime.timedelta(days=para)
def week_day():
week_day_name = time.localtime().tm_wday
return week_day_name
def now_time():
return int(time.time()*1000)
......
......@@ -32,7 +32,7 @@ class Page(object):
# 获取元素文本
def get_text(self, loc):
return self.driver.find_element(loc).text
return self.driver.find_element(*loc).text
# 点击框点击
def click(self, *loc):
......@@ -114,7 +114,7 @@ class Page(object):
return True
# 寻找多元素返回
def find_elements(self, *loc):
def find_elements(self, loc):
return self.driver.find_elements(*loc)
# 关闭窗口
......@@ -158,15 +158,20 @@ class Page(object):
password_input = (By.ID, "xmpwd")
# 登录按钮
login_button = (By.CLASS_NAME, "submit")
login_page.click(phone_login)
# env = readConfig.get_env()
# login_page.get_env_window()
# login_page.click_what('span', 'text()', self.env)
# login_page.click_close_env_window()
# login_page.click_text(env)
# 旧的登录方法
login_page.click(phone_login)
# 新的登录方法
# 执行脚本,隐藏的手机号码输入框弹出
# login_page.excute_script("form xm_phone_login")
# login_page.sleep(2)
login_page.input_text(account_input, readConfig.test_account())
login_page.input_text(password_input, readConfig.test_password())
login_page.click(login_button)
......
......@@ -36,7 +36,8 @@ class TestMainPage(object):
self.driver.quit()
@allure.title("测试主页-进入未开启直播")
def test_1_UnStartLive(self):
@pytest.mark.run(order=1)
def test_UnStartLive(self):
self.main_page.sleep(self.sleep_time)
self.main_page.page_down(self.live_course_name[0])
self.main_page.sleep(self.sleep_time)
......@@ -80,15 +81,17 @@ class TestMainPage(object):
# @pytest.mark.skip()
@allure.title("测试主页-进入已开启直播")
def test_2_StartLive(self):
@pytest.mark.run(order=2)
def test_StartLive(self):
self.enter_start_live()
self.twice_start_live()
self.close_live()
self.end_live()
@pytest.mark.skip()
@pytest.mark.run(order=3)
@allure.title("测试回放")
def test_3_ReviewLive(self):
def test_ReviewLive(self):
print(self.live_course_name)
self.main_page.sleep(self.sleep_time)
self.main_page.page_down(self.live_course_name[1])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment