@@ -8,6 +8,15 @@ export const { Given, When, Then } = createBdd(test);
88
99const VULN_TABLE_NAME = "vulnerability table" ;
1010
11+ Given (
12+ "User visits Advisory details Page of {string}" ,
13+ async ( { page } , advisoryID ) => {
14+ const searchPage = new SearchPage ( page , "Advisories" ) ;
15+ await searchPage . dedicatedSearch ( advisoryID ) ;
16+ await page . getByRole ( "link" , { name : advisoryID , exact : true } ) . click ( ) ;
17+ } ,
18+ ) ;
19+
1120Given (
1221 "User visits Advisory details Page of {string} with type {string}" ,
1322 async ( { page } , advisoryName , advisoryType ) => {
@@ -18,6 +27,59 @@ Given(
1827 } ,
1928) ;
2029
30+ // Advisory Search
31+ When (
32+ "User searches for an advisory named {string} in the general search bar" ,
33+ async ( { page } , item ) => {
34+ const searchPage = new SearchPage ( page , "Dashboard" ) ;
35+ await searchPage . generalSearch ( "Advisories" , item ) ;
36+ } ,
37+ ) ;
38+
39+ When (
40+ "User searches for {string} in the dedicated search bar" ,
41+ async ( { page } , advisoryID ) => {
42+ const searchPage = new SearchPage ( page , "Advisories" ) ;
43+ await searchPage . dedicatedSearch ( advisoryID ) ;
44+ } ,
45+ ) ;
46+
47+ Then (
48+ "The advisory {string} shows in the results" ,
49+ async ( { page } , advisoryID ) => {
50+ await expect (
51+ page . getByRole ( "gridcell" ) . filter ( { hasText : advisoryID } ) ,
52+ ) . toBeVisible ( ) ;
53+ } ,
54+ ) ;
55+
56+ // Advisory Explorer
57+ Then (
58+ "The vulnerabilities table is sorted by {string}" ,
59+ async ( { page } , columnName ) => {
60+ const toolbarTable = new ToolbarTable ( page , VULNERABILITIES_TABLE_NAME ) ;
61+ await toolbarTable . verifyTableIsSortedBy ( columnName ) ;
62+ } ,
63+ ) ;
64+
65+ Then (
66+ "The vulnerabilities table total results is {int}" ,
67+ async ( { page } , totalResults ) => {
68+ const toolbarTable = new ToolbarTable ( page , VULNERABILITIES_TABLE_NAME ) ;
69+ await toolbarTable . verifyPaginationHasTotalResults ( totalResults ) ;
70+ } ,
71+ ) ;
72+
73+ Then (
74+ "The {string} column of the vulnerability table contains {string}" ,
75+ async ( { page } , columnName , expectedValue ) => {
76+ const toolbarTable = new ToolbarTable ( page , VULNERABILITIES_TABLE_NAME ) ;
77+ await toolbarTable . verifyColumnContainsText ( columnName , expectedValue ) ;
78+ } ,
79+ ) ;
80+
81+ // Advisory Explorer / Vulenrabilities
82+
2183Then (
2284 "User navigates to the Vulnerabilities tab on the Advisory Overview page" ,
2385 async ( { page } ) => {
0 commit comments