@@ -2,10 +2,7 @@ import { test, expect, Page, BrowserContext } from "@support/coverage/test";
22import { UIhelper } from "../utils/ui-helper" ;
33import { Common , setupBrowser , teardownBrowser } from "../utils/common" ;
44import { RESOURCES } from "../support/test-data/resources" ;
5- import {
6- BackstageShowcase ,
7- CatalogImport ,
8- } from "../support/pages/catalog-import" ;
5+ import { RhdhInstance , CatalogImport } from "../support/pages/catalog-import" ;
96import { TEMPLATES } from "../support/test-data/templates" ;
107
118type GithubPullRequest = { title : string ; number : string } ;
@@ -38,11 +35,11 @@ function parseGithubPullRequests(data: unknown): GithubPullRequest[] {
3835 } ) ;
3936}
4037
41- async function getShowcasePullRequests (
38+ async function getRhdhPullRequests (
4239 state : "open" | "closed" | "all" ,
4340 paginated = false ,
4441) : Promise < GithubPullRequest [ ] > {
45- const data : unknown = await BackstageShowcase . getShowcasePRs (
42+ const data : unknown = await RhdhInstance . getRhdhPullRequests (
4643 state ,
4744 paginated ,
4845 ) ;
@@ -57,7 +54,7 @@ test.describe.fixme("GitHub Happy path", () => {
5754 let common : Common ;
5855 let uiHelper : UIhelper ;
5956 let catalogImport : CatalogImport ;
60- let backstageShowcase : BackstageShowcase ;
57+ let rhdhInstance : RhdhInstance ;
6158
6259 const component =
6360 "https://github.com/redhat-developer/rhdh/blob/main/catalog-entities/all.yaml" ;
@@ -72,7 +69,7 @@ test.describe.fixme("GitHub Happy path", () => {
7269 uiHelper = new UIhelper ( page ) ;
7370 common = new Common ( page ) ;
7471 catalogImport = new CatalogImport ( page ) ;
75- backstageShowcase = new BackstageShowcase ( page ) ;
72+ rhdhInstance = new RhdhInstance ( page ) ;
7673 test . info ( ) . setTimeout ( 600 * 1000 ) ;
7774 } ) ;
7875
@@ -173,15 +170,15 @@ test.describe.fixme("GitHub Happy path", () => {
173170 await page . getByRole ( "button" , { name : "20" } ) . click ( ) ;
174171 await page . getByRole ( "option" , { name : "10" , exact : true } ) . click ( ) ;
175172
176- await backstageShowcase . verifyPRStatisticsRendered ( ) ;
177- await backstageShowcase . verifyAboutCardIsDisplayed ( ) ;
173+ await rhdhInstance . verifyPRStatisticsRendered ( ) ;
174+ await rhdhInstance . verifyAboutCardIsDisplayed ( ) ;
178175 } ) ;
179176
180177 test ( "Verify that the Pull/Merge Requests tab renders the 5 most recently updated Open Pull Requests" , async ( ) => {
181178 await uiHelper . clickTab ( "Pull/Merge Requests" ) ;
182- const openPRs = await getShowcasePullRequests ( "open" ) ;
179+ const openPRs = await getRhdhPullRequests ( "open" ) ;
183180 await expect (
184- backstageShowcase . verifyPRRows ( openPRs , 0 , 5 ) ,
181+ rhdhInstance . verifyPRRows ( openPRs , 0 , 5 ) ,
185182 ) . resolves . toBeUndefined ( ) ;
186183 } ) ;
187184
@@ -191,16 +188,16 @@ test.describe.fixme("GitHub Happy path", () => {
191188 await expect ( closedButton ) . toBeVisible ( ) ;
192189 await expect ( closedButton ) . toBeEnabled ( ) ;
193190 await closedButton . click ( ) ;
194- const closedPRs = await getShowcasePullRequests ( "closed" ) ;
191+ const closedPRs = await getRhdhPullRequests ( "closed" ) ;
195192 await common . waitForLoad ( ) ;
196193 await expect (
197- backstageShowcase . verifyPRRows ( closedPRs , 0 , 5 ) ,
194+ rhdhInstance . verifyPRRows ( closedPRs , 0 , 5 ) ,
198195 ) . resolves . toBeUndefined ( ) ;
199196 } ) ;
200197
201198 test ( "Click on the arrows to verify that the next/previous/first/last pages of PRs are loaded" , async ( ) => {
202199 console . log ( "Fetching all PRs from GitHub" ) ;
203- const allPRs = await getShowcasePullRequests ( "all" , true ) ;
200+ const allPRs = await getRhdhPullRequests ( "all" , true ) ;
204201
205202 console . log ( "Clicking on ALL button" ) ;
206203 // Use semantic selector and wait for button to be ready (no force needed)
@@ -209,30 +206,30 @@ test.describe.fixme("GitHub Happy path", () => {
209206 await expect ( allButton ) . toBeEnabled ( ) ;
210207 await allButton . click ( ) ;
211208 await expect (
212- backstageShowcase . verifyPRRows ( allPRs , 0 , 5 ) ,
209+ rhdhInstance . verifyPRRows ( allPRs , 0 , 5 ) ,
213210 ) . resolves . toBeUndefined ( ) ;
214211
215212 console . log ( "Clicking on Next Page button" ) ;
216- await backstageShowcase . clickNextPage ( ) ;
213+ await rhdhInstance . clickNextPage ( ) ;
217214 await expect (
218- backstageShowcase . verifyPRRows ( allPRs , 5 , 10 ) ,
215+ rhdhInstance . verifyPRRows ( allPRs , 5 , 10 ) ,
219216 ) . resolves . toBeUndefined ( ) ;
220217
221218 // const lastPagePRs = Math.floor((allPRs.length - 1) / 5) * 5;
222219 // redhat-developer/rhdh have more than 1000 PRs open/closed and by default the latest 1000 PR results are displayed.
223220 const lastPagePRs = 996 ;
224221
225222 console . log ( "Clicking on Last Page button" ) ;
226- await backstageShowcase . clickLastPage ( ) ;
223+ await rhdhInstance . clickLastPage ( ) ;
227224 await expect (
228- backstageShowcase . verifyPRRows ( allPRs , lastPagePRs , 1000 ) ,
225+ rhdhInstance . verifyPRRows ( allPRs , lastPagePRs , 1000 ) ,
229226 ) . resolves . toBeUndefined ( ) ;
230227
231228 console . log ( "Clicking on Previous Page button" ) ;
232- await backstageShowcase . clickPreviousPage ( ) ;
229+ await rhdhInstance . clickPreviousPage ( ) ;
233230 await common . waitForLoad ( ) ;
234231 await expect (
235- backstageShowcase . verifyPRRows ( allPRs , lastPagePRs - 5 , lastPagePRs - 1 ) ,
232+ rhdhInstance . verifyPRRows ( allPRs , lastPagePRs - 5 , lastPagePRs - 1 ) ,
236233 ) . resolves . toBeUndefined ( ) ;
237234 } ) ;
238235
@@ -241,15 +238,15 @@ test.describe.fixme("GitHub Happy path", () => {
241238 await uiHelper . clickLink ( "Red Hat Developer Hub" ) ;
242239 await common . clickOnGHloginPopup ( ) ;
243240 await uiHelper . clickTab ( "Pull/Merge Requests" ) ;
244- const allPRs = await getShowcasePullRequests ( "open" ) ;
241+ const allPRs = await getRhdhPullRequests ( "open" ) ;
245242 await expect (
246- backstageShowcase . verifyPRRowsPerPage ( 5 , allPRs ) ,
243+ rhdhInstance . verifyPRRowsPerPage ( 5 , allPRs ) ,
247244 ) . resolves . toBeUndefined ( ) ;
248245 await expect (
249- backstageShowcase . verifyPRRowsPerPage ( 10 , allPRs ) ,
246+ rhdhInstance . verifyPRRowsPerPage ( 10 , allPRs ) ,
250247 ) . resolves . toBeUndefined ( ) ;
251248 await expect (
252- backstageShowcase . verifyPRRowsPerPage ( 20 , allPRs ) ,
249+ rhdhInstance . verifyPRRowsPerPage ( 20 , allPRs ) ,
253250 ) . resolves . toBeUndefined ( ) ;
254251 } ) ;
255252
0 commit comments