Skip to content

Commit 8b7505c

Browse files
authored
Test pvc describe (#2042)
Delete test tenants after tests are done Add test for new describe Pod section
1 parent b420ef3 commit 8b7505c

File tree

5 files changed

+58
-16
lines changed

5 files changed

+58
-16
lines changed

portal-ui/src/screens/Console/Tenants/TenantDetails/pods/PodDescribe.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -478,13 +478,13 @@ const PodDescribe = ({
478478
variant="scrollable"
479479
scrollButtons="auto"
480480
>
481-
<Tab id="pod-describe-summary"label="Summary" />
482-
<Tab id="pod-describe-annotations"label="Annotations" />
483-
<Tab id="pod-describe-labels"label="Labels" />
484-
<Tab id="pod-describe-conditions"label="Conditions" />
485-
<Tab id="pod-describe-tolerations"label="Tolerations" />
486-
<Tab id="pod-describe-volumes"label="Volumes" />
487-
<Tab id="pod-describe-containers"label="Containers" />
481+
<Tab id="pod-describe-summary" label="Summary" />
482+
<Tab id="pod-describe-annotations" label="Annotations" />
483+
<Tab id="pod-describe-labels" label=" Labels" />
484+
<Tab id="pod-describe-conditions" label="Conditions" />
485+
<Tab id="pod-describe-tolerations" label="Tolerations" />
486+
<Tab id="pod-describe-volumes" label="Volumes" />
487+
<Tab id="pod-describe-containers" label="Containers" />
488488
</Tabs>
489489
{renderTabComponent(curTab, describeInfo)}
490490
</Grid>

portal-ui/src/screens/Console/Tenants/TenantDetails/pvcs/PVCDescribe.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ const PVCDescribe = ({
183183
aria-label="cluster-tabs"
184184
variant="scrollable"
185185
scrollButtons="auto">
186-
<Tab label="Summary" />
187-
<Tab label="Annotations" />
188-
<Tab label="Labels" />
186+
<Tab id="pvc-describe-summary" label="Summary" />
187+
<Tab id="pvc-describe-annotations" label="Annotations" />
188+
<Tab id="pvc-describe-labels" label="Labels" />
189189
</Tabs>
190190
{renderTabComponent(curTab, describeInfo)}
191191
</Grid>)}

portal-ui/src/screens/Console/Tenants/TenantDetails/pvcs/TenantVolumes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const TenantVolumes = ({ classes, match }: IPVCDetailsProps) => {
106106
scrollButtons="auto">
107107

108108
<Tab label="Events" id="simple-tab-0"/>
109-
<Tab label="Describe" id="simple-tab-0"/>
109+
<Tab label="Describe" id="simple-tab-1"/>
110110
</Tabs>
111111
</Grid>
112112
{curTab === 0 && (

portal-ui/tests/operator/tenants.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ import {
2222
deleteTenant,
2323
redirectToTenantsList,
2424
goToPodInTenant,
25-
goToPodSection
25+
goToPodSection,
26+
goToPvcInTenant,
27+
goToPvcSection
2628
} from './utils';
2729

2830
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) => {
4648
const tenantName = `tenant-${Math.floor(Math.random() * 10000)}`;
4749
await loginToOperator();
4850
await createTenant(tenantName);
49-
await t.wait(15000) // wait for PODs to be created
51+
await t.wait(20000) // wait for PODs to be created
5052
await testPODDescribe(tenantName);
5153
await redirectToTenantsList();
5254
await deleteTenant(tenantName);
@@ -55,10 +57,10 @@ test("Test describe section for PODs in new tenant", async (t) => {
5557
const testPODDescribe = async (tenantName: string) => {
5658
await goToPodInTenant(tenantName);
5759
await goToPodSection(1);
58-
await checkPVCSDescribeHasSections();
60+
await checkPodDescribeHasSections();
5961
}
6062

61-
const checkPVCSDescribeHasSections = async () => {
63+
const checkPodDescribeHasSections = async () => {
6264
await t
6365
.expect(Selector("#pod-describe-summary").exists).ok()
6466
.expect(Selector("#pod-describe-annotations").exists).ok()
@@ -68,3 +70,26 @@ const checkPVCSDescribeHasSections = async () => {
6870
.expect(Selector("#pod-describe-volumes").exists).ok()
6971
.expect(Selector("#pod-describe-containers").exists).ok();
7072
}
73+
74+
test("Test describe section for PVCs in new tenant", async (t) => {
75+
const tenantName = `tenant-${Math.floor(Math.random() * 10000)}`;
76+
await loginToOperator();
77+
await createTenant(tenantName);
78+
await t.wait(20000) // wait for PVCs to be created
79+
await testPvcDescribe(tenantName);
80+
await redirectToTenantsList();
81+
await deleteTenant(tenantName);
82+
});
83+
84+
const testPvcDescribe = async (tenantName: string) => {
85+
await goToPvcInTenant(tenantName);
86+
await goToPvcSection(1);
87+
await checkPvcDescribeHasSections();
88+
}
89+
90+
const checkPvcDescribeHasSections = async () => {
91+
await t
92+
.expect(Selector("#pvc-describe-summary").exists).ok()
93+
.expect(Selector("#pvc-describe-annotations").exists).ok()
94+
.expect(Selector("#pvc-describe-labels").exists).ok()
95+
}

portal-ui/tests/operator/utils.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const goToVolumesInTenant = async (tenantName: string) => {
8080

8181
export const goToPodsInTenant = async (tenantName: string) => {
8282
await t.click(`#list-tenant-${tenantName}`);
83-
await t.click(Selector(`a[href$="/pods"]`))
83+
await t.click(Selector(`a[href$="/pods"]`));
8484
}
8585

8686
export const goToPodInTenant = async (tenantName: string) => {
@@ -95,6 +95,23 @@ export const goToPodSection = async (index: number) => {
9595
.click(Selector(`#simple-tab-${index}`));
9696
}
9797

98+
export const goToPvcsInTenant = async (tenantName: string) => {
99+
await t.click(`#list-tenant-${tenantName}`);
100+
await t.click(Selector(`a[href$="/volumes"]`));
101+
}
102+
103+
export const goToPvcInTenant = async (tenantName: string) => {
104+
await goToPvcsInTenant(tenantName);
105+
await t.click(Selector("div.ReactVirtualized__Table__row").child(0));
106+
}
107+
108+
export const goToPvcSection = async (index: number) => {
109+
await t
110+
.expect(Selector(`#simple-tab-${index}`).exists)
111+
.ok()
112+
.click(Selector(`#simple-tab-${index}`));
113+
}
114+
98115
export const redirectToTenantsList = async () => {
99116
await redirectToPath(`${host}/tenants`);
100117
}

0 commit comments

Comments
 (0)