Skip to content

Commit 25cdec0

Browse files
committed
feat: Add ServiceNow configuration handling during app installation
1 parent ad614f2 commit 25cdec0

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

e2e/src/pages/AppCatalogPage.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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: /servicenow|configuration/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(/instance.*url/i)
101+
.or(this.page.getByPlaceholder(/instance.*url/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(/username/i)
110+
.or(this.page.getByPlaceholder(/username/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(/password/i)
119+
.or(this.page.getByPlaceholder(/password/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: /next|install|continue/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

Comments
 (0)