@@ -9,6 +9,23 @@ test.describe("Admin > Extensions > Catalog", () => {
99 let uiHelper : UIhelper ;
1010 const isMac = process . platform === "darwin" ;
1111
12+ const commonHeadings = [
13+ "Versions" ,
14+ "Author" ,
15+ "Tags" ,
16+ "Category" ,
17+ "Publisher" ,
18+ "Support Provider" ,
19+ ] ;
20+ const supportTypeOptions = [
21+ "Generally available" ,
22+ "Certified" ,
23+ "Custom plugin" ,
24+ "Tech preview" ,
25+ "Dev preview" ,
26+ "Community plugin" ,
27+ ] ;
28+
1229 test . beforeAll ( async ( ) => {
1330 test . info ( ) . annotations . push ( {
1431 type : "component" ,
@@ -31,7 +48,9 @@ test.describe("Admin > Extensions > Catalog", () => {
3148 await page . getByRole ( "button" , { name : "Clear Search" } ) . click ( ) ;
3249 } ) ;
3350
34- test ( "Verify filters in extensions" , async ( { page } , testInfo ) => {
51+ test ( "Verify category and author filters in extensions" , async ( {
52+ page,
53+ } , testInfo ) => {
3554 await uiHelper . verifyHeading ( / P l u g i n s \( \d + \) / ) ;
3655
3756 await runAccessibilityTests ( page , testInfo ) ;
@@ -69,6 +88,19 @@ test.describe("Admin > Extensions > Catalog", () => {
6988 await page . keyboard . press ( `Escape` ) ;
7089 } ) ;
7190
91+ test ( "Verify support type filters in extensions" , async ( { page } ) => {
92+ await extensions . selectDropdown ( "Support type" ) ;
93+ await expect ( page . getByRole ( "listbox" ) ) . toBeVisible ( ) ;
94+
95+ // Verify all support type options are present
96+ for ( const option of supportTypeOptions ) {
97+ await expect ( page . getByRole ( "listbox" ) ) . toContainText ( option ) ;
98+ }
99+
100+ await page . keyboard . press ( "Escape" ) ;
101+ await expect ( page . getByLabel ( "Category" ) . getByRole ( "combobox" ) ) . toBeEmpty ( ) ;
102+ } ) ;
103+
72104 test ( "Verify certified badge in extensions" , async ( { page } ) => {
73105 await extensions . selectDropdown ( "Support type" ) ;
74106 await extensions . toggleOption ( "Certified" ) ;
@@ -97,20 +129,115 @@ test.describe("Admin > Extensions > Catalog", () => {
97129 await page . getByRole ( "button" , { name : "close" } ) . click ( ) ;
98130 await extensions . selectDropdown ( "Support type" ) ;
99131 await extensions . toggleOption ( "Certified" ) ;
100- // Below code will be handled as part of the task https://issues.redhat.com/browse/RHIDP-8593
101- // await extensions.toggleOption("Custom plugin");
102- // await page.keyboard.press(`Escape`);
103- // await expect(page.getByLabel("Verified by Red Hat").first()).toBeVisible();
104- // await expect(extensions.badge.first()).toBeVisible();
105- // await extensions.badge.first().hover();
106- // await uiHelper.verifyTextInTooltip("Verified by Red Hat");
132+ } ) ;
133+
134+ test ( "Verify Generally available badge in extensions" , async ( { page } ) => {
135+ await extensions . selectSupportTypeFilter ( "Generally available (GA)" ) ;
136+
137+ await expect (
138+ page
139+ . getByLabel ( "Generally available (GA) and supported by Red Hat" )
140+ . first ( ) ,
141+ ) . toBeVisible ( ) ;
142+ await expect ( extensions . badge . first ( ) ) . toBeVisible ( ) ;
143+ await extensions . badge . first ( ) . hover ( ) ;
144+ await uiHelper . verifyTextInTooltip (
145+ "Generally available (GA) and supported by Red Hat" ,
146+ ) ;
147+
148+ await uiHelper . clickLink ( "Read more" ) ;
149+ await expect (
150+ page
151+ . getByLabel ( "Production-ready and supported by Red Hat" )
152+ . getByText ( "Generally available (GA)" ) ,
153+ ) . toBeVisible ( ) ;
154+
155+ for ( const heading of commonHeadings ) {
156+ console . log ( `Verifying heading: ${ heading } ` ) ;
157+ await uiHelper . verifyHeading ( heading ) ;
158+ }
159+
160+ await page . getByRole ( "button" , { name : "close" } ) . click ( ) ;
161+
162+ await extensions . resetSupportTypeFilter ( "Generally available (GA)" ) ;
163+ } ) ;
164+
165+ // Skipping below test due to the issue: https://issues.redhat.com/browse/RHDHBUGS-2104
166+ test . skip ( "Verify custom plugin badge in extensions" , async ( { page } ) => {
167+ await extensions . selectDropdown ( "Support type" ) ;
168+ await extensions . toggleOption ( "Custom plugin" ) ;
169+ await page . keyboard . press ( `Escape` ) ;
170+ await expect ( page . getByLabel ( "Custom plugins" ) . first ( ) ) . toBeVisible ( ) ;
171+ await expect ( extensions . badge . first ( ) ) . toBeVisible ( ) ;
172+ await extensions . badge . first ( ) . hover ( ) ;
173+ await uiHelper . verifyTextInTooltip ( "Custom plugins" ) ;
174+ await uiHelper . clickLink ( "Read more" ) ;
175+ await expect (
176+ page . getByLabel ( "Plugins added by the administrator" ) . getByText ( "Custom" ) ,
177+ ) . toBeVisible ( ) ;
178+ await page . getByRole ( "button" , { name : "close" } ) . click ( ) ;
179+ await extensions . selectDropdown ( "Support type" ) ;
180+ await extensions . toggleOption ( "Custom plugin" ) ;
181+ await page . keyboard . press ( `Escape` ) ;
182+ } ) ;
183+
184+ test ( "Verify tech preview badge in extensions" , async ( ) => {
185+ await extensions . verifySupportTypeBadge ( {
186+ supportType : "Tech preview (TP)" ,
187+ pluginName : "Bulk Import" ,
188+ badgeLabel : "Plugin still in development" ,
189+ badgeText : "Tech preview (TP)" ,
190+ tooltipText : "" ,
191+ searchTerm : "Bulk Import" ,
192+ headings : [ "About" , "Versions" , ...commonHeadings ] ,
193+ includeTable : true ,
194+ includeAbout : false ,
195+ } ) ;
196+ } ) ;
197+
198+ test ( "Verify dev preview badge in extensions" , async ( ) => {
199+ await extensions . selectSupportTypeFilter ( "Dev preview (DP)" ) ;
200+ await uiHelper . verifyHeading ( "Developer Lightspeed" ) ;
201+
202+ await extensions . verifyPluginDetails ( {
203+ pluginName : "Developer Lightspeed" ,
204+ badgeLabel : "An early-stage, experimental" ,
205+ badgeText : "Dev preview (DP)" ,
206+ headings : commonHeadings ,
207+ includeTable : true ,
208+ includeAbout : false ,
209+ } ) ;
210+
211+ await extensions . resetSupportTypeFilter ( "Dev preview (DP)" ) ;
212+ } ) ;
213+
214+ test ( "Verify community plugin badge in extensions" , async ( { page } ) => {
215+ await extensions . selectSupportTypeFilter ( "Community plugin" ) ;
216+
217+ await uiHelper . clickLink ( "Read more" ) ;
218+ await expect (
219+ page
220+ . getByLabel ( "Open-source plugins, no official support" )
221+ . getByText ( "Community plugin" ) ,
222+ ) . toBeVisible ( ) ;
223+
224+ await uiHelper . verifyText ( "About" ) ;
225+ for ( const heading of commonHeadings ) {
226+ console . log ( `Verifying heading: ${ heading } ` ) ;
227+ await uiHelper . verifyHeading ( heading ) ;
228+ }
229+
230+ await expect ( page . getByText ( "AuthorRed Hat" ) ) . toBeVisible ( ) ;
231+
232+ await page . getByRole ( "button" , { name : "close" } ) . click ( ) ;
233+ await extensions . resetSupportTypeFilter ( "Community plugin" ) ;
107234 } ) ;
108235
109236 test . use ( {
110237 permissions : [ "clipboard-read" , "clipboard-write" ] ,
111238 } ) ;
112239
113- test ( "Verify plugin configuration can be viewed in the production environment" , async ( {
240+ test . skip ( "Verify plugin configuration can be viewed in the production environment" , async ( {
114241 page,
115242 } ) => {
116243 const productionEnvAlert = page
0 commit comments