Commit 59f7f0e4 authored by youxiaoji's avatar youxiaoji

* [关闭playwright trace功能]

parent 15bbdfe6
...@@ -143,10 +143,10 @@ public class VisitorAppointmentTool { ...@@ -143,10 +143,10 @@ public class VisitorAppointmentTool {
@Tool(description = "提交访客预约申请") @Tool(description = "提交访客预约申请")
public String submitAppointmentApply(ToolContext toolContext) { public String submitAppointmentApply(ToolContext toolContext) {
sharedContext.tracing().start(new Tracing.StartOptions() // sharedContext.tracing().start(new Tracing.StartOptions()
.setScreenshots(true) // .setScreenshots(true)
.setSnapshots(true) // .setSnapshots(true)
.setSources(true)); // .setSources(true));
log.info("submit apply info "); log.info("submit apply info ");
JSONArray jsonArray = infoCollectorService.getInfo(pageId); JSONArray jsonArray = infoCollectorService.getInfo(pageId);
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
...@@ -219,13 +219,16 @@ public class VisitorAppointmentTool { ...@@ -219,13 +219,16 @@ public class VisitorAppointmentTool {
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(values[0] + "年")).click(); page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(values[0] + "年")).click();
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(values[1] + "月")).click(); page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(values[1] + "月")).click();
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(values[2] + "日")).click(); Locator dayColumn = page.locator(".van-picker-column").nth(2);
Locator targetDay = dayColumn.locator("li").filter(new Locator.FilterOptions().setHasText(values[2] + "日"));
targetDay.click();
//page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(values[2] + "日")).click();
// 点击确认 // 点击确认
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("确认")).click(); page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("确认")).click();
page.locator(".van-overlay").first().waitFor(new Locator.WaitForOptions().setState(WaitForSelectorState.HIDDEN)); page.locator(".van-overlay").first().waitFor(new Locator.WaitForOptions().setState(WaitForSelectorState.HIDDEN));
} }
saveScreenShot(page.screenshot(), "ipark"); // saveScreenShot(page.screenshot(), "ipark");
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("提交")) page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("提交"))
.click(); .click();
page.waitForTimeout(3000); page.waitForTimeout(3000);
...@@ -247,8 +250,8 @@ public class VisitorAppointmentTool { ...@@ -247,8 +250,8 @@ public class VisitorAppointmentTool {
log.warn("关闭页面时发生异常: {}", e.getMessage()); log.warn("关闭页面时发生异常: {}", e.getMessage());
} }
} }
sharedContext.tracing().stop(new Tracing.StopOptions() // sharedContext.tracing().stop(new Tracing.StopOptions()
.setPath(Paths.get("trace1.zip"))); // .setPath(Paths.get("trace1.zip")));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment