refact(e2e): Update create helper methods (#2191)
This commit is contained in:
1 parent
de20df445c
commit
6d88206491
15 files changed
+180
-172
No files matched your search
@@ -100,7 +100,7 @@ exports.connectSshToTarget = async (targetId) => {
|
||||
* Uses the boundary CLI to create a new org.
|
||||
* @returns {Promise<string>} new org's id
|
||||
*/
|
||||
exports.createNewOrgCli = async () => {
|
||||
exports.createOrgCli = async () => {
|
||||
const orgName = 'Org ' + nanoid();
|
||||
let newOrg;
|
||||
try {
|
||||
@@ -159,7 +159,7 @@ exports.deletePolicyCli = async (policyId) => {
|
||||
* @param {string} orgId ID of the organization under which the project will be created.
|
||||
* @returns {Promise<string>} new project's ID
|
||||
*/
|
||||
exports.createNewProjectCli = async (orgId) => {
|
||||
exports.createProjectCli = async (orgId) => {
|
||||
const projectName = 'Project ' + nanoid();
|
||||
let newProject;
|
||||
try {
|
||||
@@ -181,7 +181,7 @@ exports.createNewProjectCli = async (orgId) => {
|
||||
* Uses the boundary CLI to create a new controller-led worker.
|
||||
* @returns {Promise<string>} new worker's ID
|
||||
*/
|
||||
exports.createNewControllerLedWorkerCli = async () => {
|
||||
exports.createControllerLedWorkerCli = async () => {
|
||||
const workerName = 'worker-' + nanoid();
|
||||
let newWorker;
|
||||
try {
|
||||
@@ -203,7 +203,7 @@ exports.createNewControllerLedWorkerCli = async () => {
|
||||
* @param {string} scopeId ID of the scope under which the auth-method will be created.
|
||||
* @returns {Promise<string>} new auth-method's ID
|
||||
*/
|
||||
exports.createNewPasswordAuthMethodCli = async (scopeId) => {
|
||||
exports.createPasswordAuthMethodCli = async (scopeId) => {
|
||||
const authMethodName = 'auth-method-' + nanoid();
|
||||
let newAuthMethod;
|
||||
try {
|
||||
@@ -244,7 +244,7 @@ exports.makeAuthMethodPrimaryCli = async (scopeId, authMethodId) => {
|
||||
* @param {string} authMethodId ID of the auth-method that the new account will be created for.
|
||||
* @returns {Promise<string>} new account's ID
|
||||
*/
|
||||
exports.createNewPasswordAccountCli = async (authMethodId) => {
|
||||
exports.createPasswordAccountCli = async (authMethodId) => {
|
||||
let passwordAccount;
|
||||
const login = 'test-login';
|
||||
try {
|
||||
@@ -269,7 +269,7 @@ exports.createNewPasswordAccountCli = async (authMethodId) => {
|
||||
* @param {string} scopeId ID of the scope under which the role will be created.
|
||||
* @returns {Promise<string>} new role's ID
|
||||
*/
|
||||
exports.createNewRoleCli = async (scopeId) => {
|
||||
exports.createRoleCli = async (scopeId) => {
|
||||
const roleName = 'role-' + nanoid();
|
||||
let role;
|
||||
try {
|
||||
@@ -292,7 +292,7 @@ exports.createNewRoleCli = async (scopeId) => {
|
||||
* @param {string} scopeId ID of the scope under which the group will be created.
|
||||
* @returns {Promise<string>} new group's ID
|
||||
*/
|
||||
exports.createNewGroupCli = async (scopeId) => {
|
||||
exports.createGroupCli = async (scopeId) => {
|
||||
const groupName = 'group-' + nanoid();
|
||||
let group;
|
||||
try {
|
||||
@@ -315,7 +315,7 @@ exports.createNewGroupCli = async (scopeId) => {
|
||||
* @param {string} scopeId ID of the scope under which the user will be created.
|
||||
* @returns {Promise<string>} new user's ID
|
||||
*/
|
||||
exports.createNewUserCli = async (scopeId) => {
|
||||
exports.createUserCli = async (scopeId) => {
|
||||
const userName = 'user-' + nanoid();
|
||||
let user;
|
||||
try {
|
||||
@@ -338,7 +338,7 @@ exports.createNewUserCli = async (scopeId) => {
|
||||
* @param {string} projectId ID of the project under which the host catalog will be created.
|
||||
* @returns {Promise<string>} new host catalog's ID
|
||||
*/
|
||||
exports.createNewStaticHostCatalogCli = async (projectId) => {
|
||||
exports.createStaticHostCatalogCli = async (projectId) => {
|
||||
const hostCatalogName = 'static-host-catalog-' + nanoid();
|
||||
let hostCatalog;
|
||||
try {
|
||||
@@ -389,7 +389,7 @@ exports.createDynamicAwsHostCatalogCli = async (projectId) => {
|
||||
* @param {string} hostCatalogId ID of the host catalog that the host will be created for.
|
||||
* @returns {Promise<string>} new host's ID
|
||||
*/
|
||||
exports.createNewStaticHostCli = async (hostCatalogId) => {
|
||||
exports.createStaticHostCli = async (hostCatalogId) => {
|
||||
const hostName = 'static-host-' + nanoid();
|
||||
let host;
|
||||
try {
|
||||
@@ -413,7 +413,7 @@ exports.createNewStaticHostCli = async (hostCatalogId) => {
|
||||
* @param {string} hostCatalogId ID of the host catalog that the host set will be created for.
|
||||
* @returns {Promise<string>} new host set's ID
|
||||
*/
|
||||
exports.createNewHostSetCli = async (hostCatalogId) => {
|
||||
exports.createHostSetCli = async (hostCatalogId) => {
|
||||
const hostSetName = 'static-host-' + nanoid();
|
||||
let hostSet;
|
||||
try {
|
||||
@@ -436,7 +436,7 @@ exports.createNewHostSetCli = async (hostCatalogId) => {
|
||||
* @param {string} projectId ID of the project under which the credential store will be created.
|
||||
* @returns {Promise<string>} new credential store's ID
|
||||
*/
|
||||
exports.createNewStaticCredentialStoreCli = async (projectId) => {
|
||||
exports.createStaticCredentialStoreCli = async (projectId) => {
|
||||
const credentialStoreName = 'static-credential-store-' + nanoid();
|
||||
let staticCredentialStore;
|
||||
try {
|
||||
@@ -462,7 +462,7 @@ exports.createNewStaticCredentialStoreCli = async (projectId) => {
|
||||
* @param {string} boundaryPolicyName Name of the boundary policy that's used to create vault token.
|
||||
* @returns {Promise<string>} new credential store's ID
|
||||
*/
|
||||
exports.createNewVaultCredentialStoreCli = async (
|
||||
exports.createVaultCredentialStoreCli = async (
|
||||
projectId,
|
||||
vaultAddr,
|
||||
secretPolicyName,
|
||||
@@ -511,7 +511,7 @@ exports.createNewVaultCredentialStoreCli = async (
|
||||
* @param {string} credentialStoreId ID of the credential store that the credential will be created for.
|
||||
* @returns {Promise<string>} new credential's ID
|
||||
*/
|
||||
exports.createNewUsernamePasswordCredentialCli = async (credentialStoreId) => {
|
||||
exports.createUsernamePasswordCredentialCli = async (credentialStoreId) => {
|
||||
let usernamePasswordCredential;
|
||||
const login = 'test-login';
|
||||
try {
|
||||
@@ -539,7 +539,7 @@ exports.createNewUsernamePasswordCredentialCli = async (credentialStoreId) => {
|
||||
* @param {string} projectId ID of the project under which the target will be created.
|
||||
* @returns {Promise<string>} new target's ID
|
||||
*/
|
||||
exports.createNewTcpTarget = async (projectId) => {
|
||||
exports.createTcpTarget = async (projectId) => {
|
||||
const targetName = 'target-' + nanoid();
|
||||
const defaultPort = 22;
|
||||
let target;
|
||||
@@ -564,7 +564,7 @@ exports.createNewTcpTarget = async (projectId) => {
|
||||
* @param {string} projectId ID of the project under which the target will be created.
|
||||
* @returns {Promise<string>} new target's ID
|
||||
*/
|
||||
exports.createNewSshTargetCli = async (projectId) => {
|
||||
exports.createSshTargetCli = async (projectId) => {
|
||||
const targetName = 'target-' + nanoid();
|
||||
const defaultPort = 22;
|
||||
let target;
|
||||
|
||||
@@ -13,7 +13,7 @@ const { nanoid } = require('nanoid');
|
||||
* @param {Page} page Playwright page object
|
||||
* @returns Name of the organization
|
||||
*/
|
||||
exports.createNewOrg = async (page) => {
|
||||
exports.createOrg = async (page) => {
|
||||
const orgName = 'Org ' + nanoid();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'General' })
|
||||
@@ -39,7 +39,7 @@ exports.createNewOrg = async (page) => {
|
||||
* @param {Page} page Playwright page object
|
||||
* @returns Name of the project
|
||||
*/
|
||||
exports.createNewProject = async (page) => {
|
||||
exports.createProject = async (page) => {
|
||||
const projectName = 'Project ' + nanoid();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'General' })
|
||||
@@ -67,7 +67,7 @@ exports.createNewProject = async (page) => {
|
||||
* @param {Page} page Playwright page object
|
||||
* @returns Name of the host catalog
|
||||
*/
|
||||
exports.createNewHostCatalog = async (page) => {
|
||||
exports.createHostCatalog = async (page) => {
|
||||
const hostCatalogName = 'Host Catalog ' + nanoid();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Resources' })
|
||||
@@ -95,7 +95,7 @@ exports.createNewHostCatalog = async (page) => {
|
||||
* @param {Page} page Playwright page object
|
||||
* @returns Name of the host set
|
||||
*/
|
||||
exports.createNewHostSet = async (page) => {
|
||||
exports.createHostSet = async (page) => {
|
||||
const hostSetName = 'Host Set ' + nanoid();
|
||||
await page.getByRole('link', { name: 'Host Sets' }).click();
|
||||
await page.getByRole('link', { name: 'New', exact: true }).click();
|
||||
@@ -121,7 +121,7 @@ exports.createNewHostSet = async (page) => {
|
||||
* @param {string} address Address of the host
|
||||
* @returns Name of the host
|
||||
*/
|
||||
exports.createNewHostInHostSet = async (page, address) => {
|
||||
exports.createHostInHostSet = async (page, address) => {
|
||||
const hostName = 'Host ' + nanoid();
|
||||
await page.getByText('Manage').click();
|
||||
await page.getByRole('link', { name: 'Create and Add Host' }).click();
|
||||
@@ -336,7 +336,7 @@ exports.createVaultSshCertificateCredentialLibrary = async (
|
||||
* @param {string} port Port of the target
|
||||
* @returns Name of the target
|
||||
*/
|
||||
exports.createNewTarget = async (page, port) => {
|
||||
exports.createTarget = async (page, port) => {
|
||||
const targetName = 'Target ' + nanoid();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Resources' })
|
||||
@@ -365,7 +365,7 @@ exports.createNewTarget = async (page, port) => {
|
||||
* @param {string} port Port of the target
|
||||
* @returns Name of the target
|
||||
*/
|
||||
exports.createNewTargetWithAddress = async (page, address, port) => {
|
||||
exports.createTargetWithAddress = async (page, address, port) => {
|
||||
const targetName = 'Target ' + nanoid();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Resources' })
|
||||
@@ -668,9 +668,10 @@ exports.addInjectedCredentialsToTarget = async (
|
||||
/**
|
||||
* Uses the UI to create new Auth Method. Assumes you have selected the desired scope.
|
||||
* @param {Page} page Playwright page object
|
||||
* @param {string} authMethodName Name of new auth method
|
||||
* @returns Name of the auth method
|
||||
*/
|
||||
exports.createNewPasswordAuthMethod = async (page, authMethodName) => {
|
||||
exports.createPasswordAuthMethod = async (page) => {
|
||||
const authMethodName = 'Auth Method ' + nanoid();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'IAM' })
|
||||
.getByRole('link', { name: 'Auth Methods' })
|
||||
@@ -688,6 +689,8 @@ exports.createNewPasswordAuthMethod = async (page, authMethodName) => {
|
||||
.getByRole('navigation', { name: 'breadcrumbs' })
|
||||
.getByText(authMethodName),
|
||||
).toBeVisible();
|
||||
|
||||
return authMethodName;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -757,9 +760,10 @@ exports.setPasswordToAccount = async (page, password) => {
|
||||
/**
|
||||
* Uses the UI to create a new user.
|
||||
* @param {Page} page Playwright page object
|
||||
* @param {string} userName Name of new user
|
||||
* @returns Name of the user
|
||||
*/
|
||||
exports.createNewUser = async (page, userName) => {
|
||||
exports.createUser = async (page) => {
|
||||
const userName = 'User ' + nanoid();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'IAM' })
|
||||
.getByRole('link', { name: 'Users' })
|
||||
@@ -777,6 +781,8 @@ exports.createNewUser = async (page, userName) => {
|
||||
await expect(
|
||||
page.getByRole('navigation', { name: 'breadcrumbs' }).getByText(userName),
|
||||
).toBeVisible();
|
||||
|
||||
return userName;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -803,9 +809,10 @@ exports.addAccountToUser = async (page) => {
|
||||
/**
|
||||
* Uses the UI to create a new group. Assumes you have selected the desired scope.
|
||||
* @param {Page} page Playwright page object
|
||||
* @param {string} groupName Name of the new group
|
||||
* @returns Name of the group
|
||||
*/
|
||||
exports.createNewGroup = async (page, groupName) => {
|
||||
exports.createGroup = async (page) => {
|
||||
const groupName = 'Group ' + nanoid();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'IAM' })
|
||||
.getByRole('link', { name: 'Groups' })
|
||||
@@ -823,6 +830,8 @@ exports.createNewGroup = async (page, groupName) => {
|
||||
await expect(
|
||||
page.getByRole('navigation', { name: 'breadcrumbs' }).getByText(groupName),
|
||||
).toBeVisible();
|
||||
|
||||
return groupName;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,7 @@ const {
|
||||
deleteOrgCli,
|
||||
} = require('../helpers/boundary-cli');
|
||||
const {
|
||||
createNewOrg,
|
||||
createOrg,
|
||||
createRole,
|
||||
addPrincipalToRole,
|
||||
} = require('../helpers/boundary-ui');
|
||||
@@ -42,7 +42,7 @@ test('Set up LDAP auth method @ce @ent @docker', async ({ page }) => {
|
||||
let connect;
|
||||
try {
|
||||
// Create an org
|
||||
const orgName = await createNewOrg(page);
|
||||
const orgName = await createOrg(page);
|
||||
await authenticateBoundaryCli(
|
||||
process.env.BOUNDARY_ADDR,
|
||||
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
|
||||
|
||||
@@ -13,11 +13,11 @@ const {
|
||||
deleteOrgCli,
|
||||
} = require('../helpers/boundary-cli');
|
||||
const {
|
||||
createNewOrg,
|
||||
createNewPasswordAuthMethod,
|
||||
createOrg,
|
||||
createPasswordAuthMethod,
|
||||
addAccountToAuthMethod,
|
||||
setPasswordToAccount,
|
||||
createNewUser,
|
||||
createUser,
|
||||
addAccountToUser,
|
||||
makeAuthMethodPrimary,
|
||||
} = require('../helpers/boundary-ui');
|
||||
@@ -34,7 +34,7 @@ test('Verify new auth-method can be created and assigned to users @ce @ent @aws
|
||||
await page.goto('/');
|
||||
let org;
|
||||
try {
|
||||
const orgName = await createNewOrg(page);
|
||||
const orgName = await createOrg(page);
|
||||
await authenticateBoundaryCli(
|
||||
process.env.BOUNDARY_ADDR,
|
||||
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
|
||||
@@ -43,7 +43,7 @@ test('Verify new auth-method can be created and assigned to users @ce @ent @aws
|
||||
);
|
||||
const orgs = JSON.parse(execSync('boundary scopes list -format json'));
|
||||
org = orgs.items.filter((obj) => obj.name == orgName)[0];
|
||||
await createNewPasswordAuthMethod(page, 'UI Test Auth Method');
|
||||
await createPasswordAuthMethod(page);
|
||||
await addAccountToAuthMethod(
|
||||
page,
|
||||
'UI Test Account',
|
||||
@@ -52,7 +52,7 @@ test('Verify new auth-method can be created and assigned to users @ce @ent @aws
|
||||
);
|
||||
await setPasswordToAccount(page, 'password2');
|
||||
await makeAuthMethodPrimary(page);
|
||||
await createNewUser(page, 'UI Test User');
|
||||
await createUser(page);
|
||||
await addAccountToUser(page);
|
||||
} finally {
|
||||
await deleteOrgCli(org.id);
|
||||
|
||||
@@ -14,12 +14,12 @@ const {
|
||||
getSessionCli,
|
||||
} = require('../helpers/boundary-cli');
|
||||
const {
|
||||
createNewOrg,
|
||||
createNewProject,
|
||||
createNewHostCatalog,
|
||||
createNewHostSet,
|
||||
createNewHostInHostSet,
|
||||
createNewTarget,
|
||||
createOrg,
|
||||
createProject,
|
||||
createHostCatalog,
|
||||
createHostSet,
|
||||
createHostInHostSet,
|
||||
createTarget,
|
||||
createStaticCredentialStore,
|
||||
createStaticCredentialKeyPair,
|
||||
addBrokeredCredentialsToTarget,
|
||||
@@ -46,12 +46,12 @@ let targetName;
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/');
|
||||
|
||||
orgName = await createNewOrg(page);
|
||||
projectName = await createNewProject(page);
|
||||
await createNewHostCatalog(page);
|
||||
const hostSetName = await createNewHostSet(page);
|
||||
await createNewHostInHostSet(page, process.env.E2E_TARGET_ADDRESS);
|
||||
targetName = await createNewTarget(page, process.env.E2E_TARGET_PORT);
|
||||
orgName = await createOrg(page);
|
||||
projectName = await createProject(page);
|
||||
await createHostCatalog(page);
|
||||
const hostSetName = await createHostSet(page);
|
||||
await createHostInHostSet(page, process.env.E2E_TARGET_ADDRESS);
|
||||
targetName = await createTarget(page, process.env.E2E_TARGET_PORT);
|
||||
await addHostSourceToTarget(page, hostSetName);
|
||||
await createStaticCredentialStore(page);
|
||||
});
|
||||
|
||||
@@ -15,13 +15,13 @@ const {
|
||||
} = require('../helpers/boundary-cli');
|
||||
const { checkVaultCli } = require('../helpers/vault-cli');
|
||||
const {
|
||||
createNewOrg,
|
||||
createNewProject,
|
||||
createOrg,
|
||||
createProject,
|
||||
createVaultCredentialStore,
|
||||
createNewHostCatalog,
|
||||
createNewHostSet,
|
||||
createNewHostInHostSet,
|
||||
createNewTarget,
|
||||
createHostCatalog,
|
||||
createHostSet,
|
||||
createHostInHostSet,
|
||||
createTarget,
|
||||
addHostSourceToTarget,
|
||||
addBrokeredCredentialsToTarget,
|
||||
} = require('../helpers/boundary-ui');
|
||||
@@ -87,7 +87,7 @@ test('Vault Credential Store (User & Key Pair) @ce @aws @docker', async ({
|
||||
);
|
||||
const clientToken = vaultToken.auth.client_token;
|
||||
|
||||
const orgName = await createNewOrg(page);
|
||||
const orgName = await createOrg(page);
|
||||
await authenticateBoundaryCli(
|
||||
process.env.BOUNDARY_ADDR,
|
||||
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
|
||||
@@ -97,16 +97,16 @@ test('Vault Credential Store (User & Key Pair) @ce @aws @docker', async ({
|
||||
const orgs = JSON.parse(execSync('boundary scopes list -format json'));
|
||||
org = orgs.items.filter((obj) => obj.name == orgName)[0];
|
||||
|
||||
const projectName = await createNewProject(page);
|
||||
const projectName = await createProject(page);
|
||||
const projects = JSON.parse(
|
||||
execSync(`boundary scopes list -format json -scope-id ${org.id}`),
|
||||
);
|
||||
const project = projects.items.filter((obj) => obj.name == projectName)[0];
|
||||
|
||||
await createNewHostCatalog(page);
|
||||
const hostSetName = await createNewHostSet(page);
|
||||
await createNewHostInHostSet(page, process.env.E2E_TARGET_ADDRESS);
|
||||
const targetName = await createNewTarget(page, process.env.E2E_TARGET_PORT);
|
||||
await createHostCatalog(page);
|
||||
const hostSetName = await createHostSet(page);
|
||||
await createHostInHostSet(page, process.env.E2E_TARGET_ADDRESS);
|
||||
const targetName = await createTarget(page, process.env.E2E_TARGET_PORT);
|
||||
await addHostSourceToTarget(page, hostSetName);
|
||||
const targets = JSON.parse(
|
||||
execSync(`boundary targets list -format json -scope-id ${project.id}`),
|
||||
|
||||
@@ -10,24 +10,24 @@ const { authenticatedState, checkEnv } = require('../helpers/general');
|
||||
const {
|
||||
authenticateBoundaryCli,
|
||||
checkBoundaryCli,
|
||||
createNewOrgCli,
|
||||
createNewProjectCli,
|
||||
createNewControllerLedWorkerCli,
|
||||
createNewPasswordAuthMethodCli,
|
||||
createOrgCli,
|
||||
createProjectCli,
|
||||
createControllerLedWorkerCli,
|
||||
createPasswordAuthMethodCli,
|
||||
makeAuthMethodPrimaryCli,
|
||||
createNewPasswordAccountCli,
|
||||
createNewRoleCli,
|
||||
createNewGroupCli,
|
||||
createNewUserCli,
|
||||
createNewStaticHostCatalogCli,
|
||||
createPasswordAccountCli,
|
||||
createRoleCli,
|
||||
createGroupCli,
|
||||
createUserCli,
|
||||
createStaticHostCatalogCli,
|
||||
createDynamicAwsHostCatalogCli,
|
||||
createNewStaticHostCli,
|
||||
createNewHostSetCli,
|
||||
createNewStaticCredentialStoreCli,
|
||||
createNewTcpTarget,
|
||||
createNewSshTargetCli,
|
||||
createNewVaultCredentialStoreCli,
|
||||
createNewUsernamePasswordCredentialCli,
|
||||
createStaticHostCli,
|
||||
createHostSetCli,
|
||||
createStaticCredentialStoreCli,
|
||||
createTcpTarget,
|
||||
createSshTargetCli,
|
||||
createVaultCredentialStoreCli,
|
||||
createUsernamePasswordCredentialCli,
|
||||
deleteOrgCli,
|
||||
} = require('../helpers/boundary-cli');
|
||||
|
||||
@@ -74,38 +74,38 @@ test('Verify resources can be deleted (enterprise) @ent @aws', async ({
|
||||
}) => {
|
||||
let orgId;
|
||||
try {
|
||||
orgId = await createNewOrgCli();
|
||||
let projectId = await createNewProjectCli(orgId);
|
||||
orgId = await createOrgCli();
|
||||
let projectId = await createProjectCli(orgId);
|
||||
|
||||
// Create boundary resources using CLI
|
||||
let workerId = await createNewControllerLedWorkerCli();
|
||||
let authMethodId = await createNewPasswordAuthMethodCli(orgId);
|
||||
let workerId = await createControllerLedWorkerCli();
|
||||
let authMethodId = await createPasswordAuthMethodCli(orgId);
|
||||
await makeAuthMethodPrimaryCli(orgId, authMethodId);
|
||||
let passwordAccountId = await createNewPasswordAccountCli(authMethodId);
|
||||
let projectScopeRoleId = await createNewRoleCli(projectId);
|
||||
let orgScopeRoleId = await createNewRoleCli(orgId);
|
||||
let globalScopeRoleId = await createNewRoleCli('global');
|
||||
let groupId = await createNewGroupCli(orgId);
|
||||
let userId = await createNewUserCli(orgId);
|
||||
let staticHostCatalogId = await createNewStaticHostCatalogCli(projectId);
|
||||
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(projectId);
|
||||
let staticHostId = await createNewStaticHostCli(staticHostCatalogId);
|
||||
let staticHostSetId = await createNewHostSetCli(staticHostCatalogId);
|
||||
let staticHostId = await createStaticHostCli(staticHostCatalogId);
|
||||
let staticHostSetId = await createHostSetCli(staticHostCatalogId);
|
||||
let staticCredentialStoreId =
|
||||
await createNewStaticCredentialStoreCli(projectId);
|
||||
let vaultCredentialStoreId = await createNewVaultCredentialStoreCli(
|
||||
await createStaticCredentialStoreCli(projectId);
|
||||
let vaultCredentialStoreId = await createVaultCredentialStoreCli(
|
||||
projectId,
|
||||
process.env.E2E_VAULT_ADDR,
|
||||
secretPolicyName,
|
||||
boundaryPolicyName,
|
||||
);
|
||||
let usernamePasswordCredentialId =
|
||||
await createNewUsernamePasswordCredentialCli(staticCredentialStoreId);
|
||||
let tcpTargetId = await createNewTcpTarget(projectId);
|
||||
await createUsernamePasswordCredentialCli(staticCredentialStoreId);
|
||||
let tcpTargetId = await createTcpTarget(projectId);
|
||||
|
||||
// Create enterprise boundary resources using CLI
|
||||
let sshTargetId = await createNewSshTargetCli(projectId);
|
||||
let sshTargetId = await createSshTargetCli(projectId);
|
||||
|
||||
// Delete resources
|
||||
await page.goto(`/scopes/${projectId}/targets/${tcpTargetId}`);
|
||||
|
||||
@@ -10,23 +10,23 @@ const { authenticatedState, checkEnv } = require('../helpers/general');
|
||||
const {
|
||||
authenticateBoundaryCli,
|
||||
checkBoundaryCli,
|
||||
createNewOrgCli,
|
||||
createNewProjectCli,
|
||||
createNewControllerLedWorkerCli,
|
||||
createNewPasswordAuthMethodCli,
|
||||
createOrgCli,
|
||||
createProjectCli,
|
||||
createControllerLedWorkerCli,
|
||||
createPasswordAuthMethodCli,
|
||||
makeAuthMethodPrimaryCli,
|
||||
createNewPasswordAccountCli,
|
||||
createNewRoleCli,
|
||||
createNewGroupCli,
|
||||
createNewUserCli,
|
||||
createNewStaticHostCatalogCli,
|
||||
createPasswordAccountCli,
|
||||
createRoleCli,
|
||||
createGroupCli,
|
||||
createUserCli,
|
||||
createStaticHostCatalogCli,
|
||||
createDynamicAwsHostCatalogCli,
|
||||
createNewStaticHostCli,
|
||||
createNewHostSetCli,
|
||||
createNewStaticCredentialStoreCli,
|
||||
createNewTcpTarget,
|
||||
createNewVaultCredentialStoreCli,
|
||||
createNewUsernamePasswordCredentialCli,
|
||||
createStaticHostCli,
|
||||
createHostSetCli,
|
||||
createStaticCredentialStoreCli,
|
||||
createTcpTarget,
|
||||
createVaultCredentialStoreCli,
|
||||
createUsernamePasswordCredentialCli,
|
||||
deleteOrgCli,
|
||||
} = require('../helpers/boundary-cli');
|
||||
|
||||
@@ -72,33 +72,33 @@ test('Verify resources can be deleted @ce @aws', async ({ page }) => {
|
||||
let orgId;
|
||||
try {
|
||||
// Create boundary resources using CLI
|
||||
orgId = await createNewOrgCli();
|
||||
let projectId = await createNewProjectCli(orgId);
|
||||
let workerId = await createNewControllerLedWorkerCli();
|
||||
let authMethodId = await createNewPasswordAuthMethodCli(orgId);
|
||||
orgId = await createOrgCli();
|
||||
let projectId = await createProjectCli(orgId);
|
||||
let workerId = await createControllerLedWorkerCli();
|
||||
let authMethodId = await createPasswordAuthMethodCli(orgId);
|
||||
await makeAuthMethodPrimaryCli(orgId, authMethodId);
|
||||
let passwordAccountId = await createNewPasswordAccountCli(authMethodId);
|
||||
let projectScopeRoleId = await createNewRoleCli(projectId);
|
||||
let orgScopeRoleId = await createNewRoleCli(orgId);
|
||||
let globalScopeRoleId = await createNewRoleCli('global');
|
||||
let groupId = await createNewGroupCli(orgId);
|
||||
let userId = await createNewUserCli(orgId);
|
||||
let staticHostCatalogId = await createNewStaticHostCatalogCli(projectId);
|
||||
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(projectId);
|
||||
let staticHostId = await createNewStaticHostCli(staticHostCatalogId);
|
||||
let staticHostSetId = await createNewHostSetCli(staticHostCatalogId);
|
||||
let staticHostId = await createStaticHostCli(staticHostCatalogId);
|
||||
let staticHostSetId = await createHostSetCli(staticHostCatalogId);
|
||||
let staticCredentialStoreId =
|
||||
await createNewStaticCredentialStoreCli(projectId);
|
||||
let vaultCredentialStoreId = await createNewVaultCredentialStoreCli(
|
||||
await createStaticCredentialStoreCli(projectId);
|
||||
let vaultCredentialStoreId = await createVaultCredentialStoreCli(
|
||||
projectId,
|
||||
process.env.E2E_VAULT_ADDR,
|
||||
secretPolicyName,
|
||||
boundaryPolicyName,
|
||||
);
|
||||
let usernamePasswordCredentialId =
|
||||
await createNewUsernamePasswordCredentialCli(staticCredentialStoreId);
|
||||
let tcpTargetId = await createNewTcpTarget(projectId);
|
||||
await createUsernamePasswordCredentialCli(staticCredentialStoreId);
|
||||
let tcpTargetId = await createTcpTarget(projectId);
|
||||
|
||||
// Delete TCP target
|
||||
await page.goto(`/scopes/${projectId}/targets/${tcpTargetId}`);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
const { test, expect } = require('@playwright/test');
|
||||
const { nanoid } = require('nanoid');
|
||||
const { checkEnv, authenticatedState } = require('../helpers/general');
|
||||
const { createNewOrg, createNewProject } = require('../helpers/boundary-ui');
|
||||
const { createOrg, createProject } = require('../helpers/boundary-ui');
|
||||
|
||||
test.use({ storageState: authenticatedState });
|
||||
|
||||
@@ -28,8 +28,8 @@ test.describe('AWS', async () => {
|
||||
test('Create a Dynamic Host Catalog and set up Host Sets @ce @ent @aws', async ({
|
||||
page,
|
||||
}) => {
|
||||
await createNewOrg(page);
|
||||
await createNewProject(page);
|
||||
await createOrg(page);
|
||||
await createProject(page);
|
||||
|
||||
const hostCatalogName = 'Host Catalog ' + nanoid();
|
||||
await page
|
||||
|
||||
@@ -13,8 +13,8 @@ const {
|
||||
deleteOrgCli,
|
||||
} = require('../helpers/boundary-cli');
|
||||
const {
|
||||
createNewOrg,
|
||||
createNewGroup,
|
||||
createOrg,
|
||||
createGroup,
|
||||
addMemberToGroup,
|
||||
createRole,
|
||||
addPrincipalToRole,
|
||||
@@ -33,7 +33,7 @@ test('Verify a new role can be created and associated with a group @ce @ent @aws
|
||||
await page.goto('/');
|
||||
let org;
|
||||
try {
|
||||
const orgName = await createNewOrg(page);
|
||||
const orgName = await createOrg(page);
|
||||
await authenticateBoundaryCli(
|
||||
process.env.BOUNDARY_ADDR,
|
||||
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
|
||||
@@ -42,8 +42,7 @@ test('Verify a new role can be created and associated with a group @ce @ent @aws
|
||||
);
|
||||
const orgs = JSON.parse(execSync('boundary scopes list -format json'));
|
||||
org = orgs.items.filter((obj) => obj.name == orgName)[0];
|
||||
const groupName = 'test-group';
|
||||
await createNewGroup(page, groupName);
|
||||
const groupName = await createGroup(page);
|
||||
await addMemberToGroup(page, 'admin');
|
||||
await createRole(page);
|
||||
await addPrincipalToRole(page, groupName);
|
||||
|
||||
@@ -23,8 +23,8 @@ const {
|
||||
enableSessionRecording,
|
||||
createStoragePolicy,
|
||||
attachStoragePolicy,
|
||||
createNewOrg,
|
||||
createNewProject,
|
||||
createOrg,
|
||||
createProject,
|
||||
createStaticCredentialStore,
|
||||
createStaticCredentialKeyPair,
|
||||
addInjectedCredentialsToTarget,
|
||||
@@ -56,7 +56,7 @@ test('Verify session recording can be deleted @ent @aws', async ({ page }) => {
|
||||
let connect;
|
||||
try {
|
||||
// Create org
|
||||
const orgName = await createNewOrg(page);
|
||||
const orgName = await createOrg(page);
|
||||
await authenticateBoundaryCli(
|
||||
process.env.BOUNDARY_ADDR,
|
||||
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
|
||||
@@ -68,7 +68,7 @@ test('Verify session recording can be deleted @ent @aws', async ({ page }) => {
|
||||
orgId = org.id;
|
||||
|
||||
// Create project
|
||||
const projectName = await createNewProject(page);
|
||||
const projectName = await createProject(page);
|
||||
const projects = JSON.parse(
|
||||
execSync('boundary scopes list -format json -scope-id ' + org.id),
|
||||
);
|
||||
|
||||
@@ -15,8 +15,8 @@ const {
|
||||
} = require('../helpers/boundary-cli');
|
||||
const { checkVaultCli } = require('../helpers/vault-cli');
|
||||
const {
|
||||
createNewOrg,
|
||||
createNewProject,
|
||||
createOrg,
|
||||
createProject,
|
||||
createSshTargetWithAddressEnt,
|
||||
createVaultCredentialStore,
|
||||
createVaultSshCertificateCredentialLibrary,
|
||||
@@ -96,7 +96,7 @@ test('SSH Certificate Injection @ent @docker', async ({ page }) => {
|
||||
const clientToken = vaultToken.auth.client_token;
|
||||
|
||||
// Create org
|
||||
const orgName = await createNewOrg(page);
|
||||
const orgName = await createOrg(page);
|
||||
await authenticateBoundaryCli(
|
||||
process.env.BOUNDARY_ADDR,
|
||||
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
|
||||
@@ -107,7 +107,7 @@ test('SSH Certificate Injection @ent @docker', async ({ page }) => {
|
||||
org = orgs.items.filter((obj) => obj.name == orgName)[0];
|
||||
|
||||
// Create project
|
||||
const projectName = await createNewProject(page);
|
||||
const projectName = await createProject(page);
|
||||
const projects = JSON.parse(
|
||||
execSync('boundary scopes list -format json -scope-id ' + org.id),
|
||||
);
|
||||
|
||||
@@ -15,8 +15,8 @@ const {
|
||||
} = require('../helpers/boundary-cli');
|
||||
const { checkVaultCli } = require('../helpers/vault-cli');
|
||||
const {
|
||||
createNewOrg,
|
||||
createNewProject,
|
||||
createOrg,
|
||||
createProject,
|
||||
createSshTargetWithAddressEnt,
|
||||
createVaultCredentialStore,
|
||||
createVaultGenericCredentialLibrary,
|
||||
@@ -88,7 +88,7 @@ test('SSH Credential Injection (Vault User & Key Pair) @ent @docker', async ({
|
||||
const clientToken = vaultToken.auth.client_token;
|
||||
|
||||
// Create org
|
||||
const orgName = await createNewOrg(page);
|
||||
const orgName = await createOrg(page);
|
||||
await authenticateBoundaryCli(
|
||||
process.env.BOUNDARY_ADDR,
|
||||
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
|
||||
@@ -99,7 +99,7 @@ test('SSH Credential Injection (Vault User & Key Pair) @ent @docker', async ({
|
||||
org = orgs.items.filter((obj) => obj.name == orgName)[0];
|
||||
|
||||
// Create project
|
||||
const projectName = await createNewProject(page);
|
||||
const projectName = await createProject(page);
|
||||
const projects = JSON.parse(
|
||||
execSync('boundary scopes list -format json -scope-id ' + org.id),
|
||||
);
|
||||
|
||||
@@ -15,8 +15,8 @@ const {
|
||||
deleteOrgCli,
|
||||
} = require('../helpers/boundary-cli');
|
||||
const {
|
||||
createNewOrg,
|
||||
createNewProject,
|
||||
createOrg,
|
||||
createProject,
|
||||
createStaticCredentialStore,
|
||||
createStaticCredentialKeyPair,
|
||||
addInjectedCredentialsToTarget,
|
||||
@@ -46,7 +46,7 @@ test('Verify session created for TCP target @ent @aws @docker', async ({
|
||||
let org;
|
||||
let connect;
|
||||
try {
|
||||
const orgName = await createNewOrg(page);
|
||||
const orgName = await createOrg(page);
|
||||
await authenticateBoundaryCli(
|
||||
process.env.BOUNDARY_ADDR,
|
||||
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
|
||||
@@ -56,7 +56,7 @@ test('Verify session created for TCP target @ent @aws @docker', async ({
|
||||
const orgs = JSON.parse(execSync('boundary scopes list -format json'));
|
||||
org = orgs.items.filter((obj) => obj.name == orgName)[0];
|
||||
|
||||
const projectName = await createNewProject(page);
|
||||
const projectName = await createProject(page);
|
||||
const projects = JSON.parse(
|
||||
execSync('boundary scopes list -format json -scope-id ' + org.id),
|
||||
);
|
||||
@@ -101,7 +101,7 @@ test('Verify session created for SSH target @ent @aws @docker', async ({
|
||||
let org;
|
||||
let connect;
|
||||
try {
|
||||
const orgName = await createNewOrg(page);
|
||||
const orgName = await createOrg(page);
|
||||
await authenticateBoundaryCli(
|
||||
process.env.BOUNDARY_ADDR,
|
||||
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
|
||||
@@ -111,7 +111,7 @@ test('Verify session created for SSH target @ent @aws @docker', async ({
|
||||
const orgs = JSON.parse(execSync('boundary scopes list -format json'));
|
||||
org = orgs.items.filter((obj) => obj.name == orgName)[0];
|
||||
|
||||
const projectName = await createNewProject(page);
|
||||
const projectName = await createProject(page);
|
||||
const projects = JSON.parse(
|
||||
execSync('boundary scopes list -format json -scope-id ' + org.id),
|
||||
);
|
||||
|
||||
@@ -14,13 +14,13 @@ const {
|
||||
deleteOrgCli,
|
||||
} = require('../helpers/boundary-cli');
|
||||
const {
|
||||
createNewOrg,
|
||||
createNewProject,
|
||||
createNewHostCatalog,
|
||||
createNewHostSet,
|
||||
createNewHostInHostSet,
|
||||
createNewTarget,
|
||||
createNewTargetWithAddress,
|
||||
createOrg,
|
||||
createProject,
|
||||
createHostCatalog,
|
||||
createHostSet,
|
||||
createHostInHostSet,
|
||||
createTarget,
|
||||
createTargetWithAddress,
|
||||
waitForSessionToBeVisible,
|
||||
addHostSourceToTarget,
|
||||
} = require('../helpers/boundary-ui');
|
||||
@@ -45,12 +45,12 @@ test('Verify session created to target with host, then cancel the session @ce @a
|
||||
let org;
|
||||
let connect;
|
||||
try {
|
||||
const orgName = await createNewOrg(page);
|
||||
const projectName = await createNewProject(page);
|
||||
await createNewHostCatalog(page);
|
||||
const hostSetName = await createNewHostSet(page);
|
||||
await createNewHostInHostSet(page, process.env.E2E_TARGET_ADDRESS);
|
||||
const targetName = await createNewTarget(page, process.env.E2E_TARGET_PORT);
|
||||
const orgName = await createOrg(page);
|
||||
const projectName = await createProject(page);
|
||||
await createHostCatalog(page);
|
||||
const hostSetName = await createHostSet(page);
|
||||
await createHostInHostSet(page, process.env.E2E_TARGET_ADDRESS);
|
||||
const targetName = await createTarget(page, process.env.E2E_TARGET_PORT);
|
||||
await addHostSourceToTarget(page, hostSetName);
|
||||
|
||||
await authenticateBoundaryCli(
|
||||
@@ -97,9 +97,9 @@ test('Verify session created to target with address, then cancel the session @ce
|
||||
let org;
|
||||
let connect;
|
||||
try {
|
||||
const orgName = await createNewOrg(page);
|
||||
const projectName = await createNewProject(page);
|
||||
const targetName = await createNewTargetWithAddress(
|
||||
const orgName = await createOrg(page);
|
||||
const projectName = await createProject(page);
|
||||
const targetName = await createTargetWithAddress(
|
||||
page,
|
||||
process.env.E2E_TARGET_ADDRESS,
|
||||
process.env.E2E_TARGET_PORT,
|
||||
@@ -146,9 +146,9 @@ test('Verify TCP target is updated @ce @aws @docker', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
let orgName;
|
||||
try {
|
||||
orgName = await createNewOrg(page);
|
||||
await createNewProject(page);
|
||||
await createNewTargetWithAddress(
|
||||
orgName = await createOrg(page);
|
||||
await createProject(page);
|
||||
await createTargetWithAddress(
|
||||
page,
|
||||
process.env.E2E_TARGET_ADDRESS,
|
||||
process.env.E2E_TARGET_PORT,
|
||||
|
||||
Reference in new issue
Block a user