diff --git a/e2e-tests/admin/pages/credential-stores.js b/e2e-tests/admin/pages/credential-stores.js index e0f77cca4..79ef57667 100644 --- a/e2e-tests/admin/pages/credential-stores.js +++ b/e2e-tests/admin/pages/credential-stores.js @@ -153,7 +153,9 @@ export class CredentialStoresPage extends BaseResourcePage { .getByRole('group', { name: 'Type' }) .getByLabel('Username & Key Pair') .click(); - await this.page.getByLabel('Username', { exact: true }).fill(username); + await this.page + .getByLabel('Username Required', { exact: true }) + .fill(username); const keyData = await readFile(keyPath, { encoding: 'utf-8', }); @@ -211,8 +213,12 @@ export class CredentialStoresPage extends BaseResourcePage { .getByRole('group', { name: 'Type' }) .getByLabel('Username & Password') .click(); - await this.page.getByLabel('Username', { exact: true }).fill(username); - await this.page.getByLabel('Password', { exact: true }).fill(password); + await this.page + .getByLabel('Username Required', { exact: true }) + .fill(username); + await this.page + .getByLabel('Password Required', { exact: true }) + .fill(password); await this.page.getByRole('button', { name: 'Save' }).click(); await this.dismissSuccessAlert(); await expect( diff --git a/e2e-tests/admin/pages/targets.js b/e2e-tests/admin/pages/targets.js index ba77a7a29..14ba46848 100644 --- a/e2e-tests/admin/pages/targets.js +++ b/e2e-tests/admin/pages/targets.js @@ -70,8 +70,33 @@ export class TargetsPage extends BaseResourcePage { * @param {string} alias alias used for the target * @returns Name of the target */ - async createTargetWithAddressAndAlias(address, port, alias) { + async createTargetWithAddressAndAlias( + address, + port, + alias, + targetType = 'tcp', + ) { const targetName = 'Target ' + nanoid(); + let targetTypeLabel; + + switch (targetType) { + case 'ssh': { + targetTypeLabel = 'SSH'; + break; + } + case 'rdp': { + targetTypeLabel = 'RDP'; + break; + } + case 'tcp': { + targetTypeLabel = 'Generic TCP'; + break; + } + default: { + throw new Error(`Unexpected target type passed ${targetType}`); + } + } + await this.page .getByRole('navigation', { name: 'Application local navigation' }) .getByRole('link', { name: 'Targets' }) @@ -79,6 +104,7 @@ export class TargetsPage extends BaseResourcePage { await this.page.getByRole('link', { name: 'New', exact: true }).click(); await this.page.getByLabel('Name').fill(targetName); await this.page.getByLabel('Description').fill('This is an automated test'); + await this.page.getByLabel(targetTypeLabel).click(); await this.page.getByLabel('Target Address').fill(address); await this.page.getByLabel('Default Port').fill(port); await this.page diff --git a/e2e-tests/admin/tests/alias-ent.spec.js b/e2e-tests/admin/tests/alias-ent.spec.js index ecb6c56d7..3457f8ac1 100644 --- a/e2e-tests/admin/tests/alias-ent.spec.js +++ b/e2e-tests/admin/tests/alias-ent.spec.js @@ -169,6 +169,7 @@ test.describe('Aliases (Enterprise)', () => { targetAddress, targetPort, alias, + 'ssh', ); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); diff --git a/e2e-tests/helpers/boundary-api-client.ts b/e2e-tests/helpers/boundary-api-client.ts index a5b7073b4..3429119f5 100644 --- a/e2e-tests/helpers/boundary-api-client.ts +++ b/e2e-tests/helpers/boundary-api-client.ts @@ -244,11 +244,13 @@ class BoundaryApi { export const boundaryApiClientTest = base.extend<{ apiClient: BoundaryApi; controllerAddr?: string; - apiClientTestAfter?: () => {}; + apiClientTestAfter?: () => void; }>({ - // this is a noop so that the `apiClient` fixture doesn't fail for other tests, - // the `apiClientTestAfter` fixture is used in api-client tests to provide a hook for assertions - apiClientTestAfter: () => {}, + apiClientTestAfter: async ({}, use) => { + // this is a noop so that the `apiClient` fixture doesn't fail for other tests, + // the `apiClientTestAfter` fixture is used in api-client tests to provide a hook for assertions + await use(() => {}); + }, apiClient: async ({ controllerAddr, apiClientTestAfter }, use) => { // by destructuring the `apiClientTestAfter` fixture it creates a dependency on that fixture which // controls the setup/teardown order and allows `api-client.spec.js` to test the teardown cleanup