@@ -93,10 +93,13 @@ describe('Global templates', function() {
9393 cy . waitForCollabora ( )
9494 } )
9595
96- // FIXME: Unskip once server API for new menu entries works on public shares
97- // https://github.com/nextcloud/richdocuments/issues/3170
98- it . skip ( 'Create a file from a system template as guest' , ( ) => {
99- cy . uploadSystemTemplate ( )
96+ it ( 'Create a file from a system template as guest' , ( ) => {
97+ cy . uploadSystemTemplate ( {
98+ fixturePath : 'templates/presentation.otp' ,
99+ fileName : 'myslides.otp' ,
100+ mimeType : 'application/vnd.oasis.opendocument.presentation-template' ,
101+ } )
102+
100103 cy . createFolder ( randUser , '/my-share' )
101104
102105 cy . shareLink ( randUser , '/my-share' , { permissions : 31 } ) . then ( ( token ) => {
@@ -110,25 +113,22 @@ describe('Global templates', function() {
110113 . should ( 'be.visible' )
111114 . click ( )
112115
113- cy . get ( '.newFileMenu' , { timeout : 10000 } )
116+ cy . get ( 'button[role="menuitem"]' )
117+ . contains ( 'New presentation' )
114118 . should ( 'be.visible' )
115- . contains ( '.menuitem' , 'New presentation' )
116- . as ( 'menuitem' )
119+ . click ( )
120+ cy . get ( '.input-field__input' )
121+ . type ( 'FileFromTemplate' )
122+ cy . get ( '.template:contains("myslides")' )
123+ . scrollIntoView ( )
117124 . should ( 'be.visible' )
118125 . click ( )
119126
120- cy . get ( '@menuitem' ) . find ( '.filenameform input[type=text]' ) . type ( 'FileFromTemplate' )
121- cy . get ( '@menuitem' ) . find ( '.filenameform .icon-confirm' ) . click ( )
122-
123- cy . get ( '#template-picker' )
124- . as ( 'form' )
125- . should ( 'be.visible' )
126- . contains ( 'h2' , 'systemtemplate' )
127+ cy . get ( 'button:contains("Create")' )
128+ . scrollIntoView ( )
127129 . should ( 'be.visible' )
128130 . click ( )
129131
130- cy . get ( '.oc-dialog' ) . find ( 'button.primary' ) . click ( )
131-
132132 cy . waitForViewer ( )
133133 cy . waitForCollabora ( )
134134 } )
0 commit comments