''' Created on 2018-01-04 @author: Administrator ''' import unittest,sys sys.path.append("./model") sys.path.append("./page_obj") from test_case.models import myunit,functions from test_case.page_obj.loginPage import login from test_case.page_obj.myClientsPage import myClient from data.ReadTestData import Data import time current_time = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time())) init = Data() class MyClientTests(myunit.MyTest): # 登录融管系统 def user_login_verify(self, username='', password="", city=''): login(self.driver).user_login(username, password, city) #修改联系人 def test_1_modifyCltLnk(self): user = init.getUser('销售顾问') self.user_login_verify(username=user['username'],password =user['password'],city=user['city']) my_client = myClient(self.driver) my_client.gotoMyClientList_All(init.getClient('新客户')['lnk_mobile']) my_client.setWaitTime(2)
import sys sys.path.append("./model") sys.path.append("./page_obj") from test_case.models import functions from test_case.page_obj.myClientsPage import myClient from data.ReadTestData import Data import time from behave import * from hamcrest import assert_that, equal_to current_time = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time())) data = Data() @When('查询要修改联系人的客户') def step_searchClient(context): global mc mc = myClient(context.driver) mc.gotoMyClientList_All(data.getCaseInitClient('修改联系人')['lnk_mobile']) mc.setWaitTime(2) @When('输入联系人详情') def step_modifyLnkMan(context): mc.modifyLnkMan('坤坤测试','测试总经理','创始人','8888888','*****@*****.**') @Then('联系人修改成功') def step_veryLnkManModifySucess(context): time.sleep(1) assert_that(mc.verify_modify_lnkMan(), equal_to('坤坤测试')) functions.insert_img(context.driver, "myClient_modifyLnkMan_"+current_time+".png")