Commit ecf5e4dc by linguangwei

review

parent ad5537b7
......@@ -12,13 +12,8 @@ mac_app_location = /Applications/小麦企学院.app/Contents/MacOS/小麦企学
[testEnv]
env = prod
[account]
# 白名单账号
username = 13777867342
password = 0000
[header_require]
lgw-b = {"userId":"1394908740376522754","storeId":"1211601438838495999","storeUserId":"1394257952460828673","enterpriseId":"1398199018246803458"}
lgw-b = {"username" = "13777867342", "password" = "0000", "userId":"1394908740376522754","storeId":"1211601438838495999","storeUserId":"1394257952460828673","enterpriseId":"1398199018246803458"}
[MySql]
......
......@@ -26,14 +26,6 @@ def get_env():
return env
def test_account():
return config.get("account", "username")
def test_password():
return config.get("account", "password")
def test_header(header_name):
return_test = config.get("header_require", header_name)
return json.loads(return_test)
......
......@@ -83,9 +83,9 @@ def get_allure_screenshots(screenshot_path, describe):
# 小麦接口相关
# 获取登录token
def get_token():
account = readConfig.test_account()
password = readConfig.test_password()
def get_token(user):
account = readConfig.test_header(user)['username']
password = readConfig.test_header(user)['password']
headers = {"Content-Type": "application/json; charset=UTF-8",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/91.0.4472.77 Safari/537.36"}
......@@ -102,7 +102,7 @@ def get_token():
# 创建一个直播课,返回课程id和课程名称
def create_a_live(start_time, start_time2=None, header_name="lgw-b"):
xmtoken = get_token()
xmtoken = get_token(header_name)
basic_imforation = readConfig.test_header(header_name=header_name)
userId = basic_imforation['userId']
storeId = basic_imforation['storeId']
......
......@@ -174,7 +174,7 @@ class Page(object):
if have_ele:
break
def login(self):
def login(self, user='lgw-b'):
driver = self.driver
sleep(15)
login_page = Page(driver=driver)
......@@ -200,8 +200,8 @@ class Page(object):
# login_page.excute_script_dominance("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.input_text(account_input, readConfig.test_header(user)['username'])
login_page.input_text(password_input, readConfig.test_header(user)['username'])
login_page.click(login_button)
login_page.sleep(2)
login_page.click_text("取 消")
......
......@@ -88,7 +88,7 @@ class TestLivePage(object):
assert 30 < result
@pytest.mark.run(order=4)
@pytest.mark.skip()
# @pytest.mark.skip()
@allure.title("测试摄像头功能-关闭摄像头-方法2")
def testCloseCameraByFunction2(self):
self.Live_Camera_Page.excute_script_display("topBox")
......
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