Added Testcafe test for Audit Logging text fields (#2173)
Added Testcafe test for Audit Logging text fields, fixed bug in setting serviceAccount
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
goToPvcInTenant,
|
||||
goToPvcSection,
|
||||
checkMonitoringFieldsAcceptValues,
|
||||
checkLoggingFieldsAcceptValues,
|
||||
} from "./utils";
|
||||
|
||||
fixture("For user with default permissions").page("http://localhost:9090");
|
||||
@@ -101,3 +102,9 @@ test("Test Prometheus config fields can be edited and submitted", async (t) => {
|
||||
await loginToOperator();
|
||||
await checkMonitoringFieldsAcceptValues(tenantName);
|
||||
});
|
||||
|
||||
test("Test Audit Log config fields can be edited and submitted", async (t) => {
|
||||
const tenantName = `storage-lite`;
|
||||
await loginToOperator();
|
||||
await checkLoggingFieldsAcceptValues(tenantName);
|
||||
});
|
||||
|
||||
@@ -115,6 +115,10 @@ export const goToMonitoringSection = async (tenantName: string) => {
|
||||
await t.click(`#list-tenant-${tenantName}`).wait(2000);
|
||||
await t.click(Selector(`a[href$="/monitoring"]`));
|
||||
};
|
||||
export const goToLoggingSection = async (tenantName: string) => {
|
||||
await t.click(`#list-tenant-${tenantName}`).wait(2000);
|
||||
await t.click(Selector(`a[href$="/logging"]`));
|
||||
};
|
||||
|
||||
export const redirectToTenantsList = async () => {
|
||||
await redirectToPath(`${host}/tenants`);
|
||||
@@ -189,3 +193,44 @@ export const checkMonitoringFieldsAcceptValues = async (tenantName: string) => {
|
||||
)
|
||||
.ok();
|
||||
};
|
||||
|
||||
export const checkLoggingFieldsAcceptValues = async (tenantName: string) => {
|
||||
await goToLoggingSection(tenantName);
|
||||
await t
|
||||
.typeText("#image", "minio/operator:v4.4.22", { replace: true })
|
||||
.typeText("#diskCapacityGB", "3", { replace: true })
|
||||
.typeText("#cpuRequest", "3", { replace: true })
|
||||
.typeText("#memRequest", "3", { replace: true })
|
||||
.typeText("#serviceAccountName", "loggingTestServiceAccountName", {
|
||||
replace: true,
|
||||
})
|
||||
.click("#submit_button")
|
||||
.click("#yaml_button")
|
||||
.expect(Selector("#code_wrapper").exists)
|
||||
.ok();
|
||||
await t
|
||||
.expect(
|
||||
(
|
||||
await Selector("#code_wrapper").textContent
|
||||
).includes("image: minio/operator:v4.4.22")
|
||||
)
|
||||
.ok()
|
||||
.expect(
|
||||
(
|
||||
await Selector("#code_wrapper").textContent
|
||||
).includes("diskCapacityGB: 3")
|
||||
)
|
||||
.ok()
|
||||
.expect((await Selector("#code_wrapper").textContent).includes('cpu: "3"'))
|
||||
.ok()
|
||||
.expect(
|
||||
(await Selector("#code_wrapper").textContent).includes('memory: "3"')
|
||||
)
|
||||
.ok()
|
||||
.expect(
|
||||
(
|
||||
await Selector("#code_wrapper").textContent
|
||||
).includes("serviceAccountName: loggingTestServiceAccountName")
|
||||
)
|
||||
.ok();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user