@@ -106,6 +106,14 @@ describe('Kubernetes resource CRUD operations', () => {
106
106
'BuildConfig' ,
107
107
] ) ;
108
108
109
+ const dataViewResources = new Set ( [
110
+ 'Job' ,
111
+ 'ReplicaSet' ,
112
+ 'HorizontalPodAutoscaler' ,
113
+ 'StatefulSet' ,
114
+ 'ReplicationController' ,
115
+ ] ) ;
116
+
109
117
testObjs . forEach ( ( testObj , resource ) => {
110
118
const {
111
119
kind,
@@ -120,6 +128,7 @@ describe('Kubernetes resource CRUD operations', () => {
120
128
}
121
129
describe ( kind , ( ) => {
122
130
const name = `${ testName } -${ _ . kebabCase ( kind ) } ` ;
131
+ const isDataViewResource = dataViewResources . has ( kind ) ;
123
132
124
133
it ( `creates the resource instance` , ( ) => {
125
134
cy . visit (
@@ -215,7 +224,11 @@ describe('Kubernetes resource CRUD operations', () => {
215
224
// should not have a namespace dropdown for non-namespaced objects');
216
225
projectDropdown . shouldNotExist ( ) ;
217
226
}
218
- listPage . rows . shouldBeLoaded ( ) ;
227
+ if ( isDataViewResource ) {
228
+ listPage . dvRows . shouldBeLoaded ( ) ;
229
+ } else {
230
+ listPage . rows . shouldBeLoaded ( ) ;
231
+ }
219
232
cy . testA11y ( `List page for ${ kind } : ${ name } ` ) ;
220
233
cy . testI18n ( [ ListPageSelector . tableColumnHeaders ] , [ 'item-create' ] ) ;
221
234
} ) ;
@@ -227,7 +240,11 @@ describe('Kubernetes resource CRUD operations', () => {
227
240
} ?kind=${ kind } &q=${ testLabel } %3d${ testName } &name=${ name } `,
228
241
) ;
229
242
230
- listPage . rows . shouldExist ( name ) ;
243
+ if ( isDataViewResource ) {
244
+ listPage . dvRows . shouldExist ( name ) ;
245
+ } else {
246
+ listPage . rows . shouldExist ( name ) ;
247
+ }
231
248
cy . testA11y ( `Search page for ${ kind } : ${ name } ` ) ;
232
249
233
250
// link to to details page
@@ -242,7 +259,11 @@ describe('Kubernetes resource CRUD operations', () => {
242
259
namespaced ? `ns/${ testName } ` : 'all-namespaces'
243
260
} ?kind=${ kind } &q=${ testLabel } %3d${ testName } &name=${ name } `,
244
261
) ;
245
- listPage . rows . clickKebabAction ( name , editKind ( kind , humanizeKind ) ) ;
262
+ if ( isDataViewResource ) {
263
+ listPage . dvRows . clickKebabAction ( name , editKind ( kind , humanizeKind ) ) ;
264
+ } else {
265
+ listPage . rows . clickKebabAction ( name , editKind ( kind , humanizeKind ) ) ;
266
+ }
246
267
if ( ! skipYamlReloadTest ) {
247
268
yamlEditor . isLoaded ( ) ;
248
269
yamlEditor . clickReloadButton ( ) ;
@@ -254,9 +275,15 @@ describe('Kubernetes resource CRUD operations', () => {
254
275
255
276
it ( `deletes the resource instance` , ( ) => {
256
277
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 ) ) ;
278
+ if ( isDataViewResource ) {
279
+ listPage . dvFilter . byName ( name ) ;
280
+ listPage . dvRows . countShouldBe ( 1 ) ;
281
+ listPage . dvRows . clickKebabAction ( name , deleteKind ( kind , humanizeKind ) ) ;
282
+ } else {
283
+ listPage . filter . byName ( name ) ;
284
+ listPage . rows . countShouldBe ( 1 ) ;
285
+ listPage . rows . clickKebabAction ( name , deleteKind ( kind , humanizeKind ) ) ;
286
+ }
260
287
modal . shouldBeOpened ( ) ;
261
288
modal . submit ( ) ;
262
289
modal . shouldBeClosed ( ) ;
0 commit comments