@@ -106,6 +106,8 @@ describe('Kubernetes resource CRUD operations', () => {
106
106
'BuildConfig' ,
107
107
] ) ;
108
108
109
+ const dataViewResources = new Set ( [ 'HorizontalPodAutoscaler' ] ) ;
110
+
109
111
testObjs . forEach ( ( testObj , resource ) => {
110
112
const {
111
113
kind,
@@ -120,6 +122,7 @@ describe('Kubernetes resource CRUD operations', () => {
120
122
}
121
123
describe ( kind , ( ) => {
122
124
const name = `${ testName } -${ _ . kebabCase ( kind ) } ` ;
125
+ const isDataViewResource = dataViewResources . has ( kind ) ;
123
126
124
127
it ( `creates the resource instance` , ( ) => {
125
128
cy . visit (
@@ -215,7 +218,11 @@ describe('Kubernetes resource CRUD operations', () => {
215
218
// should not have a namespace dropdown for non-namespaced objects');
216
219
projectDropdown . shouldNotExist ( ) ;
217
220
}
218
- listPage . rows . shouldBeLoaded ( ) ;
221
+ if ( isDataViewResource ) {
222
+ listPage . dvRows . shouldBeLoaded ( ) ;
223
+ } else {
224
+ listPage . rows . shouldBeLoaded ( ) ;
225
+ }
219
226
cy . testA11y ( `List page for ${ kind } : ${ name } ` ) ;
220
227
cy . testI18n ( [ ListPageSelector . tableColumnHeaders ] , [ 'item-create' ] ) ;
221
228
} ) ;
@@ -227,7 +234,11 @@ describe('Kubernetes resource CRUD operations', () => {
227
234
} ?kind=${ kind } &q=${ testLabel } %3d${ testName } &name=${ name } `,
228
235
) ;
229
236
230
- listPage . rows . shouldExist ( name ) ;
237
+ if ( isDataViewResource ) {
238
+ listPage . dvRows . shouldExist ( name ) ;
239
+ } else {
240
+ listPage . rows . shouldExist ( name ) ;
241
+ }
231
242
cy . testA11y ( `Search page for ${ kind } : ${ name } ` ) ;
232
243
233
244
// link to to details page
@@ -242,7 +253,11 @@ describe('Kubernetes resource CRUD operations', () => {
242
253
namespaced ? `ns/${ testName } ` : 'all-namespaces'
243
254
} ?kind=${ kind } &q=${ testLabel } %3d${ testName } &name=${ name } `,
244
255
) ;
245
- listPage . rows . clickKebabAction ( name , editKind ( kind , humanizeKind ) ) ;
256
+ if ( isDataViewResource ) {
257
+ listPage . dvRows . clickKebabAction ( name , editKind ( kind , humanizeKind ) ) ;
258
+ } else {
259
+ listPage . rows . clickKebabAction ( name , editKind ( kind , humanizeKind ) ) ;
260
+ }
246
261
if ( ! skipYamlReloadTest ) {
247
262
yamlEditor . isLoaded ( ) ;
248
263
yamlEditor . clickReloadButton ( ) ;
@@ -254,9 +269,15 @@ describe('Kubernetes resource CRUD operations', () => {
254
269
255
270
it ( `deletes the resource instance` , ( ) => {
256
271
cy . visit ( `${ namespaced ? `/k8s/ns/${ testName } ` : '/k8s/cluster' } /${ resource } ` ) ;
257
- listPage . filter . byName ( name ) ;
258
- listPage . rows . countShouldBe ( 1 ) ;
259
- listPage . rows . clickKebabAction ( name , deleteKind ( kind , humanizeKind ) ) ;
272
+ if ( isDataViewResource ) {
273
+ listPage . dvFilter . byName ( name ) ;
274
+ listPage . dvRows . countShouldBe ( name , 1 ) ;
275
+ listPage . dvRows . clickKebabAction ( name , deleteKind ( kind , humanizeKind ) ) ;
276
+ } else {
277
+ listPage . filter . byName ( name ) ;
278
+ listPage . rows . countShouldBe ( 1 ) ;
279
+ listPage . rows . clickKebabAction ( name , deleteKind ( kind , humanizeKind ) ) ;
280
+ }
260
281
modal . shouldBeOpened ( ) ;
261
282
modal . submit ( ) ;
262
283
modal . shouldBeClosed ( ) ;
0 commit comments