Test pvc describe (#2042)

Delete test tenants after tests are done
Add test for new describe Pod section
This commit is contained in:
Javier Adriel
2022-05-26 15:11:19 -05:00
committed by GitHub
parent b420ef3c1f
commit 8b7505c466
5 changed files with 58 additions and 16 deletions

View File

@@ -478,13 +478,13 @@ const PodDescribe = ({
variant="scrollable"
scrollButtons="auto"
>
<Tab id="pod-describe-summary"label="Summary" />
<Tab id="pod-describe-annotations"label="Annotations" />
<Tab id="pod-describe-labels"label="Labels" />
<Tab id="pod-describe-conditions"label="Conditions" />
<Tab id="pod-describe-tolerations"label="Tolerations" />
<Tab id="pod-describe-volumes"label="Volumes" />
<Tab id="pod-describe-containers"label="Containers" />
<Tab id="pod-describe-summary" label="Summary" />
<Tab id="pod-describe-annotations" label="Annotations" />
<Tab id="pod-describe-labels" label=" Labels" />
<Tab id="pod-describe-conditions" label="Conditions" />
<Tab id="pod-describe-tolerations" label="Tolerations" />
<Tab id="pod-describe-volumes" label="Volumes" />
<Tab id="pod-describe-containers" label="Containers" />
</Tabs>
{renderTabComponent(curTab, describeInfo)}
</Grid>

View File

@@ -183,9 +183,9 @@ const PVCDescribe = ({
aria-label="cluster-tabs"
variant="scrollable"
scrollButtons="auto">
<Tab label="Summary" />
<Tab label="Annotations" />
<Tab label="Labels" />
<Tab id="pvc-describe-summary" label="Summary" />
<Tab id="pvc-describe-annotations" label="Annotations" />
<Tab id="pvc-describe-labels" label="Labels" />
</Tabs>
{renderTabComponent(curTab, describeInfo)}
</Grid>)}

View File

@@ -106,7 +106,7 @@ const TenantVolumes = ({ classes, match }: IPVCDetailsProps) => {
scrollButtons="auto">
<Tab label="Events" id="simple-tab-0"/>
<Tab label="Describe" id="simple-tab-0"/>
<Tab label="Describe" id="simple-tab-1"/>
</Tabs>
</Grid>
{curTab === 0 && (

View File

@@ -22,7 +22,9 @@ import {
deleteTenant,
redirectToTenantsList,
goToPodInTenant,
goToPodSection
goToPodSection,
goToPvcInTenant,
goToPvcSection
} from './utils';
fixture("For user with default permissions").page("http://localhost:9090");
@@ -46,7 +48,7 @@ test("Test describe section for PODs in new tenant", async (t) => {
const tenantName = `tenant-${Math.floor(Math.random() * 10000)}`;
await loginToOperator();
await createTenant(tenantName);
await t.wait(15000) // wait for PODs to be created
await t.wait(20000) // wait for PODs to be created
await testPODDescribe(tenantName);
await redirectToTenantsList();
await deleteTenant(tenantName);
@@ -55,10 +57,10 @@ test("Test describe section for PODs in new tenant", async (t) => {
const testPODDescribe = async (tenantName: string) => {
await goToPodInTenant(tenantName);
await goToPodSection(1);
await checkPVCSDescribeHasSections();
await checkPodDescribeHasSections();
}
const checkPVCSDescribeHasSections = async () => {
const checkPodDescribeHasSections = async () => {
await t
.expect(Selector("#pod-describe-summary").exists).ok()
.expect(Selector("#pod-describe-annotations").exists).ok()
@@ -68,3 +70,26 @@ const checkPVCSDescribeHasSections = async () => {
.expect(Selector("#pod-describe-volumes").exists).ok()
.expect(Selector("#pod-describe-containers").exists).ok();
}
test("Test describe section for PVCs in new tenant", async (t) => {
const tenantName = `tenant-${Math.floor(Math.random() * 10000)}`;
await loginToOperator();
await createTenant(tenantName);
await t.wait(20000) // wait for PVCs to be created
await testPvcDescribe(tenantName);
await redirectToTenantsList();
await deleteTenant(tenantName);
});
const testPvcDescribe = async (tenantName: string) => {
await goToPvcInTenant(tenantName);
await goToPvcSection(1);
await checkPvcDescribeHasSections();
}
const checkPvcDescribeHasSections = async () => {
await t
.expect(Selector("#pvc-describe-summary").exists).ok()
.expect(Selector("#pvc-describe-annotations").exists).ok()
.expect(Selector("#pvc-describe-labels").exists).ok()
}

View File

@@ -80,7 +80,7 @@ export const goToVolumesInTenant = async (tenantName: string) => {
export const goToPodsInTenant = async (tenantName: string) => {
await t.click(`#list-tenant-${tenantName}`);
await t.click(Selector(`a[href$="/pods"]`))
await t.click(Selector(`a[href$="/pods"]`));
}
export const goToPodInTenant = async (tenantName: string) => {
@@ -95,6 +95,23 @@ export const goToPodSection = async (index: number) => {
.click(Selector(`#simple-tab-${index}`));
}
export const goToPvcsInTenant = async (tenantName: string) => {
await t.click(`#list-tenant-${tenantName}`);
await t.click(Selector(`a[href$="/volumes"]`));
}
export const goToPvcInTenant = async (tenantName: string) => {
await goToPvcsInTenant(tenantName);
await t.click(Selector("div.ReactVirtualized__Table__row").child(0));
}
export const goToPvcSection = async (index: number) => {
await t
.expect(Selector(`#simple-tab-${index}`).exists)
.ok()
.click(Selector(`#simple-tab-${index}`));
}
export const redirectToTenantsList = async () => {
await redirectToPath(`${host}/tenants`);
}