From ea591df0bb3a2dec7ba49f3ae7788d1248a6a5c3 Mon Sep 17 00:00:00 2001 From: dillanb-hashi Date: Tue, 30 Sep 2025 09:35:26 -0700 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=92=8D=20Refactor=20target=20func?= =?UTF-8?q?tions=20and=20fix=20failing=20test=20(#2999)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: 💍 Fixed broken test * test: 💍 Refactoring to consolidate target function names * test: 💍 fixed failing tests with capitalization issue --- e2e-tests/admin/pages/targets.js | 335 ++---------------- e2e-tests/admin/tests/alias-ent.spec.js | 28 +- e2e-tests/admin/tests/alias.spec.js | 24 +- .../tests/credential-store-static-ent.spec.js | 9 +- .../tests/credential-store-static.spec.js | 8 +- .../tests/credential-store-vault-ent.spec.js | 9 +- .../tests/credential-store-vault.spec.js | 8 +- .../dynamic-host-catalog-aws-ent.spec.js | 5 +- .../tests/dynamic-host-catalog-aws.spec.js | 4 +- .../tests/session-recording-aws-ent.spec.js | 9 +- .../tests/session-recording-minio-ent.spec.js | 9 +- ...sh-certificate-injection-vault-ent.spec.js | 9 +- ...ssh-credential-injection-vault-ent.spec.js | 9 +- e2e-tests/admin/tests/target-ent.spec.js | 32 +- e2e-tests/admin/tests/target.spec.js | 15 +- 15 files changed, 120 insertions(+), 393 deletions(-) diff --git a/e2e-tests/admin/pages/targets.js b/e2e-tests/admin/pages/targets.js index 14ba46848..cb1e3dbdb 100644 --- a/e2e-tests/admin/pages/targets.js +++ b/e2e-tests/admin/pages/targets.js @@ -9,73 +9,15 @@ import { nanoid } from 'nanoid'; import { BaseResourcePage } from './base-resource.js'; export class TargetsPage extends BaseResourcePage { - /** - * Creates a new target. Assumes you have selected the desired project. - * @param {string} port Port of the target - * @returns Name of the target - */ - async createTarget(port) { - const targetName = 'Target ' + nanoid(); - await this.page - .getByRole('navigation', { name: 'Application local navigation' }) - .getByRole('link', { name: 'Targets' }) - .click(); - 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('Default Port').fill(port); - await this.page.getByRole('button', { name: 'Save' }).click(); - await this.dismissSuccessAlert(); - await expect( - this.page - .getByRole('navigation', { name: 'breadcrumbs' }) - .getByText(targetName), - ).toBeVisible(); - - return targetName; - } - - /** - * Creates a new target with address. Assumes you have selected the desired project. - * @param {string} address Address of the target - * @param {string} port Port of the target - * @returns Name of the target - */ - async createTargetWithAddress(address, port) { - const targetName = 'Target ' + nanoid(); - await this.page - .getByRole('navigation', { name: 'Application local navigation' }) - .getByRole('link', { name: 'Targets' }) - .click(); - 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('Target Address').fill(address); - await this.page.getByLabel('Default Port').fill(port); - await this.page.getByRole('button', { name: 'Save' }).click(); - await this.dismissSuccessAlert(); - await expect( - this.page - .getByRole('navigation', { name: 'breadcrumbs' }) - .getByText(targetName), - ).toBeVisible(); - - return targetName; - } - /** * Creates a new target with address and alias. Assumes you have selected the desired project. + * @param {string} targetType Type of target (ssh, rdp, tcp) * @param {string} address Address of the target * @param {string} port Port of the target * @param {string} alias alias used for the target * @returns Name of the target */ - async createTargetWithAddressAndAlias( - address, - port, - alias, - targetType = 'tcp', - ) { + async createTarget({ targetType, port, address, alias }) { const targetName = 'Target ' + nanoid(); let targetTypeLabel; @@ -92,9 +34,6 @@ export class TargetsPage extends BaseResourcePage { targetTypeLabel = 'Generic TCP'; break; } - default: { - throw new Error(`Unexpected target type passed ${targetType}`); - } } await this.page @@ -104,258 +43,24 @@ 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 - .getByRole('group', { name: 'Aliases' }) - .getByLabel('value') - .last() - .fill(alias); - await this.page.getByRole('button', { name: 'Add' }).click(); - - await this.page.getByRole('button', { name: 'Save' }).click(); - await this.dismissSuccessAlert(); - await expect( - this.page - .getByRole('navigation', { name: 'breadcrumbs' }) - .getByText(targetName), - ).toBeVisible(); - - return targetName; - } - - /** - * Creates a new TCP target with address in boundary-enterprise - * Assumes you have selected the desired project. - * @param {string} address Address of the target - * @param {string} port Port of the target - * @returns Name of the target - */ - async createTcpTargetWithAddressEnt(address, port) { - const targetName = 'Target ' + nanoid(); - await this.page - .getByRole('navigation', { name: 'Application local navigation' }) - .getByRole('link', { name: 'Targets' }) - .click(); - 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 - .getByRole('group', { name: 'Type' }) - .getByLabel('TCP') - .click(); - await this.page.getByLabel('Target Address').fill(address); - await this.page.getByLabel('Default Port').fill(port); - await this.page.getByRole('button', { name: 'Save' }).click(); - await this.dismissSuccessAlert(); - await expect( - this.page - .getByRole('navigation', { name: 'breadcrumbs' }) - .getByText(targetName), - ).toBeVisible(); - - return targetName; - } - - /** - * Creates a new SSH target. Assumes you have selected the desired project. - * @param {string} port Port of the target - * @returns Name of the target - */ - async createSshTargetEnt(port) { - const targetName = 'Target ' + nanoid(); - await this.page - .getByRole('navigation', { name: 'Application local navigation' }) - .getByRole('link', { name: 'Targets' }) - .click(); - 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 - .getByRole('group', { name: 'Type' }) - .getByLabel('SSH') - .click(); - await this.page.getByLabel('Default Port').fill(port); - await this.page.getByRole('button', { name: 'Save' }).click(); - await this.dismissSuccessAlert(); - await expect( - this.page - .getByRole('navigation', { name: 'breadcrumbs' }) - .getByText(targetName), - ).toBeVisible(); - - return targetName; - } - - /** - * Creates a new SSH target with address in boundary-enterprise - * Assumes you have selected the desired project. - * @param {string} address Address of the target - * @param {string} port Port of the target - * @returns Name of the target - */ - async createSshTargetWithAddressEnt(address, port) { - const targetName = 'Target ' + nanoid(); - await this.page - .getByRole('navigation', { name: 'Application local navigation' }) - .getByRole('link', { name: 'Targets' }) - .click(); - 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 - .getByRole('group', { name: 'Type' }) - .getByLabel('SSH') - .click(); - await this.page.getByLabel('Target Address').fill(address); - await this.page.getByLabel('Default Port').fill(port); - await this.page.getByRole('button', { name: 'Save' }).click(); - await this.dismissSuccessAlert(); - await expect( - this.page - .getByRole('navigation', { name: 'breadcrumbs' }) - .getByText(targetName), - ).toBeVisible(); - - return targetName; - } - - /** - * Creates a new SSH target with address and alias. - * Assumes you have selected the desired project. - * @param {string} address Address of the target - * @param {string} port Port of the target - * @param {string} alias alias used for the target - * @returns Name of the target - */ - async createSshTargetWithAddressAndAlias(address, port, alias) { - const targetName = 'Target ' + nanoid(); - await this.page - .getByRole('navigation', { name: 'Application local navigation' }) - .getByRole('link', { name: 'Targets' }) - .click(); - 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 - .getByRole('group', { name: 'Type' }) - .getByLabel('SSH') - .click(); - await this.page.getByLabel('Target Address').fill(address); - await this.page.getByLabel('Default Port').fill(port); - await this.page - .getByRole('group', { name: 'Aliases' }) - .getByLabel('value') - .last() - .fill(alias); - await this.page.getByRole('button', { name: 'Add' }).click(); - - await this.page.getByRole('button', { name: 'Save' }).click(); - await this.dismissSuccessAlert(); - await expect( - this.page - .getByRole('navigation', { name: 'breadcrumbs' }) - .getByText(targetName), - ).toBeVisible(); - - return targetName; - } - - /** - * Creates a new RDP target. - * Assumes you have selected the desired project. - * @param {string} port Port of the target - * @returns Name of the target - */ - async createRdpTargetEnt(port) { - const targetName = 'Target ' + nanoid(); - await this.page - .getByRole('navigation', { name: 'Application local navigation' }) - .getByRole('link', { name: 'Targets' }) - .click(); - 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 - .getByRole('group', { name: 'Type' }) - .getByLabel('RDP') - .click(); - await this.page.getByLabel('Default Port').fill(port); - await this.page.getByRole('button', { name: 'Save' }).click(); - await this.dismissSuccessAlert(); - await expect( - this.page - .getByRole('navigation', { name: 'breadcrumbs' }) - .getByText(targetName), - ).toBeVisible(); - - return targetName; - } - - /** - * Creates a new RDP target with address in boundary-enterprise - * Assumes you have selected the desired project. - * @param {string} address Address of the target - * @param {string} port Port of the target - * @returns Name of the target - */ - async createRDPTargetWithAddressEnt(address, port) { - const targetName = 'Target ' + nanoid(); - await this.page - .getByRole('navigation', { name: 'Application local navigation' }) - .getByRole('link', { name: 'Targets' }) - .click(); - 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 - .getByRole('group', { name: 'Type' }) - .getByLabel('RDP') - .click(); - await this.page.getByLabel('Target Address').fill(address); - await this.page.getByLabel('Default Port').fill(port); - await this.page.getByRole('button', { name: 'Save' }).click(); - await this.dismissSuccessAlert(); - await expect( - this.page - .getByRole('navigation', { name: 'breadcrumbs' }) - .getByText(targetName), - ).toBeVisible(); - - return targetName; - } - - /** - * Creates a new RDP target with address and alias. - * Assumes you have selected the desired project. - * @param {string} address Address of the target - * @param {string} port Port of the target - * @param {string} alias alias used for the target - * @returns Name of the target - */ - - async createRdpTargetWithAddressAndAlias(address, port, alias) { - const targetName = 'Target ' + nanoid(); - await this.page - .getByRole('navigation', { name: 'Application local navigation' }) - .getByRole('link', { name: 'Targets' }) - .click(); - 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 - .getByRole('group', { name: 'Type' }) - .getByLabel('RDP') - .click(); - await this.page.getByLabel('Target Address').fill(address); - await this.page.getByLabel('Default Port').fill(port); - await this.page - .getByRole('group', { name: 'Aliases' }) - .getByLabel('value') - .last() - .fill(alias); - await this.page.getByRole('button', { name: 'Add' }).click(); + if (targetType) { + if (targetTypeLabel) + await this.page + .getByRole('group', { name: 'Type' }) + .getByLabel(targetTypeLabel) + .click(); + else throw new Error(`Unsupported target type: ${targetType}`); + } + if (address) await this.page.getByLabel('Target Address').fill(address); + if (port) await this.page.getByLabel('Default Port').fill(port); + if (alias) { + await this.page + .getByRole('group', { name: 'Aliases' }) + .getByLabel('value') + .last() + .fill(alias); + await this.page.getByRole('button', { name: 'Add' }).click(); + } await this.page.getByRole('button', { name: 'Save' }).click(); await this.dismissSuccessAlert(); diff --git a/e2e-tests/admin/tests/alias-ent.spec.js b/e2e-tests/admin/tests/alias-ent.spec.js index 3457f8ac1..1360d4ba4 100644 --- a/e2e-tests/admin/tests/alias-ent.spec.js +++ b/e2e-tests/admin/tests/alias-ent.spec.js @@ -46,10 +46,11 @@ test.describe('Aliases (Enterprise)', () => { await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + address: targetAddress, + }); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); const credentialName = @@ -165,12 +166,12 @@ test.describe('Aliases (Enterprise)', () => { await projectsPage.createProject(); alias = 'example.alias.' + nanoid(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTargetWithAddressAndAlias( - targetAddress, - targetPort, + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + address: targetAddress, alias, - 'ssh', - ); + }); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); const credentialName = @@ -236,10 +237,11 @@ test.describe('Aliases (Enterprise)', () => { const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + address: targetAddress, + }); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); const credentialName = diff --git a/e2e-tests/admin/tests/alias.spec.js b/e2e-tests/admin/tests/alias.spec.js index 88512f9c3..1d44c2954 100644 --- a/e2e-tests/admin/tests/alias.spec.js +++ b/e2e-tests/admin/tests/alias.spec.js @@ -44,10 +44,10 @@ test.describe('Aliases', () => { const projectsPage = new ProjectsPage(page); await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTargetWithAddress( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + port: targetPort, + address: targetAddress, + }); // Create alias for target const aliasName = 'Alias ' + nanoid(); @@ -148,11 +148,11 @@ test.describe('Aliases', () => { await projectsPage.createProject(); alias = 'example.alias.' + nanoid(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTargetWithAddressAndAlias( - targetAddress, - targetPort, + const targetName = await targetsPage.createTarget({ + port: targetPort, + address: targetAddress, alias, - ); + }); // Connect to target using alias connect = await boundaryCli.connectToAlias(alias, sshUser, sshKeyPath); @@ -206,10 +206,10 @@ test.describe('Aliases', () => { const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTargetWithAddress( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + port: targetPort, + address: targetAddress, + }); // Create new alias from scope page await boundaryCli.authenticateBoundary( diff --git a/e2e-tests/admin/tests/credential-store-static-ent.spec.js b/e2e-tests/admin/tests/credential-store-static-ent.spec.js index b022a212c..ae8370f54 100644 --- a/e2e-tests/admin/tests/credential-store-static-ent.spec.js +++ b/e2e-tests/admin/tests/credential-store-static-ent.spec.js @@ -41,10 +41,11 @@ test( const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + address: targetAddress, + }); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); const credentialName = diff --git a/e2e-tests/admin/tests/credential-store-static.spec.js b/e2e-tests/admin/tests/credential-store-static.spec.js index e9acbb69a..1d4ec5452 100644 --- a/e2e-tests/admin/tests/credential-store-static.spec.js +++ b/e2e-tests/admin/tests/credential-store-static.spec.js @@ -31,10 +31,10 @@ test.beforeEach(async ({ page, targetAddress, targetPort }) => { const projectsPage = new ProjectsPage(page); projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - targetName = await targetsPage.createTargetWithAddress( - targetAddress, - targetPort, - ); + targetName = await targetsPage.createTarget({ + port: targetPort, + address: targetAddress, + }); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); }); diff --git a/e2e-tests/admin/tests/credential-store-vault-ent.spec.js b/e2e-tests/admin/tests/credential-store-vault-ent.spec.js index 29efa33cb..af072daee 100644 --- a/e2e-tests/admin/tests/credential-store-vault-ent.spec.js +++ b/e2e-tests/admin/tests/credential-store-vault-ent.spec.js @@ -68,10 +68,11 @@ test( const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + address: targetAddress, + }); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createVaultCredentialStoreWithWorkerFilter( vaultAddrPrivate, diff --git a/e2e-tests/admin/tests/credential-store-vault.spec.js b/e2e-tests/admin/tests/credential-store-vault.spec.js index 0bd93c6ad..fa148d474 100644 --- a/e2e-tests/admin/tests/credential-store-vault.spec.js +++ b/e2e-tests/admin/tests/credential-store-vault.spec.js @@ -85,10 +85,10 @@ test( const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTargetWithAddress( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + port: targetPort, + address: targetAddress, + }); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createVaultCredentialStore( vaultAddr, diff --git a/e2e-tests/admin/tests/dynamic-host-catalog-aws-ent.spec.js b/e2e-tests/admin/tests/dynamic-host-catalog-aws-ent.spec.js index 4899b5191..d189561d8 100644 --- a/e2e-tests/admin/tests/dynamic-host-catalog-aws-ent.spec.js +++ b/e2e-tests/admin/tests/dynamic-host-catalog-aws-ent.spec.js @@ -156,7 +156,10 @@ test.describe('AWS', () => { // Create a target and add DHC host set as a host source const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetEnt(targetPort); + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + }); await targetsPage.addHostSourceToTarget(hostSetName); // Add another host source diff --git a/e2e-tests/admin/tests/dynamic-host-catalog-aws.spec.js b/e2e-tests/admin/tests/dynamic-host-catalog-aws.spec.js index 830c6945d..1089b1454 100644 --- a/e2e-tests/admin/tests/dynamic-host-catalog-aws.spec.js +++ b/e2e-tests/admin/tests/dynamic-host-catalog-aws.spec.js @@ -156,7 +156,9 @@ test.describe('AWS', () => { // Create a target and add DHC host set as a host source const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTarget(targetPort); + const targetName = await targetsPage.createTarget({ + port: targetPort, + }); await targetsPage.addHostSourceToTarget(hostSetName); // Add another host source diff --git a/e2e-tests/admin/tests/session-recording-aws-ent.spec.js b/e2e-tests/admin/tests/session-recording-aws-ent.spec.js index 80db88568..e9b69bafb 100644 --- a/e2e-tests/admin/tests/session-recording-aws-ent.spec.js +++ b/e2e-tests/admin/tests/session-recording-aws-ent.spec.js @@ -93,10 +93,11 @@ test( await page.getByRole('link', { name: orgName }).click(); await page.getByRole('link', { name: projectName }).click(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + address: targetAddress, + }); await targetsPage.addEgressWorkerFilterToTarget( `"${workerTagEgress}" in "/tags/type"`, ); diff --git a/e2e-tests/admin/tests/session-recording-minio-ent.spec.js b/e2e-tests/admin/tests/session-recording-minio-ent.spec.js index ec2b03fb2..8ff5f613b 100644 --- a/e2e-tests/admin/tests/session-recording-minio-ent.spec.js +++ b/e2e-tests/admin/tests/session-recording-minio-ent.spec.js @@ -97,10 +97,11 @@ test( await page.getByRole('link', { name: orgName }).click(); await page.getByRole('link', { name: projectName }).click(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + address: targetAddress, + }); await targetsPage.addIngressWorkerFilterToTarget( `"${workerTagEgress}" in "/tags/type"`, ); diff --git a/e2e-tests/admin/tests/ssh-certificate-injection-vault-ent.spec.js b/e2e-tests/admin/tests/ssh-certificate-injection-vault-ent.spec.js index 48ce834d5..601c74b8e 100644 --- a/e2e-tests/admin/tests/ssh-certificate-injection-vault-ent.spec.js +++ b/e2e-tests/admin/tests/ssh-certificate-injection-vault-ent.spec.js @@ -99,10 +99,11 @@ test( // Create target const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + address: targetAddress, + }); // Create credentials const credentialStoresPage = new CredentialStoresPage(page); diff --git a/e2e-tests/admin/tests/ssh-credential-injection-vault-ent.spec.js b/e2e-tests/admin/tests/ssh-credential-injection-vault-ent.spec.js index 6883ab0e0..2d68e64f9 100644 --- a/e2e-tests/admin/tests/ssh-credential-injection-vault-ent.spec.js +++ b/e2e-tests/admin/tests/ssh-credential-injection-vault-ent.spec.js @@ -89,10 +89,11 @@ test( // Create target const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + address: targetAddress, + }); // Create credentials const credentialStoresPage = new CredentialStoresPage(page); diff --git a/e2e-tests/admin/tests/target-ent.spec.js b/e2e-tests/admin/tests/target-ent.spec.js index 4f6cb7d68..c9737ef88 100644 --- a/e2e-tests/admin/tests/target-ent.spec.js +++ b/e2e-tests/admin/tests/target-ent.spec.js @@ -41,10 +41,11 @@ test( const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTcpTargetWithAddressEnt( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + targetType: 'tcp', + port: targetPort, + address: targetAddress, + }); await boundaryCli.authenticateBoundary( controllerAddr, @@ -108,10 +109,11 @@ test( const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + address: targetAddress, + }); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); const credentialName = @@ -194,7 +196,10 @@ test( // Create target const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetEnt(targetPort); + const targetName = await targetsPage.createTarget({ + targetType: 'ssh', + port: targetPort, + }); await targetsPage.addHostSourceToTarget(hostSetName); // Add/Remove another host source @@ -285,10 +290,11 @@ test( ); const targetsPage = new TargetsPage(page); - const rdpTarget = await targetsPage.createRDPTargetWithAddressEnt( - targetAddress, - targetPort, - ); + const rdpTarget = await targetsPage.createTarget({ + targetType: 'rdp', + port: targetPort, + address: targetAddress, + }); await targetsPage.addBrokeredCredentialsToTarget( rdpTarget, credentialName, diff --git a/e2e-tests/admin/tests/target.spec.js b/e2e-tests/admin/tests/target.spec.js index d5a1a9094..8706748f0 100644 --- a/e2e-tests/admin/tests/target.spec.js +++ b/e2e-tests/admin/tests/target.spec.js @@ -57,7 +57,7 @@ test( // Create target const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTarget(targetPort); + const targetName = await targetsPage.createTarget({ port: targetPort }); await targetsPage.addHostSourceToTarget(hostSetName); // Add/Remove another host source @@ -127,10 +127,10 @@ test( const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTargetWithAddress( - targetAddress, - targetPort, - ); + const targetName = await targetsPage.createTarget({ + port: targetPort, + address: targetAddress, + }); await boundaryCli.authenticateBoundary( controllerAddr, @@ -191,7 +191,10 @@ test( const projectsPage = new ProjectsPage(page); await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - await targetsPage.createTargetWithAddress(targetAddress, targetPort); + await targetsPage.createTarget({ + port: targetPort, + address: targetAddress, + }); // Update target await page.getByRole('button', { name: 'Edit Form' }).click();