@@ -14,11 +14,11 @@ test.describe("Test Quick Start plugin", () => {
1414
1515 test . beforeEach ( async ( { page } ) => {
1616 common = new Common ( page ) ;
17- await common . loginAsKeycloakUser ( ) ;
1817 uiHelper = new UIhelper ( page ) ;
1918 } ) ;
2019
2120 test ( "Access Quick start from Global Header" , async ( { page } ) => {
21+ await common . loginAsKeycloakUser ( ) ;
2222 await page . waitForTimeout ( 1000 ) ;
2323 // eslint-disable-next-line playwright/no-conditional-in-test
2424 if ( await page . getByRole ( "button" , { name : "Hide" } ) . isHidden ( ) ) {
@@ -27,20 +27,32 @@ test.describe("Test Quick Start plugin", () => {
2727 console . log ( "Quick start button clicked" ) ;
2828 }
2929 await expect ( page . getByRole ( "button" , { name : "Hide" } ) ) . toBeVisible ( ) ;
30+ } ) ;
31+
32+ test ( "Access Quick start as Guest or Admin" , async ( { page } ) => {
33+ // eslint-disable-next-line playwright/no-conditional-in-test
34+ if ( test . info ( ) . project . name !== "showcase-rbac" ) {
35+ await common . loginAsGuest ( ) ;
36+ } else {
37+ await common . loginAsKeycloakUser ( ) ;
38+ }
39+ await page . waitForTimeout ( 1000 ) ;
3040 await uiHelper . verifyText ( "Let's get you started with Developer Hub" ) ;
3141 await uiHelper . verifyText ( "We'll guide you through a few quick steps" ) ;
3242 await uiHelper . verifyText ( "Not started" ) ;
3343 await uiHelper . clickButtonByText ( "Set up authentication" ) ;
3444 await uiHelper . verifyButtonURL (
3545 "Learn more" ,
3646 "https://docs.redhat.com/en/documentation/red_hat_developer_hub/latest/html/authentication_in_red_hat_developer_hub/" ,
47+ { exact : false } ,
3748 ) ;
3849 await uiHelper . clickButtonByText ( "Configure RBAC" ) ;
3950 await uiHelper . verifyButtonURL ( "Manage access" , "/rbac" ) ;
4051 await uiHelper . clickButtonByText ( "Configure Git" ) ;
4152 await uiHelper . verifyButtonURL (
4253 "Learn more" ,
4354 "https://docs.redhat.com/en/documentation/red_hat_developer_hub/latest/html/integrating_red_hat_developer_hub_with_github/" ,
55+ { exact : false } ,
4456 ) ;
4557 await uiHelper . clickButtonByText ( "Manage plugins" ) ;
4658 await uiHelper . verifyButtonURL ( "Explore plugins" , "/extensions" ) ;
@@ -51,4 +63,34 @@ test.describe("Test Quick Start plugin", () => {
5163 await uiHelper . clickButton ( "Hide" ) ;
5264 await expect ( page . getByRole ( "button" , { name : "Hide" } ) ) . toBeHidden ( ) ;
5365 } ) ;
66+
67+ test ( "Access Quick start as User" , async ( { page } ) => {
68+ // eslint-disable-next-line playwright/no-conditional-in-test
69+ if ( test . info ( ) . project . name !== "showcase-rbac" ) {
70+ test . skip ( ) ;
71+ }
72+ await common . loginAsKeycloakUser (
73+ process . env . GH_USER2_ID ,
74+ process . env . GH_USER2_PASS ,
75+ ) ;
76+ await page . waitForTimeout ( 1000 ) ;
77+ await uiHelper . verifyText ( "Let's get you started with Developer Hub" ) ;
78+ await uiHelper . verifyText ( "We'll guide you through a few quick steps" ) ;
79+ await uiHelper . clickButtonByText ( "Import application" ) ;
80+ await uiHelper . verifyButtonURL ( "Import" , "/bulk-import" ) ;
81+ await uiHelper . clickButtonByText ( "Import" ) ;
82+ await uiHelper . clickButtonByText ( "Learn about the Catalog" ) ;
83+ await uiHelper . verifyButtonURL ( "View Catalog" , "/catalog" ) ;
84+ await uiHelper . clickButtonByText ( "View Catalog" ) ;
85+ await uiHelper . verifyText ( / A l l C o m p o n e n t s \( ( \d + ) \) / ) ;
86+ await uiHelper . clickButtonByText ( "Explore Self-service templates" ) ;
87+ await uiHelper . verifyButtonURL ( "Explore templates" , "/create" ) ;
88+ await uiHelper . clickButtonByText ( "Explore templates" ) ;
89+ await uiHelper . verifyText ( "Self-service" ) ;
90+ await uiHelper . clickButtonByText ( "Find all Learning Paths" ) ;
91+ await uiHelper . verifyButtonURL ( "View Learning Paths" , "/docs" ) ;
92+ await uiHelper . clickButtonByText ( "View Learning Paths" ) ;
93+ await uiHelper . verifyText ( "Documentation" ) ;
94+ await uiHelper . verifyText ( "100% progress" ) ;
95+ } ) ;
5496} ) ;
0 commit comments