forked from guacsec/trustify-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSbomListPage.ts
More file actions
53 lines (46 loc) · 1.34 KB
/
SbomListPage.ts
File metadata and controls
53 lines (46 loc) · 1.34 KB
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
45
46
47
48
49
50
51
52
53
import type { Page } from "@playwright/test";
import { Navigation } from "../Navigation";
import { Pagination } from "../Pagination";
import { Table } from "../Table";
import { Toolbar } from "../Toolbar";
export class SbomListPage {
private readonly _page: Page;
private constructor(page: Page) {
this._page = page;
}
static async build(page: Page) {
const navigation = await Navigation.build(page);
await navigation.goToSidebar("SBOMs");
return new SbomListPage(page);
}
async getToolbar() {
return await Toolbar.build(this._page, "sbom-toolbar", {
"Filter text": "string",
"Created on": "dateRange",
Label: "typeahead",
License: "multiSelect",
});
}
async getTable() {
return await Table.build(
this._page,
"sbom-table",
{
Name: { isSortable: true },
Version: { isSortable: false },
Supplier: { isSortable: false },
Labels: { isSortable: false },
"Created on": { isSortable: true },
Dependencies: { isSortable: false },
Vulnerabilities: { isSortable: false },
},
["Edit labels", "Download SBOM", "Download License Report", "Delete"],
);
}
async getPagination(top: boolean = true) {
return await Pagination.build(
this._page,
`sbom-table-pagination-${top ? "top" : "bottom"}`,
);
}
}