Example #1
0
            zipname = zip.namelist()  #返回压缩包中所有文件的文件名
            zip.extractall()  #解压所有文件
            zip.close()
            f = open(zipname[0])
            lines = f.readline()
            # print(lines)
            f.close()

            # 拼写制卡卡号
            card = '%E?;' + lines.rstrip('\n').split("|")[1] + '?+E?'
            cache.set('patient_card', card)
            log.info(card)
            Utility.writeFile(card)

            # 删除解压文件
            if os.path.exists(zipname[0]):
                os.remove(zipname[0])


if __name__ == "__main__":
    browser = common.browser()
    cache = Cache({})
    testcase = {'用户名': 'jwang', '密码': '123456'}
    cache.set('resultType', '1')
    cache.set('specialName', '急诊内科')
    cache.set('userId', '%E?;2001065723=99015011437?+E?')
    login.test_login(browser, testcase, cache)
    test_businessCard(browser, cache)
    browser.find_elements_tag_name('img')[21].click()
    browser.find_elements_by_xpath('//img')[21].click()
        result = 0


def outp_message(browser):
    special_elements = browser.find_elements_by_xpath(div[3]['key'])
    outp_type_code = []
    outp_date = []
    if len(special_elements) > 1:
        for special_element in special_elements:
            outp_type_code.append(
                special_element.find_elements_by_tag_name('div')[1].text)
            outp_date.append(
                special_element.find_elements_by_tag_name('div')[4].text)
    return [outp_type_code, outp_date]


if __name__ == '__main__':
    cache = Cache({})
    browser = Common.browser()
    testcase = {'用户名': 'jfli', '密码': '123456'}
    login.test_login(browser, testcase, cache)
    test_case = {
        '患者卡号': '%E?;1004627675=99015017425?+E?',
        '患者姓名': '',
        '号源类别': '专家',
        '专科编码': '083',
        '专科名称': '',
        '医生': ''
    }
    test_regist_button(browser, test_case, cache)
Example #3
0
 def __init__(self,List_action,ip):
     #浏览器对象
     self. browser = Common.browser(ip)
     self.cachedata = Cache({})
     self.List_action = List_action