test(e2e): Refactor imports for boundary cli helper methods (#2632)

* test(e2e): Update imports to match boundary-http conventions

* test(e2e): Remove cli from method name
This commit is contained in:
Michael Li authored and GitHub committed 2024-12-17 10:17:32 -05:00
1 parent daed714b98
commit af8655ec45
37 files changed
+394 -454

No files matched your search

+28 -31
View File
@@ -7,16 +7,7 @@ import { test, authenticatedState } from '../../global-setup.js';
import { expect } from '@playwright/test';
import { customAlphabet } from 'nanoid';
import {
authenticateBoundaryCli,
authorizeSessionByAliasCli,
checkBoundaryCli,
deleteAliasCli,
deleteScopeCli,
getOrgIdFromNameCli,
getProjectIdFromNameCli,
getTargetIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { AliasesPage } from '../pages/aliases.js';
import { CredentialStoresPage } from '../pages/credential-stores.js';
import { OrgsPage } from '../pages/orgs.js';
@@ -26,7 +17,7 @@ import { TargetsPage } from '../pages/targets.js';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await boundaryCli.checkBoundaryCli();
});
test.describe('Aliases (Enterprise)', async () => {
@@ -86,13 +77,13 @@ test.describe('Aliases (Enterprise)', async () => {
await page.getByRole('button', { name: 'Dismiss' }).click();
// Connect to target using alias
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
await authorizeSessionByAliasCli(alias);
await boundaryCli.authorizeSessionByAlias(alias);
// Clear destination from alias
await page.getByRole('link', { name: alias }).click();
@@ -110,20 +101,20 @@ test.describe('Aliases (Enterprise)', async () => {
).toBeVisible();
await page.getByRole('button', { name: 'Dismiss' }).click();
} finally {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
if (orgName) {
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
if (alias) {
await deleteAliasCli(alias);
await boundaryCli.deleteAlias(alias);
}
}
});
@@ -146,7 +137,7 @@ test.describe('Aliases (Enterprise)', async () => {
try {
const orgsPage = new OrgsPage(page);
orgName = await orgsPage.createOrg();
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
@@ -174,9 +165,9 @@ test.describe('Aliases (Enterprise)', async () => {
);
// Connect to target using alias
await authorizeSessionByAliasCli(alias);
await boundaryCli.authorizeSessionByAlias(alias);
} finally {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
@@ -184,12 +175,12 @@ test.describe('Aliases (Enterprise)', async () => {
);
if (orgName) {
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
if (alias) {
await deleteAliasCli(alias);
await boundaryCli.deleteAlias(alias);
}
}
}
@@ -233,22 +224,28 @@ test.describe('Aliases (Enterprise)', async () => {
);
// Create new alias from scope page
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
alias = 'example.alias.' + nanoid();
const aliasesPage = new AliasesPage(page);
await aliasesPage.createAliasForTarget(alias, targetId);
await authorizeSessionByAliasCli(alias);
await boundaryCli.authorizeSessionByAlias(alias);
} finally {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
@@ -256,10 +253,10 @@ test.describe('Aliases (Enterprise)', async () => {
);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
if (alias) {
await deleteAliasCli(alias);
await boundaryCli.deleteAlias(alias);
}
}
});
+28 -31
View File
@@ -7,16 +7,7 @@ import { test, authenticatedState } from '../../global-setup.js';
import { expect } from '@playwright/test';
import { customAlphabet } from 'nanoid';
import {
authenticateBoundaryCli,
authorizeSessionByAliasCli,
checkBoundaryCli,
deleteAliasCli,
deleteScopeCli,
getOrgIdFromNameCli,
getProjectIdFromNameCli,
getTargetIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { AliasesPage } from '../pages/aliases.js';
import { OrgsPage } from '../pages/orgs.js';
import { ProjectsPage } from '../pages/projects.js';
@@ -25,7 +16,7 @@ import { TargetsPage } from '../pages/targets.js';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await boundaryCli.checkBoundaryCli();
});
test.describe('Aliases', async () => {
@@ -64,13 +55,13 @@ test.describe('Aliases', async () => {
await page.getByRole('button', { name: 'Dismiss' }).click();
// Connect to target using alias
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
await authorizeSessionByAliasCli(alias);
await boundaryCli.authorizeSessionByAlias(alias);
// Clear destination from alias
await page.getByRole('link', { name: alias }).click();
@@ -88,20 +79,20 @@ test.describe('Aliases', async () => {
).toBeVisible();
await page.getByRole('button', { name: 'Dismiss' }).click();
} finally {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
if (orgName) {
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
if (alias) {
await deleteAliasCli(alias);
await boundaryCli.deleteAlias(alias);
}
}
});
@@ -122,7 +113,7 @@ test.describe('Aliases', async () => {
try {
const orgsPage = new OrgsPage(page);
orgName = await orgsPage.createOrg();
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
@@ -139,21 +130,21 @@ test.describe('Aliases', async () => {
);
// Connect to target using alias
await authorizeSessionByAliasCli(alias);
await boundaryCli.authorizeSessionByAlias(alias);
} finally {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
if (orgName) {
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
if (alias) {
await deleteAliasCli(alias);
await boundaryCli.deleteAlias(alias);
}
}
}
@@ -184,32 +175,38 @@ test.describe('Aliases', async () => {
);
// Create new alias from scope page
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
alias = 'example.alias.' + nanoid();
const aliasesPage = new AliasesPage(page);
await aliasesPage.createAliasForTarget(alias, targetId);
await authorizeSessionByAliasCli(alias);
await boundaryCli.authorizeSessionByAlias(alias);
} finally {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
if (alias) {
await deleteAliasCli(alias);
await boundaryCli.deleteAlias(alias);
}
}
});
+5 -10
View File
@@ -7,12 +7,7 @@ import { test } from '../../global-setup.js';
import { expect } from '@playwright/test';
import { nanoid } from 'nanoid';
import {
authenticateBoundaryCli,
checkBoundaryCli,
deleteScopeCli,
getOrgIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { AuthMethodsPage } from '../pages/auth-methods.js';
import { LoginPage } from '../pages/login.js';
import { OrgsPage } from '../pages/orgs.js';
@@ -20,7 +15,7 @@ import { RolesPage } from '../pages/roles.js';
import { UsersPage } from '../pages/users.js';
test.beforeAll(async () => {
await checkBoundaryCli();
await boundaryCli.checkBoundaryCli();
});
test('Set up LDAP auth method @ce @ent @docker', async ({
@@ -250,15 +245,15 @@ test('Set up LDAP auth method @ce @ent @docker', async ({
).toContain(ldapUserName + '@mail.com');
} finally {
if (orgName) {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
}
@@ -7,19 +7,14 @@ import { test } from '../../global-setup.js';
import { expect } from '@playwright/test';
import { execSync } from 'node:child_process';
import {
authenticateBoundaryCli,
checkBoundaryCli,
deleteScopeCli,
getOrgIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { AuthMethodsPage } from '../pages/auth-methods.js';
import { LoginPage } from '../pages/login.js';
import { OrgsPage } from '../pages/orgs.js';
import { UsersPage } from '../pages/users.js';
test.beforeAll(async () => {
await checkBoundaryCli();
await boundaryCli.checkBoundaryCli();
});
test('Verify new auth-method can be created and assigned to users @ce @ent @aws @docker', async ({
@@ -104,7 +99,7 @@ test('Verify new auth-method can be created and assigned to users @ce @ent @aws
.getByText('Projects'),
).toBeVisible();
} finally {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
@@ -130,9 +125,9 @@ test('Verify new auth-method can be created and assigned to users @ce @ent @aws
}
if (orgName) {
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
}
@@ -6,12 +6,7 @@
import { test, authenticatedState } from '../../global-setup.js';
import { expect } from '@playwright/test';
import {
authenticateBoundaryCli,
checkBoundaryCli,
deleteScopeCli,
getOrgIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { CredentialStoresPage } from '../pages/credential-stores.js';
import { OrgsPage } from '../pages/orgs.js';
import { ProjectsPage } from '../pages/projects.js';
@@ -20,7 +15,7 @@ import { TargetsPage } from '../pages/targets.js';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await boundaryCli.checkBoundaryCli();
});
test('Multiple Credential Stores (ENT) @ent @aws @docker', async ({
@@ -107,15 +102,15 @@ test('Multiple Credential Stores (ENT) @ent @aws @docker', async ({
await page.getByRole('button', { name: 'Dismiss' }).click();
} finally {
if (orgName) {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
}
@@ -8,15 +8,7 @@ import { expect } from '@playwright/test';
import { readFile } from 'fs/promises';
import { nanoid } from 'nanoid';
import {
authenticateBoundaryCli,
authorizeSessionByTargetIdCli,
checkBoundaryCli,
deleteScopeCli,
getOrgIdFromNameCli,
getProjectIdFromNameCli,
getTargetIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { CredentialStoresPage } from '../pages/credential-stores.js';
import { OrgsPage } from '../pages/orgs.js';
import { ProjectsPage } from '../pages/projects.js';
@@ -25,7 +17,7 @@ import { TargetsPage } from '../pages/targets.js';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await boundaryCli.checkBoundaryCli();
});
let orgName;
@@ -70,16 +62,22 @@ test('Static Credential Store (User & Key Pair) @ce @aws @docker', async ({
credentialName,
);
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
const session = await authorizeSessionByTargetIdCli(targetId);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
const session = await boundaryCli.authorizeSessionByTargetId(targetId);
const retrievedUser = session.item.credentials[0].credential.username;
const retrievedKey = session.item.credentials[0].credential.private_key;
@@ -93,15 +91,15 @@ test('Static Credential Store (User & Key Pair) @ce @aws @docker', async ({
}
} finally {
if (orgName) {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
}
@@ -129,16 +127,22 @@ test('Static Credential Store (Username & Password) @ce @aws @docker', async ({
credentialName,
);
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
const session = await authorizeSessionByTargetIdCli(targetId);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
const session = await boundaryCli.authorizeSessionByTargetId(targetId);
const retrievedUser = session.item.credentials[0].credential.username;
const retrievedPassword = session.item.credentials[0].credential.password;
@@ -146,15 +150,15 @@ test('Static Credential Store (Username & Password) @ce @aws @docker', async ({
expect(retrievedPassword).toBe(testPassword);
} finally {
if (orgName) {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
}
@@ -200,16 +204,22 @@ test('Static Credential Store (JSON) @ce @aws @docker', async ({
credentialName,
);
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
const session = await authorizeSessionByTargetIdCli(targetId);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
const session = await boundaryCli.authorizeSessionByTargetId(targetId);
const retrievedUser = session.item.credentials[0].credential.username;
const retrievedPassword = session.item.credentials[0].credential.password;
const retrievedId = session.item.credentials[0].credential.id;
@@ -219,15 +229,15 @@ test('Static Credential Store (JSON) @ce @aws @docker', async ({
expect(retrievedId).toBe(testId);
} finally {
if (orgName) {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
}
@@ -280,15 +290,15 @@ test('Multiple Credential Stores (CE) @ce @aws @docker', async ({
await page.getByRole('button', { name: 'Dismiss' }).click();
} finally {
if (orgName) {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
}
@@ -6,16 +6,8 @@
import { test, authenticatedState } from '../../global-setup.js';
import { execSync } from 'child_process';
import {
authenticateBoundaryCli,
authorizeSessionByTargetIdCli,
checkBoundaryCli,
deleteScopeCli,
getOrgIdFromNameCli,
getProjectIdFromNameCli,
getTargetIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import { checkVaultCli } from '../../helpers/vault-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import * as vaultCli from '../../helpers/vault-cli';
import { CredentialStoresPage } from '../pages/credential-stores.js';
import { OrgsPage } from '../pages/orgs.js';
import { ProjectsPage } from '../pages/projects.js';
@@ -29,8 +21,8 @@ const boundaryPolicyName = 'boundary-controller';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await checkVaultCli();
await boundaryCli.checkBoundaryCli();
await vaultCli.checkVaultCli();
});
test.beforeEach(async ({ page }) => {
@@ -105,19 +97,25 @@ test('Vault Credential Store (User & Key Pair) @ent @aws @docker', async ({
credentialLibraryName,
);
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
await authorizeSessionByTargetIdCli(targetId);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
await boundaryCli.authorizeSessionByTargetId(targetId);
} finally {
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
});
@@ -9,16 +9,8 @@ import { execSync } from 'child_process';
import { nanoid } from 'nanoid';
import { readFile } from 'fs/promises';
import {
authenticateBoundaryCli,
authorizeSessionByTargetIdCli,
checkBoundaryCli,
deleteScopeCli,
getOrgIdFromNameCli,
getProjectIdFromNameCli,
getTargetIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import { checkVaultCli } from '../../helpers/vault-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import * as vaultCli from '../../helpers/vault-cli';
import { CredentialStoresPage } from '../pages/credential-stores.js';
import { OrgsPage } from '../pages/orgs.js';
import { ProjectsPage } from '../pages/projects.js';
@@ -32,8 +24,8 @@ const boundaryPolicyName = 'boundary-controller';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await checkVaultCli();
await boundaryCli.checkBoundaryCli();
await vaultCli.checkVaultCli();
});
test.beforeEach(async ({ page }) => {
@@ -122,16 +114,22 @@ test('Vault Credential Store (User & Key Pair) @ce @aws @docker', async ({
credentialLibraryName,
);
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
const session = await authorizeSessionByTargetIdCli(targetId);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
const session = await boundaryCli.authorizeSessionByTargetId(targetId);
const retrievedUser =
session.item.credentials[0].secret.decoded.data.username;
const retrievedKey =
@@ -147,7 +145,7 @@ test('Vault Credential Store (User & Key Pair) @ce @aws @docker', async ({
}
} finally {
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
});
@@ -6,30 +6,8 @@
import { test, authenticatedState } from '../../global-setup.js';
import { execSync } from 'node:child_process';
import {
authenticateBoundaryCli,
checkBoundaryCli,
createOrgCli,
createProjectCli,
createControllerLedWorkerCli,
createPasswordAuthMethodCli,
makeAuthMethodPrimaryCli,
createPasswordAccountCli,
createRoleCli,
createGroupCli,
createUserCli,
createStaticHostCatalogCli,
createDynamicAwsHostCatalogCli,
createStaticHostCli,
createHostSetCli,
createStaticCredentialStoreCli,
createTcpTarget,
createSshTargetCli,
createVaultCredentialStoreCli,
createUsernamePasswordCredentialCli,
deleteScopeCli,
} from '../../helpers/boundary-cli.js';
import { checkVaultCli, getVaultToken } from '../../helpers/vault-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import * as vaultCli from '../../helpers/vault-cli';
import { AuthMethodsPage } from '../pages/auth-methods.js';
import { BaseResourcePage } from '../pages/base-resource.js';
import { WorkersPage } from '../pages/workers.js';
@@ -45,15 +23,15 @@ test.use({ storageState: authenticatedState });
test.setTimeout(180000);
test.beforeAll(async () => {
await checkBoundaryCli();
await checkVaultCli();
await boundaryCli.checkBoundaryCli();
await vaultCli.checkVaultCli();
});
test.beforeEach(
async ({ baseURL, adminAuthMethodId, adminLoginName, adminPassword }) => {
execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
@@ -70,43 +48,47 @@ test('Verify resources can be deleted (enterprise) @ent @aws', async ({
let orgId;
let orgDeleted = false;
try {
orgId = await createOrgCli();
let projectId = await createProjectCli(orgId);
orgId = await boundaryCli.createOrg();
let projectId = await boundaryCli.createProject(orgId);
// Create boundary resources using CLI
let workerId = await createControllerLedWorkerCli();
let authMethodId = await createPasswordAuthMethodCli(orgId);
await makeAuthMethodPrimaryCli(orgId, authMethodId);
let passwordAccountId = await createPasswordAccountCli(authMethodId);
let projectScopeRoleId = await createRoleCli(projectId);
let orgScopeRoleId = await createRoleCli(orgId);
let globalScopeRoleId = await createRoleCli('global');
let groupId = await createGroupCli(orgId);
let userId = await createUserCli(orgId);
let staticHostCatalogId = await createStaticHostCatalogCli(projectId);
let dynamicAwsHostCatalogId = await createDynamicAwsHostCatalogCli(
let workerId = await boundaryCli.createControllerLedWorker();
let authMethodId = await boundaryCli.createPasswordAuthMethod(orgId);
await boundaryCli.makeAuthMethodPrimary(orgId, authMethodId);
let passwordAccountId =
await boundaryCli.createPasswordAccount(authMethodId);
let projectScopeRoleId = await boundaryCli.createRole(projectId);
let orgScopeRoleId = await boundaryCli.createRole(orgId);
let globalScopeRoleId = await boundaryCli.createRole('global');
let groupId = await boundaryCli.createGroup(orgId);
let userId = await boundaryCli.createUser(orgId);
let staticHostCatalogId =
await boundaryCli.createStaticHostCatalog(projectId);
let dynamicAwsHostCatalogId = await boundaryCli.createDynamicAwsHostCatalog(
projectId,
awsRegion,
);
let staticHostId = await createStaticHostCli(staticHostCatalogId);
let staticHostSetId = await createHostSetCli(staticHostCatalogId);
let staticHostId = await boundaryCli.createStaticHost(staticHostCatalogId);
let staticHostSetId = await boundaryCli.createHostSet(staticHostCatalogId);
let staticCredentialStoreId =
await createStaticCredentialStoreCli(projectId);
const vaultToken = await getVaultToken(
await boundaryCli.createStaticCredentialStore(projectId);
const vaultToken = await vaultCli.getVaultToken(
boundaryPolicyName,
secretPolicyName,
);
let vaultCredentialStoreId = await createVaultCredentialStoreCli(
let vaultCredentialStoreId = await boundaryCli.createVaultCredentialStore(
projectId,
vaultAddr,
vaultToken,
);
let usernamePasswordCredentialId =
await createUsernamePasswordCredentialCli(staticCredentialStoreId);
let tcpTargetId = await createTcpTarget(projectId);
await boundaryCli.createUsernamePasswordCredential(
staticCredentialStoreId,
);
let tcpTargetId = await boundaryCli.createTcpTarget(projectId);
// Create enterprise boundary resources using CLI
let sshTargetId = await createSshTargetCli(projectId);
let sshTargetId = await boundaryCli.createSshTarget(projectId);
// Delete resources
const baseResourcePage = new BaseResourcePage(page);
@@ -175,7 +157,7 @@ test('Verify resources can be deleted (enterprise) @ent @aws', async ({
orgDeleted = true;
} finally {
if (orgId && orgDeleted == false) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
});
+30 -47
View File
@@ -6,29 +6,8 @@
import { test, authenticatedState } from '../../global-setup.js';
import { execSync } from 'node:child_process';
import {
authenticateBoundaryCli,
checkBoundaryCli,
createOrgCli,
createProjectCli,
createControllerLedWorkerCli,
createPasswordAuthMethodCli,
makeAuthMethodPrimaryCli,
createPasswordAccountCli,
createRoleCli,
createGroupCli,
createUserCli,
createStaticHostCatalogCli,
createDynamicAwsHostCatalogCli,
createStaticHostCli,
createHostSetCli,
createStaticCredentialStoreCli,
createTcpTarget,
createVaultCredentialStoreCli,
createUsernamePasswordCredentialCli,
deleteScopeCli,
} from '../../helpers/boundary-cli.js';
import { checkVaultCli, getVaultToken } from '../../helpers/vault-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import * as vaultCli from '../../helpers/vault-cli';
import { AuthMethodsPage } from '../pages/auth-methods.js';
import { BaseResourcePage } from '../pages/base-resource.js';
import { WorkersPage } from '../pages/workers.js';
@@ -44,15 +23,15 @@ test.use({ storageState: authenticatedState });
test.setTimeout(180000);
test.beforeAll(async () => {
await checkBoundaryCli();
await checkVaultCli();
await boundaryCli.checkBoundaryCli();
await vaultCli.checkVaultCli();
});
test.beforeEach(
async ({ baseURL, adminAuthMethodId, adminLoginName, adminPassword }) => {
execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
@@ -70,38 +49,42 @@ test('Verify resources can be deleted @ce @aws', async ({
let orgDeleted = false;
try {
// Create boundary resources using CLI
orgId = await createOrgCli();
let projectId = await createProjectCli(orgId);
let workerId = await createControllerLedWorkerCli();
let authMethodId = await createPasswordAuthMethodCli(orgId);
await makeAuthMethodPrimaryCli(orgId, authMethodId);
let passwordAccountId = await createPasswordAccountCli(authMethodId);
let projectScopeRoleId = await createRoleCli(projectId);
let orgScopeRoleId = await createRoleCli(orgId);
let globalScopeRoleId = await createRoleCli('global');
let groupId = await createGroupCli(orgId);
let userId = await createUserCli(orgId);
let staticHostCatalogId = await createStaticHostCatalogCli(projectId);
let dynamicAwsHostCatalogId = await createDynamicAwsHostCatalogCli(
orgId = await boundaryCli.createOrg();
let projectId = await boundaryCli.createProject(orgId);
let workerId = await boundaryCli.createControllerLedWorker();
let authMethodId = await boundaryCli.createPasswordAuthMethod(orgId);
await boundaryCli.makeAuthMethodPrimary(orgId, authMethodId);
let passwordAccountId =
await boundaryCli.createPasswordAccount(authMethodId);
let projectScopeRoleId = await boundaryCli.createRole(projectId);
let orgScopeRoleId = await boundaryCli.createRole(orgId);
let globalScopeRoleId = await boundaryCli.createRole('global');
let groupId = await boundaryCli.createGroup(orgId);
let userId = await boundaryCli.createUser(orgId);
let staticHostCatalogId =
await boundaryCli.createStaticHostCatalog(projectId);
let dynamicAwsHostCatalogId = await boundaryCli.createDynamicAwsHostCatalog(
projectId,
awsRegion,
);
let staticHostId = await createStaticHostCli(staticHostCatalogId);
let staticHostSetId = await createHostSetCli(staticHostCatalogId);
let staticHostId = await boundaryCli.createStaticHost(staticHostCatalogId);
let staticHostSetId = await boundaryCli.createHostSet(staticHostCatalogId);
let staticCredentialStoreId =
await createStaticCredentialStoreCli(projectId);
const vaultToken = await getVaultToken(
await boundaryCli.createStaticCredentialStore(projectId);
const vaultToken = await vaultCli.getVaultToken(
boundaryPolicyName,
secretPolicyName,
);
let vaultCredentialStoreId = await createVaultCredentialStoreCli(
let vaultCredentialStoreId = await boundaryCli.createVaultCredentialStore(
projectId,
vaultAddr,
vaultToken,
);
let usernamePasswordCredentialId =
await createUsernamePasswordCredentialCli(staticCredentialStoreId);
let tcpTargetId = await createTcpTarget(projectId);
await boundaryCli.createUsernamePasswordCredential(
staticCredentialStoreId,
);
let tcpTargetId = await boundaryCli.createTcpTarget(projectId);
const baseResourcePage = new BaseResourcePage(page);
@@ -199,7 +182,7 @@ test('Verify resources can be deleted @ce @aws', async ({
} finally {
// Delete org in case the test failed before deleting the org using UI
if (orgId && orgDeleted === false) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
});
@@ -7,11 +7,7 @@ import { test, authenticatedState } from '../../global-setup.js';
import { expect } from '@playwright/test';
import { nanoid } from 'nanoid';
import {
authenticateBoundaryCli,
deleteScopeCli,
getOrgIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { HostCatalogsPage } from '../pages/host-catalogs.js';
import { OrgsPage } from '../pages/orgs.js';
import { ProjectsPage } from '../pages/projects.js';
@@ -190,7 +186,7 @@ test.describe('AWS', async () => {
// Add the host source back
await targetsPage.addHostSourceToTarget(newHostSetName);
} finally {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
@@ -198,9 +194,9 @@ test.describe('AWS', async () => {
);
if (orgName) {
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
}
@@ -6,11 +6,7 @@
import { test, authenticatedState } from '../../global-setup.js';
import { expect } from '@playwright/test';
import {
authenticateBoundaryCli,
deletePolicyCli,
getPolicyIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { OrgsPage } from '../pages/orgs.js';
import { StoragePoliciesPage } from '../pages/storage-policies.js';
@@ -51,17 +47,17 @@ test('Global Settings @ent @aws @docker', async ({
await expect(page.getByRole('heading', { name: 'Orgs' })).toBeVisible();
} finally {
if (policyName) {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const storagePolicyId = await getPolicyIdFromNameCli(
const storagePolicyId = await boundaryCli.getPolicyIdFromName(
'global',
policyName,
);
await deletePolicyCli(storagePolicyId);
await boundaryCli.deletePolicy(storagePolicyId);
}
}
});
+5 -10
View File
@@ -5,12 +5,7 @@
import { test, authenticatedState } from '../../global-setup.js';
import {
authenticateBoundaryCli,
checkBoundaryCli,
deleteScopeCli,
getOrgIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { GroupsPage } from '../pages/groups.js';
import { OrgsPage } from '../pages/orgs.js';
import { RolesPage } from '../pages/roles.js';
@@ -18,7 +13,7 @@ import { RolesPage } from '../pages/roles.js';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await boundaryCli.checkBoundaryCli();
});
test('Verify a new role can be created and associated with a group @ce @ent @aws @docker', async ({
@@ -41,15 +36,15 @@ test('Verify a new role can be created and associated with a group @ce @ent @aws
await rolesPage.addPrincipalToRole(groupName);
await rolesPage.addGrantsToRole('ids=*;type=*;actions=read,list');
} finally {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
});
@@ -7,19 +7,7 @@ import { test, authenticatedState } from '../../global-setup.js';
import { expect } from '@playwright/test';
import { execSync } from 'child_process';
import {
authenticateBoundaryCli,
checkBoundaryCli,
connectSshToTarget,
deleteScopeCli,
waitForSessionRecordingCli,
deleteStorageBucketCli,
deletePolicyCli,
getOrgIdFromNameCli,
getPolicyIdFromNameCli,
getProjectIdFromNameCli,
getTargetIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { CredentialStoresPage } from '../pages/credential-stores.js';
import { OrgsPage } from '../pages/orgs.js';
import { ProjectsPage } from '../pages/projects.js';
@@ -32,7 +20,7 @@ import { TargetsPage } from '../pages/targets.js';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await boundaryCli.checkBoundaryCli();
});
test('Session Recording Test (AWS) @ent @aws', async ({
@@ -57,7 +45,7 @@ test('Session Recording Test (AWS) @ent @aws', async ({
let storageBucket;
let connect;
try {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
@@ -129,10 +117,16 @@ test('Session Recording Test (AWS) @ent @aws', async ({
await orgsPage.attachStoragePolicy(policyName);
// Establish connection to target and cancel it
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
connect = await connectSshToTarget(targetId);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
connect = await boundaryCli.connectSshToTarget(targetId);
await page.getByRole('link', { name: 'Projects', exact: true }).click();
await page.getByRole('link', { name: projectName }).click();
const sessionsPage = new SessionsPage(page);
@@ -146,7 +140,7 @@ test('Session Recording Test (AWS) @ent @aws', async ({
page.getByRole('alert').getByText('Success', { exact: true }),
).toBeVisible();
await page.getByRole('button', { name: 'Dismiss', exact: true }).click();
await waitForSessionRecordingCli(storageBucket.id);
await boundaryCli.waitForSessionRecording(storageBucket.id);
// Play back session recording
await page.getByRole('link', { name: 'Orgs', exact: true }).click();
@@ -234,14 +228,17 @@ test('Session Recording Test (AWS) @ent @aws', async ({
await targetsPage.detachStorageBucket();
} finally {
if (policyName) {
const storagePolicyId = await getPolicyIdFromNameCli(orgId, policyName);
await deletePolicyCli(storagePolicyId);
const storagePolicyId = await boundaryCli.getPolicyIdFromName(
orgId,
policyName,
);
await boundaryCli.deletePolicy(storagePolicyId);
}
if (storageBucket) {
await deleteStorageBucketCli(storageBucket.id);
await boundaryCli.deleteStorageBucket(storageBucket.id);
}
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
// End `boundary connect` process
if (connect) {
@@ -7,19 +7,7 @@ import { test, authenticatedState } from '../../global-setup.js';
import { expect } from '@playwright/test';
import { execSync } from 'child_process';
import {
authenticateBoundaryCli,
checkBoundaryCli,
connectSshToTarget,
deleteScopeCli,
waitForSessionRecordingCli,
deleteStorageBucketCli,
deletePolicyCli,
getOrgIdFromNameCli,
getPolicyIdFromNameCli,
getProjectIdFromNameCli,
getTargetIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { CredentialStoresPage } from '../pages/credential-stores.js';
import { OrgsPage } from '../pages/orgs.js';
import { ProjectsPage } from '../pages/projects.js';
@@ -32,7 +20,7 @@ import { TargetsPage } from '../pages/targets.js';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await boundaryCli.checkBoundaryCli();
});
test('Session Recording Test (MinIO) @ent @docker', async ({
@@ -59,7 +47,7 @@ test('Session Recording Test (MinIO) @ent @docker', async ({
let storageBucket;
let connect;
try {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
@@ -136,10 +124,16 @@ test('Session Recording Test (MinIO) @ent @docker', async ({
await orgsPage.attachStoragePolicy(policyName);
// Establish connection to target and cancel it
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
connect = await connectSshToTarget(targetId);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
connect = await boundaryCli.connectSshToTarget(targetId);
await page.getByRole('link', { name: 'Projects', exact: true }).click();
await page.getByRole('link', { name: projectName }).click();
const sessionsPage = new SessionsPage(page);
@@ -153,7 +147,7 @@ test('Session Recording Test (MinIO) @ent @docker', async ({
page.getByRole('alert').getByText('Success', { exact: true }),
).toBeVisible();
await page.getByRole('button', { name: 'Dismiss', exact: true }).click();
await waitForSessionRecordingCli(storageBucket.id);
await boundaryCli.waitForSessionRecording(storageBucket.id);
// Play back session recording
await page.getByRole('link', { name: 'Orgs', exact: true }).click();
@@ -241,14 +235,17 @@ test('Session Recording Test (MinIO) @ent @docker', async ({
await targetsPage.detachStorageBucket();
} finally {
if (policyName) {
const storagePolicyId = await getPolicyIdFromNameCli(orgId, policyName);
await deletePolicyCli(storagePolicyId);
const storagePolicyId = await boundaryCli.getPolicyIdFromName(
orgId,
policyName,
);
await boundaryCli.deletePolicy(storagePolicyId);
}
if (storageBucket) {
await deleteStorageBucketCli(storageBucket.id);
await boundaryCli.deleteStorageBucket(storageBucket.id);
}
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
// End `boundary connect` process
if (connect) {
@@ -6,16 +6,8 @@
import { test, authenticatedState } from '../../global-setup.js';
import { execSync } from 'child_process';
import {
authenticateBoundaryCli,
checkBoundaryCli,
connectSshToTarget,
deleteScopeCli,
getOrgIdFromNameCli,
getProjectIdFromNameCli,
getTargetIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import { checkVaultCli } from '../../helpers/vault-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import * as vaultCli from '../../helpers/vault-cli';
import { CredentialStoresPage } from '../pages/credential-stores.js';
import { OrgsPage } from '../pages/orgs.js';
import { ProjectsPage } from '../pages/projects.js';
@@ -32,8 +24,8 @@ const secretName = 'boundary-client';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await checkVaultCli();
await boundaryCli.checkBoundaryCli();
await vaultCli.checkVaultCli();
});
test.beforeEach(async () => {
@@ -126,16 +118,22 @@ test('SSH Certificate Injection @ent @docker', async ({
);
// Connect to target
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
connect = await connectSshToTarget(targetId);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
connect = await boundaryCli.connectSshToTarget(targetId);
const sessionsPage = new SessionsPage(page);
await sessionsPage.waitForSessionToBeVisible(targetName);
await page
@@ -145,7 +143,7 @@ test('SSH Certificate Injection @ent @docker', async ({
.click();
} finally {
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
// End `boundary connect` process
if (connect) {
@@ -6,16 +6,8 @@
import { test, authenticatedState } from '../../global-setup.js';
import { execSync } from 'child_process';
import {
authenticateBoundaryCli,
checkBoundaryCli,
connectSshToTarget,
deleteScopeCli,
getOrgIdFromNameCli,
getProjectIdFromNameCli,
getTargetIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import { checkVaultCli } from '../../helpers/vault-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import * as vaultCli from '../../helpers/vault-cli';
import { CredentialStoresPage } from '../pages/credential-stores.js';
import { OrgsPage } from '../pages/orgs.js';
import { ProjectsPage } from '../pages/projects.js';
@@ -30,8 +22,8 @@ const boundaryPolicyName = 'boundary-controller';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await checkVaultCli();
await boundaryCli.checkBoundaryCli();
await vaultCli.checkVaultCli();
});
test.beforeEach(async ({ page }) => {
@@ -116,16 +108,22 @@ test('SSH Credential Injection (Vault User & Key Pair) @ent @docker', async ({
);
// Connect to target
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
connect = await connectSshToTarget(targetId);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
connect = await boundaryCli.connectSshToTarget(targetId);
const sessionsPage = new SessionsPage(page);
await sessionsPage.waitForSessionToBeVisible(targetName);
await page
@@ -135,7 +133,7 @@ test('SSH Credential Injection (Vault User & Key Pair) @ent @docker', async ({
.click();
} finally {
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
// End `boundary connect` process
if (connect) {
+38 -29
View File
@@ -6,16 +6,7 @@
import { test, authenticatedState } from '../../global-setup.js';
import { expect } from '@playwright/test';
import {
authenticateBoundaryCli,
checkBoundaryCli,
connectToTarget,
connectSshToTarget,
deleteScopeCli,
getOrgIdFromNameCli,
getProjectIdFromNameCli,
getTargetIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { CredentialStoresPage } from '../pages/credential-stores.js';
import { HostCatalogsPage } from '../pages/host-catalogs.js';
import { OrgsPage } from '../pages/orgs.js';
@@ -26,7 +17,7 @@ import { TargetsPage } from '../pages/targets.js';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await boundaryCli.checkBoundaryCli();
});
test('Verify session created for TCP target @ent @aws @docker', async ({
@@ -54,16 +45,22 @@ test('Verify session created for TCP target @ent @aws @docker', async ({
targetPort,
);
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
connect = await connectToTarget(targetId, sshUser, sshKeyPath);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
connect = await boundaryCli.connectToTarget(targetId, sshUser, sshKeyPath);
const sessionsPage = new SessionsPage(page);
await sessionsPage.waitForSessionToBeVisible(targetName);
await page
@@ -73,7 +70,7 @@ test('Verify session created for TCP target @ent @aws @docker', async ({
.click();
} finally {
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
// End `boundary connect` process
if (connect) {
@@ -118,16 +115,22 @@ test('Verify session created for SSH target @ent @aws @docker', async ({
credentialName,
);
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
connect = await connectSshToTarget(targetId);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
connect = await boundaryCli.connectSshToTarget(targetId);
const sessionsPage = new SessionsPage(page);
await sessionsPage.waitForSessionToBeVisible(targetName);
await page
@@ -137,7 +140,7 @@ test('Verify session created for SSH target @ent @aws @docker', async ({
.click();
} finally {
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
// End `boundary connect` process
if (connect) {
@@ -214,16 +217,22 @@ test('SSH target with host sources @ent @aws @docker', async ({
);
// Connect to target
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
connect = await connectSshToTarget(targetId);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
connect = await boundaryCli.connectSshToTarget(targetId);
const sessionsPage = new SessionsPage(page);
await sessionsPage.waitForSessionToBeVisible(targetName);
await page
@@ -233,7 +242,7 @@ test('SSH target with host sources @ent @aws @docker', async ({
.click();
} finally {
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
// End `boundary connect` process
if (connect) {
+29 -25
View File
@@ -6,15 +6,7 @@
import { test, authenticatedState } from '../../global-setup.js';
import { expect } from '@playwright/test';
import {
authenticateBoundaryCli,
checkBoundaryCli,
connectToTarget,
deleteScopeCli,
getOrgIdFromNameCli,
getProjectIdFromNameCli,
getTargetIdFromNameCli,
} from '../../helpers/boundary-cli.js';
import * as boundaryCli from '../../helpers/boundary-cli';
import { BasePage } from '../pages/base.js';
import { HostCatalogsPage } from '../pages/host-catalogs.js';
import { OrgsPage } from '../pages/orgs.js';
@@ -25,7 +17,7 @@ import { TargetsPage } from '../pages/targets.js';
test.use({ storageState: authenticatedState });
test.beforeAll(async () => {
await checkBoundaryCli();
await boundaryCli.checkBoundaryCli();
});
test('Verify session created to target with host, then cancel the session @ce @aws @docker', async ({
@@ -72,16 +64,22 @@ test('Verify session created to target with host, then cancel the session @ce @a
await targetsPage.removeHostSourceFromTarget(hostSetName2);
// Connect to target
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
connect = await connectToTarget(targetId, sshUser, sshKeyPath);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
connect = await boundaryCli.connectToTarget(targetId, sshUser, sshKeyPath);
const sessionsPage = new SessionsPage(page);
await sessionsPage.waitForSessionToBeVisible(targetName);
await page
@@ -91,7 +89,7 @@ test('Verify session created to target with host, then cancel the session @ce @a
.click();
} finally {
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
// End `boundary connect` process
if (connect) {
@@ -125,16 +123,22 @@ test('Verify session created to target with address, then cancel the session @ce
targetPort,
);
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
orgId = await getOrgIdFromNameCli(orgName);
const projectId = await getProjectIdFromNameCli(orgId, projectName);
const targetId = await getTargetIdFromNameCli(projectId, targetName);
connect = await connectToTarget(targetId, sshUser, sshKeyPath);
orgId = await boundaryCli.getOrgIdFromName(orgName);
const projectId = await boundaryCli.getProjectIdFromName(
orgId,
projectName,
);
const targetId = await boundaryCli.getTargetIdFromName(
projectId,
targetName,
);
connect = await boundaryCli.connectToTarget(targetId, sshUser, sshKeyPath);
const sessionsPage = new SessionsPage(page);
await sessionsPage.waitForSessionToBeVisible(targetName);
await page
@@ -144,7 +148,7 @@ test('Verify session created to target with address, then cancel the session @ce
.click();
} finally {
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
// End `boundary connect` process
if (connect) {
@@ -217,15 +221,15 @@ test('Verify TCP target is updated @ce @aws @docker', async ({
const basePage = new BasePage(page);
await basePage.dismissSuccessAlert();
} finally {
await authenticateBoundaryCli(
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
adminLoginName,
adminPassword,
);
const orgId = await getOrgIdFromNameCli(orgName);
const orgId = await boundaryCli.getOrgIdFromName(orgName);
if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
}
});