11/// <reference types="Cypress" />
2- import { mkApiPathUrl , fsUrl } from '../support/config.js' ;
2+ import { mkApiPathUrl , fsUrl , apiScheme , apiHost , apiPort } from '../support/config.js' ;
33import '@4tw/cypress-drag-drop'
44import { treenode , dialogTitle , dialogBody , dialogMainButton , dialog } from '../support/utils' ;
55context ( 'Fusion Studio' , function ( ) {
@@ -35,23 +35,23 @@ context('Fusion Studio', function () {
3535 it ( 'drag move document' , function ( ) {
3636 cy . waitForLoading ( ) ;
3737 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/text_file.txt' ) ) . should ( 'be.visible' )
38- . drag ( treenode ( mkApiPathUrl ( 'admin' , '/db/test_col/col1' ) ) ) ;
38+ . drag ( treenode ( mkApiPathUrl ( 'admin' , '/db/test_col/col1' ) ) , { hoverTime : 1000 } ) ;
3939 cy . waitForLoading ( ) ;
4040 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/text_file.txt' ) ) . should ( 'not.exist' ) ;
4141 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col1/text_file.txt' ) ) . should ( 'be.visible' ) ;
4242 } )
4343 it ( 'drag copy document' , function ( ) {
4444 cy . waitForLoading ( ) ;
4545 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col1/text_file.txt' ) )
46- . drag ( treenode ( mkApiPathUrl ( 'admin' , '/db/test_col/col2' ) ) , { ctrlKey : true } ) ;
46+ . drag ( treenode ( mkApiPathUrl ( 'admin' , '/db/test_col/col2' ) ) , { ctrlKey : true , hoverTime : 1000 } ) ;
4747 cy . waitForLoading ( ) ;
4848 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col1/text_file.txt' ) ) . should ( 'be.visible' ) ;
4949 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col2/text_file.txt' ) ) . should ( 'be.visible' ) ;
5050 } )
5151 it ( 'drag copy collection' , function ( ) {
5252 cy . waitForLoading ( ) ;
5353 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col1' ) ) . should ( 'be.visible' )
54- . drag ( treenode ( mkApiPathUrl ( 'admin' , '/db/test_col/col2' ) ) , { ctrlKey : true } ) ;
54+ . drag ( treenode ( mkApiPathUrl ( 'admin' , '/db/test_col/col2' ) ) , { ctrlKey : true , hoverTime : 1000 } ) ;
5555 cy . waitForLoading ( ) ;
5656 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col1' ) ) . should ( 'be.visible' ) ;
5757 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col2/col1' ) ) . should ( 'be.visible' ) . click ( ) ;
@@ -61,7 +61,7 @@ context('Fusion Studio', function () {
6161 it ( 'drag move collection' , function ( ) {
6262 cy . waitForLoading ( ) ;
6363 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col1' ) ) . should ( 'be.visible' )
64- . drag ( treenode ( mkApiPathUrl ( 'admin' , '/db/test_col/col3' ) ) ) ;
64+ . drag ( treenode ( mkApiPathUrl ( 'admin' , '/db/test_col/col3' ) ) , { hoverTime : 1000 } ) ;
6565 cy . waitForLoading ( ) ;
6666 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col3/col1' ) ) . should ( 'be.visible' ) ;
6767 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col1' ) ) . should ( 'not.exist' ) ;
@@ -86,6 +86,14 @@ context('Fusion Studio', function () {
8686 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col2/col1' ) ) . should ( 'not.exist' ) ;
8787 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col/col2/other_col1' ) ) . should ( 'be.visible' ) ;
8888 } )
89+ it ( 'rename a connection' , function ( ) {
90+ cy . waitForLoading ( ) ;
91+ cy . getTreeNode ( mkApiPathUrl ( 'admin' ) ) . should ( 'be.visible' ) . rightclick ( ) ;
92+ cy . getMenuCommand ( 'fusion.rename' ) . should ( 'be.visible' ) . click ( )
93+ cy . get ( '.fs-inline-input' ) . should ( 'exist' ) . find ( 'input.theia-input[type=text]' ) . should ( 'contain.value' , 'localhost' ) . clear ( ) . type ( 'new_name{enter}' ) ;
94+ cy . waitForLoading ( ) ;
95+ cy . getTreeNode ( mkApiPathUrl ( 'admin' ) ) . should ( 'be.visible' ) . contains ( 'new_name' ) ;
96+ } )
8997 } )
9098 describe ( 'Deleting' , function ( ) {
9199 it ( 'delete a document' , function ( ) {
@@ -129,5 +137,19 @@ context('Fusion Studio', function () {
129137 cy . waitForLoading ( ) ;
130138 cy . getTreeNode ( mkApiPathUrl ( 'admin' , '/db/test_col' ) ) . should ( 'not.exist' ) ;
131139 } )
140+ it ( 'delete a connection' , function ( ) {
141+ cy . waitForLoading ( ) ;
142+ cy . getTreeNode ( mkApiPathUrl ( 'admin' ) ) . should ( 'be.visible' ) . rightclick ( ) ;
143+ cy . getMenuCommand ( 'fusion.disconnect' ) . should ( 'be.visible' ) . click ( )
144+ cy . get ( dialogTitle ) . should ( 'contain.text' , 'Remove Connection' ) ;
145+ cy . get ( dialogBody ) . should ( 'be.visible' ) . find ( 'p' )
146+ . should ( 'contain.text' , 'Are you sure you want to remove the connection: new_name?' )
147+ . should ( 'contain.text' , `Server URI: ${ apiScheme } ://${ apiHost } :${ apiPort } ` )
148+ . should ( 'contain.text' , 'Username: admin' ) ;
149+ cy . get ( dialogMainButton ) . should ( 'be.visible' ) . click ( ) ;
150+ cy . get ( dialog ) . should ( 'not.exist' ) ;
151+ cy . waitForLoading ( ) ;
152+ cy . getTreeNode ( mkApiPathUrl ( 'admin' ) ) . should ( 'not.exist' ) ;
153+ } )
132154 } )
133155} )
0 commit comments