Skip to content

Commit 70e3d9d

Browse files
committed
debug gh actions playwright test
1 parent ee27547 commit 70e3d9d

File tree

2 files changed

+49
-26
lines changed

2 files changed

+49
-26
lines changed

.github/workflows/playwright.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
name: Playwright Tests
22
on:
33
push:
4-
branches: [ main, master ]
4+
branches:
5+
- main
6+
- master
7+
- refactor
58
pull_request:
6-
branches: [ main, master ]
9+
branches:
10+
- main
11+
- master
12+
- refactor
13+
workflow_dispatch:
714
jobs:
815
test:
916
timeout-minutes: 60

ui-tests/clusterOI.spec.js

+40-24
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
11
const { test, expect } = require('@playwright/test');
22

3+
let errors = [];
4+
5+
test.beforeEach(async ({ page }) => {
6+
errors = [];
7+
page.on('console', msg => {
8+
if (msg.type() === 'error') {
9+
console.log(msg.text());
10+
errors.push(msg.text());
11+
}
12+
})
13+
});
14+
15+
test.afterEach(async ({ page }) => {
16+
expect(errors).toEqual([]);
17+
});
18+
319
test('clusterOI editor opens, can add nodes', async ({ page }) => {
4-
await page.goto('http://localhost:8080/priority-sets-args.html?network=ui-tests/data/network.json');
5-
6-
await expect(page.locator("#priority-set-tab")).toBeVisible();
7-
await page.locator("#priority-set-tab").click();
8-
9-
// jspanel should not be visible
10-
let jsPanels = await page.locator(".jsPanel").all();
11-
await expect(jsPanels).toHaveLength(0);
12-
13-
await expect(page.locator("#trace-priority-sets")).toBeVisible();
14-
await expect(page.getByText("Create A Cluster of Interest", { exact: true })).toBeVisible();
15-
await page.getByText("Create A Cluster of Interest", { exact: true }).click();
16-
17-
jsPanels = await page.locator(".jsPanel").all();
18-
await expect(jsPanels).toHaveLength(1);
19-
20-
await page.locator('[data-hivtrace-ui-role="priority-panel-nodeids"]').fill("BMK384750US2015");
21-
await page.locator("#priority-panel-add-node").click();
22-
await page.locator('[data-hivtrace-ui-role="priority-panel-nodeids"]').fill("BMK385560US2007");
23-
await page.locator("#priority-panel-add-node").click();
24-
await expect(page.locator("#priority-panel-node-table")
25-
.filter({ has: page.getByText("BMK384750US2015") })
26-
.filter({ has: page.getByText("BMK385560US2007") }))
27-
.toBeVisible();
20+
await page.goto('http://localhost:8080/priority-sets-args.html?network=ui-tests/data/network.json');
21+
22+
await expect(page.locator("#priority-set-tab")).toBeVisible();
23+
await page.locator("#priority-set-tab").click();
24+
25+
// jspanel should not be visible
26+
let jsPanels = await page.locator(".jsPanel").all();
27+
await expect(jsPanels).toHaveLength(0);
28+
29+
await expect(page.locator("#trace-priority-sets")).toBeVisible();
30+
await expect(page.getByText("Create A Cluster of Interest", { exact: true })).toBeVisible();
31+
await page.getByText("Create A Cluster of Interest", { exact: true }).click();
32+
33+
jsPanels = await page.locator(".jsPanel").all();
34+
await expect(jsPanels).toHaveLength(1);
35+
36+
await page.locator('[data-hivtrace-ui-role="priority-panel-nodeids"]').fill("BMK384750US2015");
37+
await page.locator("#priority-panel-add-node").click();
38+
await page.locator('[data-hivtrace-ui-role="priority-panel-nodeids"]').fill("BMK385560US2007");
39+
await page.locator("#priority-panel-add-node").click();
40+
await expect(page.locator("#priority-panel-node-table")
41+
.filter({ has: page.getByText("BMK384750US2015") })
42+
.filter({ has: page.getByText("BMK385560US2007") }))
43+
.toBeVisible();
2844
});

0 commit comments

Comments
 (0)