mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-01-25 02:08:11 +00:00
fix(test-ui): update authentication method selection in ProvidersPage for AWS Add Provider e2e test (#9161)
This commit is contained in:
@@ -689,4 +689,23 @@ export class ProvidersPage extends BasePage {
|
||||
await this.goto();
|
||||
await expect(this.providersTable).toBeVisible({ timeout: 10000 });
|
||||
}
|
||||
|
||||
async selectAuthenticationMethod(method: AWSCredentialType): Promise<void> {
|
||||
// Select the authentication method
|
||||
|
||||
// Search botton that contains text AWS SDK Default or Prowler Cloud will assume or Access & Secret Key
|
||||
const button = this.page.locator('button').filter({ hasText: /AWS SDK Default|Prowler Cloud will assume|Access & Secret Key/i });
|
||||
await button.click();
|
||||
|
||||
if (method === AWS_CREDENTIAL_OPTIONS.AWS_ROLE_ARN) {
|
||||
|
||||
const modal = this.page.locator('[role="dialog"], .modal, [data-testid*="modal"]').first();
|
||||
await expect(modal).toBeVisible({ timeout: 10000 });
|
||||
|
||||
// Select the role credentials
|
||||
this.page.getByRole('option', { name: 'Access & Secret Key' }).click({ force: true });
|
||||
} else {
|
||||
throw new Error(`Invalid authentication method: ${method}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +164,11 @@ test.describe("Add Provider", () => {
|
||||
);
|
||||
await providersPage.verifyCredentialsPageLoaded();
|
||||
|
||||
// Select Authentication Method
|
||||
await providersPage.selectAuthenticationMethod(
|
||||
AWS_CREDENTIAL_OPTIONS.AWS_ROLE_ARN,
|
||||
);
|
||||
|
||||
// Fill role credentials
|
||||
await providersPage.fillRoleCredentials(roleCredentials);
|
||||
await providersPage.clickNext();
|
||||
|
||||
Reference in New Issue
Block a user