test(e2e): Address some Admin UI test flakiness (#2934)

* fix(e2e): Address flakiness during screen navigation

* fix(e2e): Fix function call

* fix(e2e): Address flakiness in connection

* fix(e2e): Make locator explicit to avoid conflict when an ID has `ok`

* fix(e2e): Fix URL now that project page defaults to showing targets
This commit is contained in:
Michael Li authored and GitHub committed 2025-09-03 11:28:33 -04:00
1 parent a26074a3b8
commit 1bafbe1ad2
8 files changed
+65 -53

No files matched your search

+28 -29
View File
@@ -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}`);
}
}
},
);