|
1 | 1 | /// <reference types="Cypress" /> |
2 | | -import { mkApiPathUrl, fsUrl } from '../support/config.js'; |
| 2 | +import { mkApiPathUrl, fsUrl, apiScheme, apiHost, apiPort } from '../support/config.js'; |
3 | 3 | import '@4tw/cypress-drag-drop' |
4 | 4 | import { treenode, dialogTitle, dialogBody, dialogMainButton, dialog } from '../support/utils'; |
5 | 5 | context('Fusion Studio', function () { |
@@ -86,6 +86,14 @@ context('Fusion Studio', function () { |
86 | 86 | cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/col1')).should('not.exist'); |
87 | 87 | cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/other_col1')).should('be.visible'); |
88 | 88 | }) |
| 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 | + }) |
89 | 97 | }) |
90 | 98 | describe('Deleting', function () { |
91 | 99 | it('delete a document', function () { |
@@ -129,5 +137,19 @@ context('Fusion Studio', function () { |
129 | 137 | cy.waitForLoading(); |
130 | 138 | cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col')).should('not.exist'); |
131 | 139 | }) |
| 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 | + }) |
132 | 154 | }) |
133 | 155 | }) |
0 commit comments