Commit 87dd664c by zhangying

优化1个讨论区测试case

parent 5f81b9ba
......@@ -6,11 +6,11 @@ class LiveDiscussPage(MainPage):
# 元素集
# 讨论tab
discuss_tab = (By.XPATH, "//div[@class='sectionTab']/讨论")
discuss_tab = (By.XPATH, """//div[@class='sectionTab']/div[text()="讨论"]""")
# 讨论文字输入框
discuss_box = (By.XPATH, "//div[@class='textBox']")
# 发送按钮
discuss_submit_btn = (By.XPATH, "//span[@class='button']/ant-btn ant-btn-primary ant-btn-sm submit")
discuss_submit_btn = (By.XPATH, """//span[text()="发送"]""")
# 学员禁言按钮
discuss_forbid = (By.XPATH, "//span[@class='ant-checkbox']/ant-checkbox-input")
......@@ -18,7 +18,7 @@ class LiveDiscussPage(MainPage):
MainPage.__init__(self, driver)
# 点击讨论tab
def click_camera_btn(self):
def click_discuss_tab(self):
self.click(self.discuss_tab)
# 点击讨论内容输入框
......
......@@ -14,7 +14,7 @@ from config import readConfig
import sys
class TestLiveRoomPage(object):
class TestLivePage(object):
cloud_class_location = readConfig.test_location()
driver = get_app_driver(cloud_class_location)
Live_Discuss_Page = LiveDiscussPage(driver=driver)
......@@ -23,21 +23,28 @@ class TestLiveRoomPage(object):
def before_test(self):
self.logger = Logger('live page').getlog()
time.sleep(15)
live_course_name = create_a_live(start_time=25)
live_course_name = create_a_live(start_time=25, user="zhangy-b")
# 这里停15s是因为setUP里创建直播间获取token登录了一次,限制两次登录需间隔15s
self.Live_Discuss_Page.login()
self.Live_Discuss_Page.login(user='zhangy-b')
self.Live_Discuss_Page.sleep(2)
# print(live_course_name[0])
# print("***********"+live_course_name[0])
self.Live_Discuss_Page.click_in_live_btn(live_course_name[0])
self.Live_Discuss_Page.sleep(6)
self.Live_Discuss_Page.change_window(self.Live_Discuss_Page.discuss_tab)
self.Live_Discuss_Page.click_discuss_tab()
self.Live_Discuss_Page.sleep(2)
# self.Live_Discuss_Page.change_window(self.Live_Discuss_Page.camera_btn)
self.Live_Discuss_Page.sleep(2)
yield self.driver
self.driver.quit()
# yield self.driver
# self.driver.quit()
@pytest.mark.run(order=1)
@allure.title("讨论区发送文字")
def testDiscussField1(self):
# 点击“讨论”按钮
self.Live_Discuss_Page.click_discuss_tab()
# 判断出现文字输入框
assert self.Live_Discuss_Page.ifElementExist(self.Live_Discuss_Page.discuss_box)
if __name__ == '__main__':
......
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