@@ -27,17 +27,20 @@ describe('Node-RED Dashboard 2.0 - Markdown', () => {
2727
2828 // this markdown node has a full mermaid chart defined on msg.payload
2929 it ( 'allow for full mermaid charts to be defined by msg' , ( ) => {
30+ // Mermaid renders asynchronously and can take longer than Cypress's 4s default on slower
31+ // or busy systems, so extend the timeout on the SVG-node assertions specifically.
32+ const MERMAID_TIMEOUT = 30000
3033 cy . clickAndWait ( cy . get ( '#nrdb-ui-widget-dashboard-ui-button-graph-E' ) )
31- cy . get ( '#nrdb-ui-widget-dashboard-ui-markdown-2' ) . find ( '.nodes .node' ) . should ( 'have.length' , 5 )
34+ cy . get ( '#nrdb-ui-widget-dashboard-ui-markdown-2' ) . find ( '.nodes .node' , { timeout : MERMAID_TIMEOUT } ) . should ( 'have.length' , 5 )
3235 cy . get ( '#nrdb-ui-widget-dashboard-ui-markdown-2' ) . find ( '.nodes .node' ) . eq ( 4 ) . should ( 'have.text' , 'E' )
3336
3437 cy . clickAndWait ( cy . get ( '#nrdb-ui-widget-dashboard-ui-button-graph-F' ) )
35- cy . get ( '#nrdb-ui-widget-dashboard-ui-markdown-2' ) . find ( '.nodes .node' ) . should ( 'have.length' , 5 )
38+ cy . get ( '#nrdb-ui-widget-dashboard-ui-markdown-2' ) . find ( '.nodes .node' , { timeout : MERMAID_TIMEOUT } ) . should ( 'have.length' , 5 )
3639 cy . get ( '#nrdb-ui-widget-dashboard-ui-markdown-2' ) . find ( '.nodes .node' ) . eq ( 4 ) . should ( 'have.text' , 'F' )
3740
3841 cy . reloadDashboard ( )
3942
40- cy . get ( '#nrdb-ui-widget-dashboard-ui-markdown-2' ) . find ( '.nodes .node' ) . should ( 'have.length' , 5 )
43+ cy . get ( '#nrdb-ui-widget-dashboard-ui-markdown-2' ) . find ( '.nodes .node' , { timeout : MERMAID_TIMEOUT } ) . should ( 'have.length' , 5 )
4144 cy . get ( '#nrdb-ui-widget-dashboard-ui-markdown-2' ) . find ( '.nodes .node' ) . eq ( 4 ) . should ( 'have.text' , 'F' )
4245 } )
4346} )
0 commit comments