Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated failing UI tests in console #3236

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const UploadFilesButton = ({
open={uploadOptionsOpen}
anchorEl={anchorEl}
anchorOrigin={"end"}
useAnchorWidth={false}
useAnchorWidth
/>
</Fragment>
);
Expand Down
24 changes: 20 additions & 4 deletions web-app/tests/permissions-B/bucketWritePrefixOnly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,17 @@ test
.useRole(roles.bucketWritePrefixOnly)
.navigateTo("http://localhost:9090/browser/testcafe")
.click(uploadButton)
.expect(Selector("li").withText("Upload File").hasClass("disabled"))
.expect(
Selector("div")
.withAttribute("label", "Upload File")
.hasClass("disabled"),
)
.ok()
.expect(Selector("li").withText("Upload Folder").hasClass("disabled"))
.expect(
Selector("div")
.withAttribute("label", "Upload Folder")
.hasClass("disabled"),
)
.notOk();
},
)
Expand All @@ -48,9 +56,17 @@ test
.useRole(roles.bucketWritePrefixOnly)
.navigateTo("http://localhost:9090/browser/testcafe/d3JpdGU=")
.click(uploadButton)
.expect(Selector("li").withText("Upload File").hasClass("disabled"))
.expect(
Selector("div")
.withAttribute("label", "Upload File")
.hasClass("disabled"),
)
.notOk()
.expect(Selector("li").withText("Upload Folder").hasClass("disabled"))
.expect(
Selector("div")
.withAttribute("label", "Upload Folder")
.hasClass("disabled"),
)
.notOk();
},
)
Expand Down
17 changes: 13 additions & 4 deletions web-app/tests/utils/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,18 @@ export const deleteAllVersions =
export const bucketNameInput = Selector("#bucket-name-select");
export const bucketsPrefixInput = Selector("#prefix");
export const bucketsAccessInput = Selector("div.selectContainer");
export const bucketsAccessReadOnlyInput = Selector("li").withText("readonly");
export const bucketsAccessWriteOnlyInput = Selector("li").withText("writeonly");
export const bucketsAccessReadWriteInput = Selector("li").withText("readwrite");
export const bucketsAccessReadOnlyInput = Selector("div").withAttribute(
"label",
"readonly",
);
export const bucketsAccessWriteOnlyInput = Selector("div").withAttribute(
"label",
"writeonly",
);
export const bucketsAccessReadWriteInput = Selector("div").withAttribute(
"label",
"readwrite",
);
export const uploadInput = Selector("input").withAttribute("type", "file");
export const createPolicyName = Selector("#policy-name");
export const createPolicyTextfield = Selector(".w-tc-editor-text");
Expand All @@ -86,7 +95,7 @@ export const groupUserCheckbox = Selector(".ReactVirtualized__Table__row input")
// Dropdowns and options
//----------------------------------------------------
export const bucketDropdownOptionFor = (modifier) => {
return Selector("#bucket-name-options-selector li").withText(
return Selector("#bucket-name-options-selector div").withText(
`${constants.TEST_BUCKET_NAME}-${modifier}`,
);
};
Expand Down
Loading