Exemplo n.º 1
0
def createdata(driver):
    login_p = LoginPage(driver)
    create_p = CreateNew(driver)

    # 登录操作
    login_p.open()
    login_p.login()

    # 创建标的
    create_p.open()
    # create_p.createnewproject(project_name="接口测试信3",financingMaturity="1",project_category="企易融",
    #                           contractType="企易融_企易融协议",userName="******")
    create_p.createnewproject(project_name="接口测试信3", financingMaturity="12")

    # 填写借款人信息
    loanuser_p = create_p.loanuserinfo()
    loanuser_p.submitform()

    # 上传图片
    upload_p = create_p.uploadimgb()
    upload_p.uploadimage()

    # 改变项目状态
    prosta_p = create_p.projectstatus()
    prosta_p.changeprosta_yianpai()
    prosta_p.changeprosta_kaifang()

    # 获取标id
    url = driver.current_url
    project_id = url.split("/")[-1]
    return project_id
Exemplo n.º 2
0
class UploadImgTest(unittest.TestCase):
    def setUp(self):
        self.dr = webdriver.Chrome()
        self.dr.maximize_window()
        self.dr.implicitly_wait(10)
        # 后台需先登录
        self.login_p = LoginPage(self.dr)
        self.login_p.open()
        self.login_p.login()
        # 创建新标
        self.createpro_p = CreateNew(self.dr)
        self.createpro_p.open()
        self.createpro_p.createnewproject()

    def test_uploadimg(self):
        self.upload_p = self.createpro_p.uploadimgb()
        self.upload_p.uploadimage()

    def tearDown(self):
        self.dr.quit()