forked from trustification/trustify-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvulnerability-explorer.step.ts
More file actions
90 lines (76 loc) · 2.66 KB
/
vulnerability-explorer.step.ts
File metadata and controls
90 lines (76 loc) · 2.66 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import { createBdd } from "playwright-bdd";
import { ToolbarTable } from "../../helpers/ToolbarTable";
import { SearchPage } from "../../helpers/SearchPage";
export const { Given, When, Then } = createBdd();
const SBOM_TABLE_NAME = "Sbom table";
const ADVISORY_TABLE_NAME = "Advisory table";
Given(
"User visits Vulnerability details Page of {string}",
async ({ page }, vulnerabilityID) => {
const searchPage = new SearchPage(page, "Vulnerabilities");
await searchPage.dedicatedSearch(vulnerabilityID);
await page.getByRole("link", { name: vulnerabilityID }).click();
}
);
// SBOMS
Then("The SBOMs table is sorted by {string}", async ({ page }, columnName) => {
const toolbarTable = new ToolbarTable(page, SBOM_TABLE_NAME);
await toolbarTable.verifyTableIsSortedBy(columnName);
});
Then(
"The SBOMs table total results is {int}",
async ({ page }, totalResults) => {
const toolbarTable = new ToolbarTable(page, SBOM_TABLE_NAME);
await toolbarTable.verifyPaginationHasTotalResults(totalResults);
}
);
Then(
"The SBOMs table total results is greather than {int}",
async ({ page }, totalResults) => {
const toolbarTable = new ToolbarTable(page, SBOM_TABLE_NAME);
await toolbarTable.verifyPaginationHasTotalResultsGreatherThan(
totalResults
);
}
);
Then(
"The {string} column of the SBOM table contains {string}",
async ({ page }, columnName, expectedValue) => {
const toolbarTable = new ToolbarTable(page, SBOM_TABLE_NAME);
await toolbarTable.verifyColumnContainsText(columnName, expectedValue);
}
);
// Advisories
Then("User selects the Tabs {string}", async ({ page }, tabName) => {
await page.getByText(tabName).click();
});
Then(
"The Advisory table is sorted by {string}",
async ({ page }, columnName) => {
const toolbarTable = new ToolbarTable(page, ADVISORY_TABLE_NAME);
await toolbarTable.verifyTableIsSortedBy(columnName);
}
);
Then(
"The Advisory table total results is {int}",
async ({ page }, totalResults) => {
const toolbarTable = new ToolbarTable(page, ADVISORY_TABLE_NAME);
await toolbarTable.verifyPaginationHasTotalResults(totalResults);
}
);
Then(
"The Advisory table total results is greather than {int}",
async ({ page }, totalResults) => {
const toolbarTable = new ToolbarTable(page, ADVISORY_TABLE_NAME);
await toolbarTable.verifyPaginationHasTotalResultsGreatherThan(
totalResults
);
}
);
Then(
"The {string} column of the Advisory table contains {string}",
async ({ page }, columnName, expectedValue) => {
const toolbarTable = new ToolbarTable(page, ADVISORY_TABLE_NAME);
await toolbarTable.verifyColumnContainsText(columnName, expectedValue);
}
);