File tree Expand file tree Collapse file tree 4 files changed +45
-6
lines changed Expand file tree Collapse file tree 4 files changed +45
-6
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,29 @@ function archive_cypress_artifacts {
31
31
popd > /dev/null
32
32
}
33
33
34
+ function enable_dev_perspective() {
35
+ local ocpversion
36
+ ocpversion=" $( oc get clusterversion/version -o jsonpath=' {.status.desired.version}' ) "
37
+ if versions.lt " $ocpversion " ' 4.19.0' ; then
38
+ logger.info ' Dev Console is always enabled for OCP <4.19. Skipping the enablement.'
39
+ return
40
+ fi
41
+ local patch=' {"spec":{"customization":{"perspectives":[{"id":"dev","visibility":{"state":"Enabled"}}]}}}'
42
+
43
+ if LANG=C oc patch console.operator.openshift.io/cluster \
44
+ --type=' merge' \
45
+ --dry-run=' server' \
46
+ -p " $patch " | grep -q ' no change' ; then
47
+ logger.success ' Dev Perspective already enabled'
48
+ return
49
+ fi
50
+
51
+ oc patch console.operator.openshift.io/cluster \
52
+ --type=' merge' \
53
+ -p " $patch "
54
+ logger.success ' Dev Perspective enabled'
55
+ }
56
+
34
57
OCP_VERSION=" $( oc get clusterversion version -o jsonpath=' {.status.desired.version}' ) "
35
58
OCP_USERNAME=" ${OCP_USERNAME:- uitesting} "
36
59
OCP_PASSWORD=" ${OCP_PASSWORD:- $(echo " $OCP_USERNAME " | sha1sum - | awk ' {print $1}' )} "
@@ -51,6 +74,7 @@ export OCP_VERSION OCP_USERNAME OCP_PASSWORD OCP_LOGIN_PROVIDER CYPRESS_BASE_URL
51
74
52
75
add_user " $OCP_USERNAME " " $OCP_PASSWORD "
53
76
check_node
77
+ enable_dev_perspective
54
78
archive_cypress_artifacts
55
79
logger.success ' 🚀 Cluster prepared for testing.'
56
80
Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ class ShowcaseKservice {
24
24
*/
25
25
url ( ) {
26
26
if ( this . clusterLocal ) {
27
- let selector = '.overview__sidebar-pane .pf-v5-c-clipboard-copy input[type=text]'
27
+ let selector = '.overview__sidebar-pane .pf-v6-c-clipboard-copy input[type=text]'
28
+ if ( environment . ocpVersion ( ) . satisfies ( '<=4.18' ) ) {
29
+ selector = '.overview__sidebar-pane .pf-v5-c-clipboard-copy input[type=text]'
30
+ }
28
31
if ( environment . ocpVersion ( ) . satisfies ( '<=4.14' ) ) {
29
32
selector = '.overview__sidebar-pane .pf-c-clipboard-copy input[type=text]'
30
33
}
@@ -35,9 +38,6 @@ class ShowcaseKservice {
35
38
. and ( 'include' , 'showcase' )
36
39
}
37
40
let selector = '.co-external-link--block a'
38
- if ( environment . ocpVersion ( ) . satisfies ( '<=4.13' ) ) {
39
- selector = 'a.co-external-link'
40
- }
41
41
return cy . get ( selector )
42
42
. last ( )
43
43
. scrollIntoView ( )
Original file line number Diff line number Diff line change @@ -85,6 +85,18 @@ class OpenshiftConsole {
85
85
drawer : '.odc-topology .pf-c-drawer' ,
86
86
}
87
87
}
88
+ if ( environment . ocpVersion ( ) . satisfies ( '<=4.18' ) ) {
89
+ return {
90
+ /**
91
+ * @param drawer {JQuery<HTMLElement>}
92
+ * @returns {boolean }
93
+ */
94
+ checkIsOpen : function ( drawer ) {
95
+ return drawer . find ( '.pf-topology-resizable-side-bar' ) . length > 0
96
+ } ,
97
+ drawer : '.pf-v5-c-drawer__panel.ocs-sidebar-index' ,
98
+ }
99
+ }
88
100
return {
89
101
/**
90
102
* @param drawer {JQuery<HTMLElement>}
@@ -93,7 +105,7 @@ class OpenshiftConsole {
93
105
checkIsOpen : function ( drawer ) {
94
106
return drawer . find ( '.pf-topology-resizable-side-bar' ) . length > 0
95
107
} ,
96
- drawer : '.pf-v5 -c-drawer__panel.ocs-sidebar-index' ,
108
+ drawer : '.pf-v6 -c-drawer__panel.ocs-sidebar-index' ,
97
109
}
98
110
}
99
111
}
Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ describe('OCP UI for Serverless Serving', () => {
43
43
cy . get ( 'input[name="trafficSplitting.1.tag"]' )
44
44
. type ( 'v1' )
45
45
cy . contains ( 'Select a Revision' , { matchCase : false } ) . click ( )
46
- let selector = `ul.pf-v5-c-dropdown__menu button`
46
+ let selector = `.pf-v6-c-dropdown.pf-m-expanded .pf-v6-c-menu button`
47
+ if ( environment . ocpVersion ( ) . satisfies ( '<=4.18' ) ) {
48
+ selector = `ul.pf-v5-c-dropdown__menu button`
49
+ }
47
50
if ( environment . ocpVersion ( ) . satisfies ( '<=4.14' ) ) {
48
51
selector = `ul.pf-c-dropdown__menu button`
49
52
}
You can’t perform that action at this time.
0 commit comments