diff --git a/e2e-tests/admin/pages/aliases.js b/e2e-tests/admin/pages/aliases.js index c63c46280c..3a6d740e89 100644 --- a/e2e-tests/admin/pages/aliases.js +++ b/e2e-tests/admin/pages/aliases.js @@ -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(); diff --git a/e2e-tests/admin/tests/alias-ent.spec.js b/e2e-tests/admin/tests/alias-ent.spec.js index 20f7d43842..ecb6c56d7d 100644 --- a/e2e-tests/admin/tests/alias-ent.spec.js +++ b/e2e-tests/admin/tests/alias-ent.spec.js @@ -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 { diff --git a/e2e-tests/admin/tests/alias.spec.js b/e2e-tests/admin/tests/alias.spec.js index 431ccb972d..88512f9c3d 100644 --- a/e2e-tests/admin/tests/alias.spec.js +++ b/e2e-tests/admin/tests/alias.spec.js @@ -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(); diff --git a/e2e-tests/admin/tests/auth-method-oidc-vault.spec.js b/e2e-tests/admin/tests/auth-method-oidc-vault.spec.js index 1a4302a278..0b43c90be2 100644 --- a/e2e-tests/admin/tests/auth-method-oidc-vault.spec.js +++ b/e2e-tests/admin/tests/auth-method-oidc-vault.spec.js @@ -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(); diff --git a/e2e-tests/admin/tests/change-password.spec.js b/e2e-tests/admin/tests/change-password.spec.js index aa03ff5edf..fc7b8c8b9e 100644 --- a/e2e-tests/admin/tests/change-password.spec.js +++ b/e2e-tests/admin/tests/change-password.spec.js @@ -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); diff --git a/e2e-tests/admin/tests/delete-resources-ent.spec.js b/e2e-tests/admin/tests/delete-resources-ent.spec.js index 0c9448bf25..456603de00 100644 --- a/e2e-tests/admin/tests/delete-resources-ent.spec.js +++ b/e2e-tests/admin/tests/delete-resources-ent.spec.js @@ -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 = @@ -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); diff --git a/e2e-tests/admin/tests/delete-resources.spec.js b/e2e-tests/admin/tests/delete-resources.spec.js index ca9b915d1b..0962919f29 100644 --- a/e2e-tests/admin/tests/delete-resources.spec.js +++ b/e2e-tests/admin/tests/delete-resources.spec.js @@ -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 = @@ -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 diff --git a/e2e-tests/admin/tests/scope.spec.js b/e2e-tests/admin/tests/scope.spec.js index 494d8654df..595bd7f39b 100644 --- a/e2e-tests/admin/tests/scope.spec.js +++ b/e2e-tests/admin/tests/scope.spec.js @@ -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}`); - } - } - }, -); \ No newline at end of file + // 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}`); + } + } + }, +);