From 845e90ab4ea7f04b434af74c4bf437e391a14ce6 Mon Sep 17 00:00:00 2001 From: RogerWork Date: Wed, 21 Aug 2024 09:04:28 +0800 Subject: [PATCH] =?UTF-8?q?codegen=E7=94=9F=E6=88=90=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E4=BD=9C=E4=B8=BA=E5=8F=82=E8=80=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test.py | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 0000000..165fcd5 --- /dev/null +++ b/test.py @@ -0,0 +1,59 @@ +import re +from playwright.sync_api import Playwright, sync_playwright, expect + + +def run(playwright: Playwright) -> None: + browser = playwright.chromium.launch(headless=False) + context = browser.new_context() + page = context.new_page() + page.goto("about:blank") + page.goto("http://ankangfulu.yhz.com/") + page.goto("http://ankangfulu.yhz.com/login") + page.get_by_placeholder("请输入手机号").click() + page.get_by_placeholder("请输入手机号").fill("1") + page.get_by_placeholder("请输入手机号").press("F1") + page.get_by_placeholder("请输入手机号").fill("18611659484") + page.get_by_placeholder("请输入手机号").press("Tab") + page.get_by_placeholder("请选择诊所名称").click() + page.get_by_text("厚生堂(测试)诊所").click() + page.get_by_placeholder("请输入密码").click() + page.get_by_placeholder("请输入密码").fill("admin123") + page.get_by_placeholder("请输入密码").press("Enter") + page.locator('.ivu-menu').get_by_text("收银").click() + page.get_by_text("诊所管理").click() + page.locator("#app").get_by_text("医生管理").click() + page.locator("tr").filter(has_text="查看编辑出诊分享权重 孙医生 18611659484").locator("i").nth(2).click() + page.get_by_role("button", name="引用通用排班").click() + page.get_by_role("button", name="确定").click() + page.get_by_role("button", name="保存").click() + page.get_by_text("医生工作台").click() + page.locator("li").filter(has_text="收银 挂号/加号工作台患者管理会员卡办理商品核销文章管理抄方开药预收款管理 预收款账户管理预收款账户充值").locator("div").first.click() + page.locator("#app").get_by_text("挂号/加号").click() + page.locator("#main-content").get_by_text("孙医生").click() + page.locator("li").filter(has_text="12上午:0/10 下午:0/20 挂号/加号").get_by_role("button").click() + page.get_by_placeholder("最多20个字符").click() + page.get_by_placeholder("最多20个字符").fill("19920002680") + page.locator(".ivu-row > div:nth-child(2)").first.click() + page.get_by_placeholder("位手机号码").click() + page.get_by_placeholder("最多20个字符").click() + page.get_by_placeholder("最多20个字符").fill("患者1") + page.get_by_text("患者信息 读取身份证读卡会自动完善新患者姓名、性别、年龄、生日、省份、住址,老患者已经完善信息不覆盖。患者姓名: 3/20").click() + page.get_by_placeholder("位手机号码").click() + page.get_by_placeholder("位手机号码").fill("19920002680") + page.locator(".ivu-select-selection").first.click() + page.get_by_text("男").click() + page.get_by_placeholder("仅支持数字").first.click() + page.get_by_placeholder("仅支持数字").first.fill("34") + page.get_by_role("button", name="去支付").click() + page.get_by_role("button", name="确定").click() + page.get_by_text("现金").click() + page.get_by_role("button", name="确定支付").click() + page.get_by_role("button", name="知道了").click() + + # --------------------- + context.close() + browser.close() + + +with sync_playwright() as playwright: + run(playwright)