补发一下代码 @allure.story("test003-新增应用")
def test_stuff_002(self, page, base_url):
"""
名称:新增应用
步骤:
1、登录后平台后切换后台
2、输入应用编码
3、输入应用名称
4、点击新增
检查点:
* 检查新增是否成功
"""
page.goto(base_url)
page.get_by_role("tab", name="平台管理").click()
page.get_by_placeholder("账号").click()
page.get_by_placeholder("账号").fill(str(Variable.userAccount))
page.get_by_placeholder("密码").click()
page.get_by_placeholder("密码").fill(str(Variable.userPassword))
page.get_by_role("button", name="登录").click()
page.get_by_role("button", name="宇飞").click()
with page.expect_popup() as page_info:
page.get_by_text("后台管理").click()
page = page_info.value
page.get_by_placeholder("账号").click()
page.get_by_placeholder("账号").fill(str(Variable.userAccount))
page.get_by_placeholder("密码").click()
page.get_by_placeholder("密码").fill(str(Variable.userPassword))
page.get_by_role("button", name="登录").click()
page.locator("xpath = /html/body/div[1]/div[1]/div/div[1]/div[2]/div[1]/div[1]/div").click()
page.locator(f'//div[@class="org-item-sklenton"]/div/li//span[contains(text(), "test01")]').click()
page.locator(
'//div[@class="admin__menu"]/ul/li//span[@class="base-menu-item__name"][contains(text() , "应用管理")]').click()
page.locator(
'//button[@class="el-button button-item apaas-font-body el-button--primary"]//span[contains(text(),"创建应用")]').click()
page.get_by_placeholder("请输入应用编码").click()
page.get_by_placeholder("请输入应用编码").fill(Variable.applicationId)
page.get_by_placeholder("请输入应用名称").click()
page.get_by_placeholder("请输入应用名称").fill(Variable.applicationName)
page.get_by_role("button", name="确定").click()
sleep(2)
assert page.title() == "应用详情%"
|