@@ -4,6 +4,7 @@ import { isLocalDevEnvironment } from '../../views/common';
44import { detailsPage } from '../../views/details-page' ;
55import { guidedTour } from '../../views/guided-tour' ;
66import { listPage } from '../../views/list-page' ;
7+ import { masthead } from '../../views/masthead' ;
78import { modal } from '../../views/modal' ;
89import { nav } from '../../views/nav' ;
910import { getEditorContent } from '../../views/yaml-editor' ;
@@ -185,6 +186,35 @@ if (!Cypress.env('OPENSHIFT_CI') || Cypress.env('PLUGIN_PULL_SPEC')) {
185186 apiIDs . forEach ( ( id ) => k8sAPINavTest ( id ) ) ;
186187 } ) ;
187188
189+ it ( 'add Dynamic Plugins to Cluster Overview Status card' , ( ) => {
190+ nav . sidenav . clickNavLink ( [ 'Home' , 'Overview' ] ) ;
191+ cy . get ( 'button[data-test="Dynamic Plugins"]' ) . click ( ) ;
192+ cy . contains ( 'Loaded plugins' ) . should ( 'exist' ) ;
193+ cy . get ( '.pf-v6-c-popover' ) . within ( ( ) => {
194+ cy . get ( 'a:contains(View all)' ) . should (
195+ 'have.attr' ,
196+ 'href' ,
197+ '/k8s/cluster/operator.openshift.io~v1~Console/cluster/console-plugins' ,
198+ ) ;
199+ } ) ;
200+ } ) ;
201+
202+ it ( 'add Dynamic Plugins in About modal' , ( ) => {
203+ masthead . clickMastheadLink ( 'help-dropdown-toggle' ) ;
204+ cy . get ( 'span' ) . contains ( 'About' ) . click ( ) ;
205+ cy . get ( 'dt' ) . contains ( 'Dynamic plugins' ) . should ( 'exist' ) ;
206+ cy . contains ( 'console-demo-plugin (0.0.0)' ) . should ( 'exist' ) ;
207+ cy . get ( 'button[aria-label="Close Dialog"]' ) . click ( ) ;
208+ } ) ;
209+
210+ it ( 'add extension point to enable customized create project modal' , ( ) => {
211+ nav . sidenav . clickNavLink ( [ 'Home' , 'Projects' ] ) ;
212+ listPage . dvRows . shouldBeLoaded ( ) ;
213+ listPage . clickCreateYAMLbutton ( ) ;
214+ cy . get ( 'div' ) . contains ( 'This modal is created with an extension' ) . should ( 'exist' ) ;
215+ cy . byButtonText ( 'Cancel' ) . click ( ) ;
216+ } ) ;
217+
188218 it ( 'should display manifest tab in ConsolePlugin details page' , ( ) => {
189219 // Navigate to the demo plugin details page
190220 cy . visit ( `/k8s/cluster/console.openshift.io~v1~ConsolePlugin/${ PLUGIN_NAME } ` ) ;
@@ -241,6 +271,39 @@ if (!Cypress.env('OPENSHIFT_CI') || Cypress.env('PLUGIN_PULL_SPEC')) {
241271 }
242272 } ) ;
243273 } ) ;
274+
275+ it ( 'console plugin proxy should directly copy the plugin service proxy response status code' , ( ) => {
276+ if ( ! isLocalDevEnvironment ) {
277+ let pluginStatusCode ;
278+ cy . exec ( `oc -n console-demo-plugin create route passthrough --service console-demo-plugin` ) ;
279+ cy . exec (
280+ `oc get route console-demo-plugin -n console-demo-plugin -o jsonpath='{.spec.host}'` ,
281+ ) . then ( ( result ) => {
282+ const consoleDemoPluginHost = result . stdout ;
283+ cy . request ( `https://${ consoleDemoPluginHost } /plugin-manifest.json` ) . then ( ( resp ) => {
284+ pluginStatusCode = resp . status ;
285+ } ) ;
286+ } ) ;
287+ cy . request ( '/api/plugins/console-demo-plugin/plugin-manifest.json' ) . then ( ( resp ) => {
288+ expect ( resp . status ) . to . eq ( pluginStatusCode ) ;
289+ } ) ;
290+ }
291+ } ) ;
292+
293+ it ( 'allow disabling dynamic plugins through a query parameter' , ( ) => {
294+ // disable non-existing plugin will make no changes
295+ cy . visit ( '?disable-plugins=foo,bar' ) ;
296+ cy . byTestID ( 'nav' ) . as ( 'dynamic_nav' ) . should ( 'include.text' , 'Dynamic Nav' ) ;
297+
298+ // disable one plugin
299+ cy . visit ( '?disable-plugins=console-demo-plugin' ) ;
300+ cy . get ( '@dynamic_nav' ) . should ( 'not.have.text' , 'Dynamic Nav' ) ;
301+
302+ // disable all plugins
303+ cy . visit ( '?disable-plugins' ) ;
304+ cy . get ( '@dynamic_nav' ) . should ( 'not.have.text' , 'Dynamic Nav' ) ;
305+ cy . visit ( '/api-explorer' ) ;
306+ } ) ;
244307 } ) ;
245308} else {
246309 xdescribe ( 'Skipping demo dynamic plugin tests' , ( ) => {
0 commit comments