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