@@ -2,6 +2,8 @@ import { test, Page, expect } from "@playwright/test";
2
2
import { Common , setupBrowser } from "../../utils/common" ;
3
3
import { UIhelper } from "../../utils/ui-helper" ;
4
4
import * as constants from "../../utils/authenticationProviders/constants" ;
5
+ import { dumpAllPodsLogs , dumpRHDHUsersAndGroups } from "../../utils/helper" ;
6
+ import { APIHelper } from "../../utils/api-helper" ;
5
7
import { LOGGER } from "../../utils/logger" ;
6
8
import { HelmActions } from "../../utils/helm" ;
7
9
@@ -39,16 +41,16 @@ test.describe("Standard authentication providers: Basic authentication", () => {
39
41
constants . QUAY_REPO ,
40
42
constants . TAG_NAME ,
41
43
[
42
- "--set upstream.backstage.appConfig.auth.providers=null " ,
44
+ "--set upstream.backstage.appConfig.auth.providers.guest.dangerouslyAllowOutsideDevelopment=false " ,
43
45
"--set upstream.backstage.appConfig.auth.environment=development" ,
44
46
"--set upstream.backstage.appConfig.catalog.providers=null" ,
47
+ "--set upstream.backstage.appConfig.permission.enabled=false" ,
45
48
] ,
46
49
) ;
47
50
48
51
// Guest login should work
49
52
await common . loginAsGuest ( ) ;
50
- await uiHelper . openSidebar ( "Settings" ) ;
51
- await uiHelper . verifyHeading ( "Guest" ) ;
53
+ await page . goto ( "/" ) ;
52
54
await uiHelper . openSidebar ( "Settings" ) ;
53
55
await common . signOut ( ) ;
54
56
} ) ;
@@ -77,6 +79,7 @@ test.describe("Standard authentication providers: Basic authentication", () => {
77
79
"--set upstream.backstage.appConfig.auth.environment=development" ,
78
80
"--set upstream.backstage.appConfig.signInPage=microsoft" ,
79
81
"--set upstream.backstage.appConfig.catalog.providers=null" ,
82
+ "--set upstream.backstage.appConfig.permission.enabled=false" ,
80
83
] ,
81
84
) ;
82
85
@@ -112,6 +115,7 @@ test.describe("Standard authentication providers: Basic authentication", () => {
112
115
"--set upstream.backstage.appConfig.signInPage=microsoft" ,
113
116
"--set upstream.backstage.appConfig.dangerouslyAllowSignInWithoutUserInCatalog=true" ,
114
117
"--set upstream.backstage.appConfig.catalog.providers=null" ,
118
+ "--set upstream.backstage.appConfig.permission.enabled=false" ,
115
119
] ,
116
120
) ;
117
121
@@ -124,10 +128,10 @@ test.describe("Standard authentication providers: Basic authentication", () => {
124
128
await uiHelper . verifyParagraph ( constants . AZURE_LOGIN_USERNAME ) ;
125
129
126
130
// check no entities are in the catalog
127
- await page . goto ( "/catalog?filters[kind]=user&filters[user]=all" ) ;
128
- await uiHelper . verifyHeading ( "My Org Catalog" ) ;
129
- await uiHelper . searchInputPlaceholder ( constants . AZURE_LOGIN_FIRSTNAME ) ;
130
- await uiHelper . verifyRowsInTable ( [ "No records to display" ] ) ;
131
+ const api = new APIHelper ( ) ;
132
+ api . UseStaticToken ( constants . STATIC_API_TOKEN ) ;
133
+ const catalogUsers = await api . getAllCatalogUsersFromAPI ( ) ;
134
+ expect ( catalogUsers . totalItems ) . toBe ( 0 ) ;
131
135
await uiHelper . openSidebar ( "Settings" ) ;
132
136
await common . signOut ( ) ;
133
137
} ) ;
@@ -154,6 +158,7 @@ test.describe("Standard authentication providers: Basic authentication", () => {
154
158
"--set upstream.backstage.appConfig.signInPage=microsoft" ,
155
159
"--set upstream.backstage.appConfig.dangerouslyAllowSignInWithoutUserInCatalog=true" ,
156
160
"--set upstream.backstage.appConfig.catalog.providers=null" ,
161
+ "--set upstream.backstage.appConfig.permission.enabled=false" ,
157
162
] ,
158
163
) ;
159
164
@@ -162,7 +167,15 @@ test.describe("Standard authentication providers: Basic authentication", () => {
162
167
const singInMethods = await page
163
168
. locator ( "div[class^='MuiCardHeader-root']" )
164
169
. allInnerTexts ( ) ;
165
- console . log ( singInMethods ) ;
166
170
expect ( singInMethods ) . not . toContain ( "Guest" ) ;
167
171
} ) ;
172
+
173
+ test . afterEach ( async ( ) => {
174
+ if ( test . info ( ) . status !== test . info ( ) . expectedStatus ) {
175
+ const prefix = `${ test . info ( ) . testId } _${ test . info ( ) . retry } ` ;
176
+ LOGGER . info ( `Dumping logs with prefix ${ prefix } ` ) ;
177
+ await dumpAllPodsLogs ( prefix , constants . LOGS_FOLDER ) ;
178
+ await dumpRHDHUsersAndGroups ( prefix , constants . LOGS_FOLDER ) ;
179
+ }
180
+ } ) ;
168
181
} ) ;
0 commit comments