* test(e2e): Address deprecation * test(e2e): Add additional connection assertions on tests * CR: Fix flake when waiting for sessions If no sessions are available and the page needs to reload, we should wait to ensure that the page has loaded before checking what the state of the sessions are * CR: Address flake in connect methods Noticed an issue where a session recording was not playable. The theory is that the session didn't last long enough before it was cancelled. This adds a 2 second wait after establishing a connection before continuing. * CR: Use authenticated state by default * CR: Update dynamic host catalog assertion * CR: Simplify host set checks - Use .all() when looping - Add check to see if we need to reload the page or not * CR: Be more specific with locator Ran into a conflict with the Static/Dynamic host catalog type and the Static/Dynamic credential type. * CR: Update connection methods to be more resilient Rather than using a hardcoded sleep, we will now run a command on the target and wait for a specific string to return before continuing. * CR
62 lines
1.8 KiB
JavaScript
62 lines
1.8 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { test } from '../../global-setup.js';
|
|
import { expect } from '@playwright/test';
|
|
|
|
import * as boundaryCli from '../../helpers/boundary-cli';
|
|
import { OrgsPage } from '../pages/orgs.js';
|
|
import { StoragePoliciesPage } from '../pages/storage-policies.js';
|
|
|
|
test('Global Settings @ent @aws @docker', async ({
|
|
page,
|
|
baseURL,
|
|
adminAuthMethodId,
|
|
adminLoginName,
|
|
adminPassword,
|
|
}) => {
|
|
await page.goto('/');
|
|
let policyName;
|
|
try {
|
|
// Create a storage policy
|
|
const storagePoliciesPage = new StoragePoliciesPage(page);
|
|
policyName = await storagePoliciesPage.createStoragePolicy();
|
|
const orgsPage = new OrgsPage(page);
|
|
await orgsPage.attachStoragePolicy(policyName);
|
|
|
|
// Detach storage policy
|
|
await page.getByRole('button', { name: 'Manage', exact: true }).click();
|
|
await page
|
|
.getByRole('button', { name: 'Detach Storage Policy', exact: true })
|
|
.click();
|
|
await page.getByRole('button', { name: 'OK', exact: true }).click();
|
|
await expect(
|
|
page.getByRole('alert').getByText('Success', { exact: true }),
|
|
).toBeVisible();
|
|
await page.getByRole('button', { name: 'Dismiss' }).click();
|
|
|
|
// Navigate to orgs page when done
|
|
await page
|
|
.getByRole('navigation', { name: 'General' })
|
|
.getByRole('link', { name: 'Orgs' })
|
|
.click();
|
|
await expect(page.getByRole('heading', { name: 'Orgs' })).toBeVisible();
|
|
} finally {
|
|
if (policyName) {
|
|
await boundaryCli.authenticateBoundary(
|
|
baseURL,
|
|
adminAuthMethodId,
|
|
adminLoginName,
|
|
adminPassword,
|
|
);
|
|
const storagePolicyId = await boundaryCli.getPolicyIdFromName(
|
|
'global',
|
|
policyName,
|
|
);
|
|
await boundaryCli.deletePolicy(storagePolicyId);
|
|
}
|
|
}
|
|
});
|