22 * SPDX-FileCopyrightText: 2023 Julius Härtl <[email protected] > 33 * SPDX-License-Identifier: AGPL-3.0-or-later
44 */
5- // FIXME: Re-renable once 28 has file creation again working
6- describe . skip ( 'Create new office files ', function ( ) {
5+
6+ describe ( 'New file menu ', function ( ) {
77
88 let randUser
99 before ( function ( ) {
@@ -18,51 +18,34 @@ describe.skip('Create new office files', function() {
1818 } )
1919
2020 it ( 'Shows create file entries' , function ( ) {
21- cy . get ( '.files-controls .button.new ' )
21+ cy . get ( 'form[data-cy-upload-picker=""] ' )
2222 . should ( 'be.visible' )
2323 . click ( )
2424
25- cy . get ( '.newFileMenu' , { timeout : 10000 } )
26- . should ( 'be.visible' )
27- . contains ( '.menuitem' , 'New document' )
25+ cy . get ( 'button[role="menuitem"]' )
26+ . contains ( 'New document' )
2827 . should ( 'be.visible' )
29- . find ( '.icon' )
30- . should ( 'have.css' , 'background-image' )
3128
32- cy . get ( '.files-controls .button.new ' )
29+ cy . get ( 'form[data-cy-upload-picker=""] ' )
3330 . click ( )
3431
35- cy . get ( '.newFileMenu' , { timeout : 10000 } )
32+ cy . get ( 'li[data-cy-upload-picker-menu-entry="upload-file"]' )
3633 . should ( 'not.be.visible' )
3734 } )
3835
39- const newFileTypeLabels = [
40- 'document' , 'spreadsheet' , 'presentation' , 'diagram' ,
41- ]
42- newFileTypeLabels . forEach ( ( filetype ) => {
43- it ( 'Create empty ' + filetype + ' file' , function ( ) {
44- cy . get ( '.files-controls .button.new' )
45- . should ( 'be.visible' )
46- . click ( )
47-
48- cy . get ( '.newFileMenu' , { timeout : 10000 } )
49- . should ( 'be.visible' )
50- . contains ( '.menuitem' , 'New ' + filetype )
51- . as ( 'menuitem' )
52- . should ( 'be.visible' )
53- . click ( )
54-
55- cy . get ( '@menuitem' ) . find ( '.filenameform input[type=text]' ) . type ( 'MyNewFile' )
56- cy . get ( '@menuitem' ) . find ( '.filenameform .icon-confirm' ) . click ( )
57-
58- cy . waitForViewer ( )
59- cy . waitForCollabora ( )
36+ describe ( 'Creates a new file' , function ( ) {
37+ const newFileTypeLabels = [
38+ 'document' , 'spreadsheet' , 'presentation' , 'diagram' ,
39+ ]
40+ newFileTypeLabels . forEach ( ( filetype ) => {
41+ it ( 'Create empty ' + filetype + ' file' , function ( ) {
42+ cy . newFileFromMenu ( filetype , 'MyNewFile' )
43+ cy . waitForViewer ( )
44+ cy . waitForCollabora ( )
6045
61- cy . screenshot ( 'new-file-' + filetype )
46+ cy . screenshot ( 'new-file-' + filetype )
6247
63- cy . get ( '@loleafletframe' ) . within ( ( ) => {
64- cy . get ( '#closebutton' ) . click ( )
65- cy . waitForViewerClose ( )
48+ cy . closeDocument ( )
6649 } )
6750 } )
6851 } )
0 commit comments