@@ -72,6 +72,9 @@ export class AppCatalogPage extends BasePage {
7272 await this . smartClick ( installButton , 'Install button' ) ;
7373 await this . waiter . delay ( 2000 ) ;
7474
75+ // Check for ServiceNow configuration screen
76+ await this . handleServiceNowConfiguration ( ) ;
77+
7578 // Wait for installation to complete
7679 await this . waitForInstallation ( appName ) ;
7780
@@ -83,6 +86,53 @@ export class AppCatalogPage extends BasePage {
8386 return false ;
8487 }
8588
89+ /**
90+ * Handle ServiceNow configuration screen if present
91+ */
92+ private async handleServiceNowConfiguration ( ) : Promise < void > {
93+ // Check if ServiceNow configuration modal appears
94+ const configHeading = this . page . getByRole ( 'heading' , { name : / s e r v i c e n o w | c o n f i g u r a t i o n / i } ) ;
95+
96+ if ( await this . elementExists ( configHeading , 3000 ) ) {
97+ this . logger . info ( 'ServiceNow configuration screen detected, filling dummy values' ) ;
98+
99+ // Fill Instance URL
100+ const instanceUrlField = this . page . getByLabel ( / i n s t a n c e .* u r l / i)
101+ . or ( this . page . getByPlaceholder ( / i n s t a n c e .* u r l / i) )
102+ . first ( ) ;
103+ if ( await this . elementExists ( instanceUrlField , 2000 ) ) {
104+ await instanceUrlField . fill ( 'https://dummy.service-now.com' ) ;
105+ this . logger . info ( 'Filled Instance URL' ) ;
106+ }
107+
108+ // Fill Username
109+ const usernameField = this . page . getByLabel ( / u s e r n a m e / i)
110+ . or ( this . page . getByPlaceholder ( / u s e r n a m e / i) )
111+ . first ( ) ;
112+ if ( await this . elementExists ( usernameField , 2000 ) ) {
113+ await usernameField . fill ( 'dummy_user' ) ;
114+ this . logger . info ( 'Filled Username' ) ;
115+ }
116+
117+ // Fill Password (must be >8 characters)
118+ const passwordField = this . page . getByLabel ( / p a s s w o r d / i)
119+ . or ( this . page . getByPlaceholder ( / p a s s w o r d / i) )
120+ . first ( ) ;
121+ if ( await this . elementExists ( passwordField , 2000 ) ) {
122+ await passwordField . fill ( 'DummyPassword123' ) ;
123+ this . logger . info ( 'Filled Password' ) ;
124+ }
125+
126+ // Click Next or Install button to proceed
127+ const proceedButton = this . page . getByRole ( 'button' , { name : / n e x t | i n s t a l l | c o n t i n u e / i } ) ;
128+ if ( await this . elementExists ( proceedButton , 2000 ) ) {
129+ await this . smartClick ( proceedButton , 'Proceed button' ) ;
130+ this . logger . info ( 'Clicked proceed button after configuration' ) ;
131+ await this . waiter . delay ( 2000 ) ;
132+ }
133+ }
134+ }
135+
86136 /**
87137 * Wait for installation to complete
88138 */
0 commit comments