@@ -13,12 +13,11 @@ context.only('Document Operations', () => {
1313
1414 describe ( 'db context menu' , ( ) => {
1515 it ( 'should display creation options' , ( ) => {
16-
1716 cy . get ( '.ReactVirtualized__Grid' )
1817 . should ( 'be.visible' )
1918 cy . get ( '.fusion-item' )
2019 . should ( 'be.visible' )
21- . click ( )
20+ . click ( { animationDistanceThreshold : 2 } )
2221 // all we need is the final part of the node-id attribute
2322 cy . get ( '[node-id$=db]' )
2423 . should ( 'be.visible' )
@@ -32,10 +31,11 @@ context.only('Document Operations', () => {
3231 . should ( 'be.visible' )
3332 . click ( )
3433 } )
34+ // (DP) untitled-1 has been created
3535 // (DP): start workaround for #413
3636 cy . get ( '.fusion-item' )
3737 . should ( 'be.visible' )
38- . click ( )
38+ . click ( { animationDistanceThreshold : 2 } )
3939 cy . get ( '[node-id$=db]' )
4040 . should ( 'be.visible' )
4141 . focused ( )
@@ -57,6 +57,9 @@ context.only('Document Operations', () => {
5757 // see #414
5858
5959 it ( 'should let users edit new document' , ( ) => {
60+ cy . get ( '.fusion-item' )
61+ . should ( 'be.visible' )
62+ // (DP) edit and save untitled-1
6063 cy . get ( '[node-id$=untitled-1]' )
6164 . dblclick ( )
6265 if ( Cypress . platform === 'darwin' ) {
@@ -70,6 +73,9 @@ context.only('Document Operations', () => {
7073 // see #414 workaround is to run this after editing and saving the document,
7174 // we should be able to rename before entering content
7275 it ( 'should let users rename documents' , ( ) => {
76+ cy . get ( '.fusion-item' )
77+ . should ( 'be.visible' )
78+ // (DP) rename untitled-1 -> test.txt
7379 cy . get ( '[node-id$=untitled-1]' )
7480 . should ( 'be.visible' )
7581 . rightclick ( )
@@ -81,13 +87,49 @@ context.only('Document Operations', () => {
8187 } )
8288
8389 it ( 'should display document properties' , ( ) => {
90+ cy . get ( '[node-id$=db]' )
91+ . should ( 'be.visible' )
92+ cy . get ( '[node-id$=test\\.txt]' )
93+ . should ( 'be.visible' )
94+ . type ( '{alt+enter}' , { force : true } )
95+ cy . get ( '.dialogTitle' )
96+ . should ( 'contain.text' , 'Properties' )
97+ // rename test.xml -> text.xml
98+ cy . get ( '.value > .theia-input' )
99+ . clear ( )
100+ . type ( 'test.xml' )
101+ // check properties table
102+ // TODO (DP) # 519 flaky test, properties table changes based on filetype
103+ // hence only check visibility.
104+ cy . get ( '.dialogContent' )
105+ . find ( '.keys > tr' )
106+ // .should('have.length', 11)
107+ . should ( 'be.visible' )
108+ // .should('contain.text', 'Media Type')
109+ // .contains('Media Type')
110+ cy . get ( '.dialogContent' )
111+ . find ( '.keys > tr' )
112+ . should ( 'contain.text' , 'Owner' )
113+ // check permissions table
114+ cy . get ( '.dialogContent' )
115+ . find ( '.permissions-editor > tr' )
116+ . should ( 'have.length' , 3 )
117+ . should ( 'contain.text' , 'user' )
118+ // .contains('user')
119+ cy . get ( '.main' )
120+ . click ( )
121+ } )
122+
123+ it . skip ( 'should display document properties' , ( ) => {
124+ cy . get ( '.fusion-item' )
125+ . should ( 'be.visible' )
84126 cy . get ( '[node-id$=test\\.txt]' )
85127 . should ( 'be.visible' )
86128 // .focused()
87129 . type ( '{alt+enter}' , { force : true } )
88130 cy . get ( '.dialogTitle' )
89131 . should ( 'contain.text' , 'Properties' )
90- // rename file -> text.xml
132+ // rename test.xml -> text.xml
91133 cy . get ( '.value > .theia-input' )
92134 . clear ( )
93135 . type ( 'test.xml' )
@@ -98,15 +140,17 @@ context.only('Document Operations', () => {
98140 . find ( '.keys > tr' )
99141 // .should('have.length', 11)
100142 . should ( 'be.visible' )
143+ // .should('contain.text', 'Media Type')
101144 // .contains('Media Type')
102145 cy . get ( '.dialogContent' )
103146 . find ( '.keys > tr' )
104- . contains ( 'Owner' )
147+ . should ( 'contain.text' , 'Owner' )
105148 // check permissions table
106149 cy . get ( '.dialogContent' )
107150 . find ( '.permissions-editor > tr' )
108151 . should ( 'have.length' , 3 )
109- . contains ( 'user' )
152+ . should ( 'contain.text' , 'user' )
153+ // .contains('user')
110154 cy . get ( '.main' )
111155 . click ( )
112156 } )
0 commit comments