|
23 | 23 | import com.microsoft.playwright.impl.driver.Driver;
|
24 | 24 | import com.microsoft.playwright.options.AriaRole;
|
25 | 25 |
|
26 |
| -public class TraceViewerPage { |
| 26 | +class TraceViewerPage { |
27 | 27 | private final Page page;
|
28 | 28 |
|
29 |
| - public TraceViewerPage(Page page) { |
| 29 | + TraceViewerPage(Page page) { |
30 | 30 | this.page = page;
|
31 | 31 | }
|
32 | 32 |
|
33 |
| - public Page page() { |
| 33 | + Page page() { |
34 | 34 | return page;
|
35 | 35 | }
|
36 | 36 |
|
37 |
| - public Locator actionsTree() { |
| 37 | + Locator actionsTree() { |
38 | 38 | return page.getByTestId("actions-tree");
|
39 | 39 | }
|
40 | 40 |
|
41 |
| - public Locator actionTitles() { |
| 41 | + Locator actionTitles() { |
42 | 42 | return page.locator(".action-title");
|
43 | 43 | }
|
44 | 44 |
|
45 |
| - public Locator stackFrames() { |
| 45 | + Locator stackFrames() { |
46 | 46 | return this.page.getByRole(AriaRole.LIST, new Page.GetByRoleOptions().setName("stack trace")).getByRole(AriaRole.LISTITEM);
|
47 | 47 | }
|
48 | 48 |
|
49 |
| - public void selectAction(String title, int ordinal) { |
| 49 | + void selectAction(String title, int ordinal) { |
50 | 50 | this.actionsTree().getByTitle(title).nth(ordinal).click();
|
51 | 51 | }
|
52 | 52 |
|
53 |
| - public void selectAction(String title) { |
| 53 | + void selectAction(String title) { |
54 | 54 | selectAction(title, 0);
|
55 | 55 | }
|
56 | 56 |
|
57 |
| - public void selectSnapshot(String name) { |
| 57 | + void selectSnapshot(String name) { |
58 | 58 | this.page.getByRole(AriaRole.TAB, new Page.GetByRoleOptions().setName(name)).click();
|
59 | 59 | }
|
60 | 60 |
|
61 |
| - public FrameLocator snapshotFrame(String actionName, int ordinal, boolean hasSubframe) { |
| 61 | + FrameLocator snapshotFrame(String actionName, int ordinal, boolean hasSubframe) { |
62 | 62 | selectAction(actionName, ordinal);
|
63 | 63 | while (page.frames().size() < (hasSubframe ? 4 : 3)) {
|
64 | 64 | page.waitForTimeout(200);
|
65 | 65 | }
|
66 | 66 | return page.frameLocator("iframe.snapshot-visible[name=snapshot]");
|
67 | 67 | }
|
68 | 68 |
|
69 |
| - public FrameLocator snapshotFrame(String actionName, int ordinal) { |
| 69 | + FrameLocator snapshotFrame(String actionName, int ordinal) { |
70 | 70 | return snapshotFrame(actionName, ordinal, false);
|
71 | 71 | }
|
72 | 72 |
|
73 |
| - public void showSourceTab() { |
| 73 | + void showSourceTab() { |
74 | 74 | page.getByRole(AriaRole.TAB, new Page.GetByRoleOptions().setName("Source")).click();
|
75 | 75 | }
|
76 | 76 |
|
77 |
| - public void expandAction(String title) { |
| 77 | + void expandAction(String title) { |
78 | 78 | this.actionsTree().getByRole(AriaRole.TREEITEM, new Locator.GetByRoleOptions().setName(title)).locator(".codicon-chevron-right").click();
|
79 | 79 | }
|
80 | 80 |
|
|
0 commit comments