Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions e2e-tests/admin/pages/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,9 @@ export class AliasesPage extends BaseResourcePage {
* @param {string} targetId ID of the target
* @returns Name of the alias
*/
async createAliasForTarget(alias, targetId, orgName) {
async createAliasForTarget(alias, targetId) {
const aliasName = 'Alias ' + nanoid();

await this.page
.getByRole('link', { name: `Back to ${orgName}`, exact: true })
.click();
await this.page.getByRole('link', { name: 'Back to Global' }).click();
await this.page.getByRole('link', { name: 'Aliases' }).click();
await expect(
this.page
.getByRole('navigation', { name: 'breadcrumbs' })
.getByText('Aliases'),
).toBeVisible();

const newButtonIsVisible = await this.page
.getByRole('link', { name: 'Create a new alias', exact: true })
.isVisible();
Expand Down
15 changes: 13 additions & 2 deletions e2e-tests/admin/tests/alias-ent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,27 @@ test.describe('Aliases (Enterprise)', () => {
targetName,
);

await page
.getByRole('link', { name: `Back to ${orgName}`, exact: true })
.click();
await page.getByRole('link', { name: 'Back to Global' }).click();
await page.getByRole('link', { name: 'Aliases' }).click();
await expect(
page
.getByRole('navigation', { name: 'breadcrumbs' })
.getByText('Aliases'),
).toBeVisible();
alias = 'example.alias.' + nanoid();
const aliasesPage = new AliasesPage(page);
await aliasesPage.createAliasForTarget(alias, targetId, orgName);
connect = await boundaryCli.connectSshToAlias(alias);
await aliasesPage.createAliasForTarget(alias, targetId);
await page
.getByRole('navigation', { name: 'Application local navigation' })
.getByRole('link', { name: 'Orgs' })
.click();
await page.getByRole('link', { name: orgName }).click();
await page.getByRole('link', { name: projectName }).click();

connect = await boundaryCli.connectSshToAlias(alias);
const sessionsPage = new SessionsPage(page);
await sessionsPage.waitForSessionToBeVisible(targetName);
} finally {
Expand Down
12 changes: 11 additions & 1 deletion e2e-tests/admin/tests/alias.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,19 @@ test.describe('Aliases', () => {
targetName,
);

await page
.getByRole('link', { name: `Back to ${orgName}`, exact: true })
.click();
await page.getByRole('link', { name: 'Back to Global' }).click();
await page.getByRole('link', { name: 'Aliases' }).click();
await expect(
page
.getByRole('navigation', { name: 'breadcrumbs' })
.getByText('Aliases'),
).toBeVisible();
alias = 'example.alias.' + nanoid();
const aliasesPage = new AliasesPage(page);
await aliasesPage.createAliasForTarget(alias, targetId, orgName);
await aliasesPage.createAliasForTarget(alias, targetId);
await page.getByRole('link', { name: 'Orgs', exact: true }).click();
await expect(page.getByRole('heading', { name: 'Orgs' })).toBeVisible();
await page.getByRole('link', { name: orgName }).click();
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/admin/tests/auth-method-oidc-vault.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ test(
// Set auth method as primary
await page.getByText('Manage', { exact: true }).click();
await page.getByRole('button', { name: 'Make Primary' }).click();
await page.getByRole('button', { name: 'OK' }).click();
await page.getByRole('button', { name: 'OK', exact: true }).click();
await expect(
page.getByRole('alert').getByText('Success', { exact: true }),
).toBeVisible();
Expand Down
3 changes: 3 additions & 0 deletions e2e-tests/admin/tests/change-password.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ test(
await expect(
page.getByRole('alert').getByText('Success', { exact: true }),
).toBeVisible();
await expect(
page.getByRole('heading', { name: 'Projects' }),
).toBeVisible();

// Confirm user cannot log in with old password
await loginPage.logout(username);
Expand Down
8 changes: 4 additions & 4 deletions e2e-tests/admin/tests/delete-resources-ent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ test(
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 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 =
Expand Down Expand Up @@ -155,7 +155,7 @@ test(
await baseResourcePage.deleteResource(page);

// Delete project and org
await page.goto(`/scopes/${projectId}`);
await page.goto(`/scopes/${projectId}/edit`);
await baseResourcePage.deleteResource(page);
await page.goto(`/scopes/${orgId}/edit`);
await baseResourcePage.deleteResource(page);
Expand Down
8 changes: 4 additions & 4 deletions e2e-tests/admin/tests/delete-resources.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ test(
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 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 =
Expand Down Expand Up @@ -177,7 +177,7 @@ test(
await workersPage.deleteResource(page);

// Delete project
await page.goto(`/scopes/${projectId}`);
await page.goto(`/scopes/${projectId}/edit`);
await baseResourcePage.deleteResource(page);

// Delete org
Expand Down
57 changes: 28 additions & 29 deletions e2e-tests/admin/tests/scope.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,35 @@ import { OrgsPage } from '../pages/orgs.js';
import * as boundaryHttp from '../../helpers/boundary-http.js';

test(
'Session picker',
{ tag: ['@ce', '@ent', '@aws', '@docker'] },
async ({ page, request }) => {
let org;
try {
//Create an org and project attached to the org
org = await boundaryHttp.createOrg(request);
const project = await boundaryHttp.createProject(request, org.id);
'Session picker',
{ tag: ['@ce', '@ent', '@aws', '@docker'] },
async ({ page, request }) => {
let org;
try {
// Create an org and project attached to the org
org = await boundaryHttp.createOrg(request);
const project = await boundaryHttp.createProject(request, org.id);

//Choose the org from the scope picker
await page.goto('/');
const orgsPage = new OrgsPage(page);
await orgsPage.chooseScopeFromDropdown('Global', org.name);
// Choose the org from the scope picker
await page.goto('/');
await expect(page.getByRole('heading', { name: 'Orgs' })).toBeVisible();
const orgsPage = new OrgsPage(page);
await orgsPage.chooseScopeFromDropdown('Global', org.name);

//Expect the project to be displayed on the projects page
await expect(
page.getByRole('link', { name: project.name })
).toBeVisible()
// Expect the project to be displayed on the projects page
await expect(
page.getByRole('link', { name: project.name }),
).toBeVisible();

//Switch back to global scope
await orgsPage.chooseScopeFromDropdown(org.name, 'Global');
// Switch back to global scope
await orgsPage.chooseScopeFromDropdown(org.name, 'Global');

//Expect to be back on the orgs page
await expect(
page.getByRole('heading', { name: 'Orgs' })
).toBeVisible()
} finally {
if (org.id) {
org = await request.delete(`/v1/scopes/${org.id}`);
}
}
},
);
// Expect to be back on the orgs page
await expect(page.getByRole('heading', { name: 'Orgs' })).toBeVisible();
} finally {
if (org.id) {
org = await request.delete(`/v1/scopes/${org.id}`);
}
}
},
);