Skip to content

Commit

Permalink
Merge branch 'main' into ICU-15813-refactor-application-state-ability…
Browse files Browse the repository at this point in the history
…-dependent-descriptions
  • Loading branch information
lisbet-alvarez authored Dec 17, 2024
2 parents ee9b67f + 5be4868 commit e22b460
Show file tree
Hide file tree
Showing 44 changed files with 450 additions and 508 deletions.
59 changes: 28 additions & 31 deletions e2e-tests/admin/tests/alias-ent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 () => {
Expand Down Expand Up @@ -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();
Expand All @@ -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);
}
}
});
Expand All @@ -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,
Expand Down Expand Up @@ -174,22 +165,22 @@ 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,
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);
}
}
}
Expand Down Expand Up @@ -233,33 +224,39 @@ 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,
adminPassword,
);

if (orgId) {
await deleteScopeCli(orgId);
await boundaryCli.deleteScope(orgId);
}
if (alias) {
await deleteAliasCli(alias);
await boundaryCli.deleteAlias(alias);
}
}
});
Expand Down
59 changes: 28 additions & 31 deletions e2e-tests/admin/tests/alias.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 () => {
Expand Down Expand Up @@ -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();
Expand All @@ -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);
}
}
});
Expand All @@ -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,
Expand All @@ -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);
}
}
}
Expand Down Expand Up @@ -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);
}
}
});
Expand Down
15 changes: 5 additions & 10 deletions e2e-tests/admin/tests/auth-method-ldap.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ 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';
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 ({
Expand Down Expand Up @@ -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);
}
}
}
Expand Down
15 changes: 5 additions & 10 deletions e2e-tests/admin/tests/auth-method-password.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ({
Expand Down Expand Up @@ -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,
Expand All @@ -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);
}
}
}
Expand Down
Loading

0 comments on commit e22b460

Please sign in to comment.