User Assign Policy UI test (#2129)
This commit is contained in:
@@ -24,6 +24,9 @@ import { IAM_PAGES } from "../../src/common/SecureComponent/permissions";
|
||||
const userListItem = Selector(".ReactVirtualized__Table__rowColumn").withText(
|
||||
constants.TEST_USER_NAME
|
||||
);
|
||||
const policyListItem = Selector(".ReactVirtualized__Table__rowColumn").withText(
|
||||
constants.TEST_ASSIGN_POLICY_NAME
|
||||
);
|
||||
|
||||
const userDeleteIconButton = userListItem
|
||||
.child("checkbox")
|
||||
@@ -77,6 +80,24 @@ test("Users table exists", async (t) => {
|
||||
await t.navigateTo(usersPageUrl).expect(usersTableExists).ok();
|
||||
});
|
||||
|
||||
test("IAM Policy can be set on User", async (t) => {
|
||||
const userListItemExists = userListItem.exists;
|
||||
const policyListItemExists = policyListItem.exists;
|
||||
await t
|
||||
.navigateTo(usersPageUrl)
|
||||
.typeText(elements.searchResourceInput, constants.TEST_USER_NAME)
|
||||
.expect(userListItemExists)
|
||||
.ok()
|
||||
.click(userListItem)
|
||||
.click(elements.userPolicies)
|
||||
.click(elements.assignPoliciesButton)
|
||||
.typeText(elements.searchResourceInput, constants.TEST_ASSIGN_POLICY_NAME)
|
||||
.click(userCheckbox)
|
||||
.click(elements.saveButton)
|
||||
.expect(policyListItemExists)
|
||||
.ok();
|
||||
});
|
||||
|
||||
test("Created User can be viewed and deleted", async (t) => {
|
||||
const userListItemExists = userListItem.exists;
|
||||
const deleteSelectedButton =
|
||||
|
||||
@@ -39,3 +39,4 @@ export const TEST_IAM_POLICY = JSON.stringify({
|
||||
},
|
||||
],
|
||||
});
|
||||
export const TEST_ASSIGN_POLICY_NAME = "consoleAdmin";
|
||||
|
||||
@@ -69,7 +69,8 @@ export const startNewDiagnosticButton = Selector("#start-new-diagnostic");
|
||||
export const downloadButton = Selector("button:enabled").withText("Download");
|
||||
export const startButton = Selector("button:enabled").withText("Start");
|
||||
export const stopButton = Selector("button:enabled").withText("Stop");
|
||||
|
||||
export const assignPoliciesButton =
|
||||
Selector("button:enabled").withText("Assign Policies");
|
||||
//----------------------------------------------------
|
||||
// Links
|
||||
//----------------------------------------------------
|
||||
@@ -209,3 +210,7 @@ export const settingsAuditWebhookTab = Selector(".MuiTab-root").withAttribute(
|
||||
export const logWindow = Selector('[data-test-id="logs-list-container"]');
|
||||
//Node selector
|
||||
export const nodeSelector = Selector('[data-test-id="node-selector"]');
|
||||
//----------------------------------------------------
|
||||
// User Details
|
||||
//----------------------------------------------------
|
||||
export const userPolicies = Selector(".MuiTab-root").withText("Policies");
|
||||
|
||||
Reference in New Issue
Block a user