Fixes for Permission tests (#2351)
Updates location of Policies screen, adds required policies to testing profiles Authored-by: Jillian Inapurapu <jillii@Jillians-MBP.attlocal.net>
This commit is contained in:
@@ -128,6 +128,8 @@ export const IAM_PAGES = {
|
||||
ACCOUNT: "/identity/account",
|
||||
ACCOUNT_ADD: "/identity/account/new-account",
|
||||
USER_SA_ACCOUNT_ADD: "/identity/users/new-user-sa/:userName",
|
||||
|
||||
/* Access */
|
||||
POLICIES: "/identity/policies",
|
||||
POLICY_ADD: "/identity/add-policy",
|
||||
POLICIES_VIEW: "/identity/policies/*",
|
||||
|
||||
@@ -50,22 +50,32 @@ fixture("For user with Groups permissions")
|
||||
await t.useRole(roles.groups);
|
||||
});
|
||||
|
||||
test("Create Group button exists", async (t) => {
|
||||
const createGroupButtonExists = elements.createGroupButton.exists;
|
||||
await t
|
||||
.navigateTo(groupsPageUrl)
|
||||
.expect(createGroupButtonExists)
|
||||
.ok()
|
||||
.wait(2000);
|
||||
});
|
||||
|
||||
test("Groups sidebar item exists", async (t) => {
|
||||
await t
|
||||
.expect(identityElement.exists)
|
||||
.ok()
|
||||
.click(identityElement)
|
||||
.expect(groupsElement.exists)
|
||||
.ok();
|
||||
});
|
||||
|
||||
test("Create Group button exists", async (t) => {
|
||||
const createGroupButtonExists = elements.createGroupButton.exists;
|
||||
await t.navigateTo(groupsPageUrl).expect(createGroupButtonExists).ok();
|
||||
.ok()
|
||||
.wait(2000);
|
||||
});
|
||||
|
||||
test("Create Group button is clickable", async (t) => {
|
||||
await t.navigateTo(groupsPageUrl).click(elements.createGroupButton);
|
||||
await t
|
||||
.navigateTo(groupsPageUrl)
|
||||
.click(elements.createGroupButton)
|
||||
.expect(true)
|
||||
.ok()
|
||||
.wait(2000);
|
||||
});
|
||||
|
||||
test("Group Name input exists in the Create Group page", async (t) => {
|
||||
@@ -73,7 +83,8 @@ test("Group Name input exists in the Create Group page", async (t) => {
|
||||
.navigateTo(groupsPageUrl)
|
||||
.click(elements.createGroupButton)
|
||||
.expect(elements.groupNameInput.exists)
|
||||
.ok();
|
||||
.ok()
|
||||
.wait(2000);
|
||||
});
|
||||
|
||||
test("Users table exists in the Create Groups page", async (t) => {
|
||||
@@ -82,7 +93,8 @@ test("Users table exists in the Create Groups page", async (t) => {
|
||||
.navigateTo(groupsPageUrl)
|
||||
.click(elements.createGroupButton)
|
||||
.expect(createGroupUserTableExists)
|
||||
.ok();
|
||||
.ok()
|
||||
.wait(2000);
|
||||
});
|
||||
|
||||
test.before(async (t) => {
|
||||
@@ -97,7 +109,8 @@ test.before(async (t) => {
|
||||
.typeText(elements.groupNameInput, constants.TEST_GROUP_NAME)
|
||||
.typeText(elements.filterUserInput, constants.TEST_USER_NAME)
|
||||
.click(elements.groupUserCheckbox)
|
||||
.click(elements.saveButton);
|
||||
.click(elements.saveButton)
|
||||
.wait(2000);
|
||||
});
|
||||
|
||||
test.before(async (t) => {
|
||||
@@ -105,7 +118,11 @@ test.before(async (t) => {
|
||||
await functions.createUser(t);
|
||||
await createGroup(t, "groups-table");
|
||||
})("Groups table exists", async (t) => {
|
||||
await t.navigateTo(groupsPageUrl).expect(elements.table.exists).ok();
|
||||
await t
|
||||
.navigateTo(groupsPageUrl)
|
||||
.expect(elements.table.exists)
|
||||
.ok()
|
||||
.wait(2000);
|
||||
});
|
||||
|
||||
test.before(async (t) => {
|
||||
|
||||
@@ -52,21 +52,21 @@ test("IAM Policies sidebar item exists", async (t) => {
|
||||
test("Create Policy button exists", async (t) => {
|
||||
const createPolicyButtonExists = elements.createPolicyButton.exists;
|
||||
await t
|
||||
.navigateTo("http://localhost:9090/access/policies")
|
||||
.navigateTo("http://localhost:9090/identity/policies")
|
||||
.expect(createPolicyButtonExists)
|
||||
.ok();
|
||||
});
|
||||
|
||||
test("Create Policy button is clickable", async (t) => {
|
||||
await t
|
||||
.navigateTo("http://localhost:9090/access/policies")
|
||||
.navigateTo("http://localhost:9090/identity/policies")
|
||||
.click(elements.createPolicyButton);
|
||||
});
|
||||
|
||||
test("Policy Name input exists in the Create Policy modal", async (t) => {
|
||||
const policyNameInputExists = elements.createPolicyName.exists;
|
||||
await t
|
||||
.navigateTo("http://localhost:9090/access/policies")
|
||||
.navigateTo("http://localhost:9090/identity/policies")
|
||||
.click(elements.createPolicyButton)
|
||||
.expect(policyNameInputExists)
|
||||
.ok();
|
||||
@@ -75,7 +75,7 @@ test("Policy Name input exists in the Create Policy modal", async (t) => {
|
||||
test("Policy textfield exists in the Create Policy modal", async (t) => {
|
||||
const policyTextfieldExists = elements.createPolicyTextfield.exists;
|
||||
await t
|
||||
.navigateTo("http://localhost:9090/access/policies")
|
||||
.navigateTo("http://localhost:9090/identity/policies")
|
||||
.click(elements.createPolicyButton)
|
||||
.expect(policyTextfieldExists)
|
||||
.ok();
|
||||
@@ -83,7 +83,7 @@ test("Policy textfield exists in the Create Policy modal", async (t) => {
|
||||
|
||||
test("Create Policy modal can be submitted after inputs are entered", async (t) => {
|
||||
await t
|
||||
.navigateTo("http://localhost:9090/access/policies")
|
||||
.navigateTo("http://localhost:9090/identity/policies")
|
||||
.click(elements.createPolicyButton)
|
||||
.typeText(elements.createPolicyName, constants.TEST_IAM_POLICY_NAME)
|
||||
.typeText(elements.createPolicyTextfield, constants.TEST_IAM_POLICY, {
|
||||
@@ -94,7 +94,7 @@ test("Create Policy modal can be submitted after inputs are entered", async (t)
|
||||
}).after(async (t) => {
|
||||
// Clean up created policy
|
||||
await t
|
||||
.navigateTo("http://localhost:9090/access/policies")
|
||||
.navigateTo("http://localhost:9090/identity/policies")
|
||||
.typeText(elements.searchResourceInput, constants.TEST_IAM_POLICY_NAME)
|
||||
.click(iamPolicyDelete)
|
||||
.click(elements.deleteButton);
|
||||
@@ -103,7 +103,7 @@ test("Create Policy modal can be submitted after inputs are entered", async (t)
|
||||
test("Created Policy can be viewed and deleted", async (t) => {
|
||||
const iamPolicyListItemExists = iamPolicyListItem.exists;
|
||||
await t
|
||||
.navigateTo("http://localhost:9090/access/policies")
|
||||
.navigateTo("http://localhost:9090/identity/policies")
|
||||
.click(elements.createPolicyButton)
|
||||
.typeText(elements.createPolicyName, constants.TEST_IAM_POLICY_NAME)
|
||||
.typeText(elements.createPolicyTextfield, constants.TEST_IAM_POLICY, {
|
||||
|
||||
@@ -10,7 +10,10 @@
|
||||
"admin:EnableUser",
|
||||
"admin:DisableUser",
|
||||
"admin:ListUserPolicies",
|
||||
"admin:ListGroups"
|
||||
"admin:ListGroups",
|
||||
"admin:AttachUserOrGroupPolicy",
|
||||
"admin:RemoveUserFromGroup",
|
||||
"admin:AddUserToGroup"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": ["arn:aws:s3:::*"],
|
||||
|
||||
Reference in New Issue
Block a user