@@ -30,11 +30,11 @@ async def create_job(
3030 await self .page .get_by_role ('button' , name = '新增' ).click ()
3131
3232 # 等待对话框
33- dialog = self .page .locator ( '.el- dialog:visible ' )
33+ dialog = self .page .get_by_role ( ' dialog' )
3434 await dialog .wait_for ()
3535
3636 # 填写表单
37- await dialog .get_by_role ('textbox' , name = '* 任务名称' ).fill (job_name )
37+ await dialog .get_by_role ('textbox' , name = '任务名称' ).fill (job_name )
3838
3939 # 选择任务分组
4040 await dialog .locator ("label:has-text('任务分组') + div .el-select" ).click ()
@@ -45,10 +45,10 @@ async def create_job(
4545 await self .page .get_by_role ('option' , name = job_executor ).click ()
4646
4747 # 填写调用方法
48- await dialog .get_by_role ('textbox' , name = '* 调用方法' ).fill (invoke_target )
48+ await dialog .get_by_role ('textbox' , name = '调用方法' ).fill (invoke_target )
4949
5050 # 填写cron表达式
51- await dialog .get_by_role ('textbox' , name = '* cron表达式' ).fill (cron_expression )
51+ await dialog .get_by_role ('textbox' , name = 'cron表达式' ).fill (cron_expression )
5252
5353 # 策略:如果"失败"策略等有默认值,就不管了
5454
@@ -72,11 +72,11 @@ async def edit_job(self, job_name: str, new_invoke_target: str) -> None:
7272 # 操作列按钮顺序: 修改, 删除, 执行一次, 详细, 日志
7373 await row .locator ('button' ).nth (0 ).click ()
7474
75- dialog = self .page .locator ( '.el- dialog:visible ' )
75+ dialog = self .page .get_by_role ( ' dialog' )
7676 await dialog .wait_for ()
7777
7878 # 修改调用方法
79- await dialog .get_by_role ('textbox' , name = '* 调用方法' ).fill (new_invoke_target )
79+ await dialog .get_by_role ('textbox' , name = '调用方法' ).fill (new_invoke_target )
8080
8181 await dialog .get_by_role ('button' , name = '确 定' ).click ()
8282 await self .wait_for_selector ("div:has-text('修改成功')" , timeout = 10000 )
0 commit comments