@@ -106,6 +106,15 @@ describe('Kubernetes resource CRUD operations', () => {
106
106
'BuildConfig' ,
107
107
] ) ;
108
108
109
+ const dataViewResources = new Set ( [
110
+ 'HorizontalPodAutoscaler' ,
111
+ 'Job' ,
112
+ 'Pod' ,
113
+ 'ReplicaSet' ,
114
+ 'ReplicationController' ,
115
+ 'StatefulSet' ,
116
+ ] ) ;
117
+
109
118
testObjs . forEach ( ( testObj , resource ) => {
110
119
const {
111
120
kind,
@@ -120,6 +129,7 @@ describe('Kubernetes resource CRUD operations', () => {
120
129
}
121
130
describe ( kind , ( ) => {
122
131
const name = `${ testName } -${ _ . kebabCase ( kind ) } ` ;
132
+ const isDataViewResource = dataViewResources . has ( kind ) ;
123
133
124
134
it ( `creates the resource instance` , ( ) => {
125
135
cy . visit (
@@ -189,6 +199,8 @@ describe('Kubernetes resource CRUD operations', () => {
189
199
cy . byTestID ( 'yaml-error' ) . should ( 'not.exist' ) ;
190
200
} ) ;
191
201
} ) ;
202
+ detailsPage . isLoaded ( ) ;
203
+ detailsPage . titleShouldContain ( name ) ;
192
204
} ) ;
193
205
194
206
it ( 'displays detail view for newly created resource instance' , ( ) => {
@@ -215,7 +227,11 @@ describe('Kubernetes resource CRUD operations', () => {
215
227
// should not have a namespace dropdown for non-namespaced objects');
216
228
projectDropdown . shouldNotExist ( ) ;
217
229
}
218
- listPage . rows . shouldBeLoaded ( ) ;
230
+ if ( isDataViewResource ) {
231
+ listPage . dvRows . shouldBeLoaded ( ) ;
232
+ } else {
233
+ listPage . rows . shouldBeLoaded ( ) ;
234
+ }
219
235
cy . testA11y ( `List page for ${ kind } : ${ name } ` ) ;
220
236
cy . testI18n ( [ ListPageSelector . tableColumnHeaders ] , [ 'item-create' ] ) ;
221
237
} ) ;
@@ -227,7 +243,11 @@ describe('Kubernetes resource CRUD operations', () => {
227
243
} ?kind=${ kind } &q=${ testLabel } %3d${ testName } &name=${ name } `,
228
244
) ;
229
245
230
- listPage . rows . shouldExist ( name ) ;
246
+ if ( isDataViewResource ) {
247
+ listPage . dvRows . shouldExist ( name ) ;
248
+ } else {
249
+ listPage . rows . shouldExist ( name ) ;
250
+ }
231
251
cy . testA11y ( `Search page for ${ kind } : ${ name } ` ) ;
232
252
233
253
// link to to details page
@@ -242,7 +262,11 @@ describe('Kubernetes resource CRUD operations', () => {
242
262
namespaced ? `ns/${ testName } ` : 'all-namespaces'
243
263
} ?kind=${ kind } &q=${ testLabel } %3d${ testName } &name=${ name } `,
244
264
) ;
245
- listPage . rows . clickKebabAction ( name , editKind ( kind , humanizeKind ) ) ;
265
+ if ( isDataViewResource ) {
266
+ listPage . dvRows . clickKebabAction ( name , editKind ( kind , humanizeKind ) ) ;
267
+ } else {
268
+ listPage . rows . clickKebabAction ( name , editKind ( kind , humanizeKind ) ) ;
269
+ }
246
270
if ( ! skipYamlReloadTest ) {
247
271
yamlEditor . isLoaded ( ) ;
248
272
yamlEditor . clickReloadButton ( ) ;
@@ -254,9 +278,15 @@ describe('Kubernetes resource CRUD operations', () => {
254
278
255
279
it ( `deletes the resource instance` , ( ) => {
256
280
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 ) ) ;
281
+ if ( isDataViewResource ) {
282
+ listPage . dvFilter . byName ( name ) ;
283
+ listPage . dvRows . countShouldBe ( 1 ) ;
284
+ listPage . dvRows . clickKebabAction ( name , deleteKind ( kind , humanizeKind ) ) ;
285
+ } else {
286
+ listPage . filter . byName ( name ) ;
287
+ listPage . rows . countShouldBe ( 1 ) ;
288
+ listPage . rows . clickKebabAction ( name , deleteKind ( kind , humanizeKind ) ) ;
289
+ }
260
290
modal . shouldBeOpened ( ) ;
261
291
modal . submit ( ) ;
262
292
modal . shouldBeClosed ( ) ;
0 commit comments