# -*- encoding=utf8 -*-
__author__ = "xiaohesheng"

"""
case_tag:spd3-web,10087
spd登录的ui自动化例子1
"""


from common.common_func import commonFuc
from selenium import webdriver
module = "demo-ui"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "spd3_login_url")
print(url)
#打开前台系统


import time
# url="http://spddev.cmic.com.cn/hospitaltest2/spd/\#/login?redirect=/paltform/info0/paltform/product/calatog/paltform/product/calatog"

chrome=webdriver.Chrome()
chrome=commonFuc().openBrowser(url,chrome)
chrome.maximize_window()
chrome.implicitly_wait(20)
username=commonFuc().get_business_data(module, "username")
password=commonFuc().get_business_data(module, "password")
login_button=commonFuc().get_business_data(module, "login_button")
print(username,password)
commonFuc().logIn(username,password,login_button,chrome)
name1=commonFuc().get_business_data(module,"name1")
print(name1)
result=commonFuc().check_login_result(name1,chrome)
print(result)
#断言实际结果中是否包含预期的文本
commonFuc().check_text_exist_result_text(name1,result)
commonFuc().quit_chrome(chrome)