|
1 | 1 | /// <reference types="Cypress" /> |
2 | | -import { mkApiPathUrl, fsUrl } from '../support/config.js'; |
| 2 | +import { mkApiPathUrl, fsUrl, apiHost, apiPort, apiScheme } from '../support/config.js'; |
3 | 3 | import '@4tw/cypress-drag-drop' |
4 | 4 | import { dialogTitle, dialogBody, dialogMainButton, dialogSecondaryButton, dialog } from '../support/utils'; |
5 | 5 | context('Properties dialog', function () { |
@@ -136,8 +136,43 @@ context('Properties dialog', function () { |
136 | 136 | cy.get(dialog).should('not.exist'); |
137 | 137 | }); |
138 | 138 | }) |
| 139 | + it('Connection properties', function () { |
| 140 | + cy.waitForLoading(); |
| 141 | + cy.getTreeNode(mkApiPathUrl('admin')).rightclick() |
| 142 | + .getMenuCommand('fusion.properties').should('be.visible').click() |
| 143 | + cy.get(dialogTitle).should('contain.text', 'Edit Connection'); |
| 144 | + cy.get(dialogBody).should('be.visible').then(body => { |
| 145 | + cy.wrap(body).find('.vertical-form .name-field span').contains('Connection Name:') |
| 146 | + .find('+ input.theia-input[type=text]').should('have.value', apiHost); |
| 147 | + cy.wrap(body).find('.vertical-form .server-field span').contains('Server URI:') |
| 148 | + .find('+ input.theia-input[type=text]').should('have.value', apiScheme + '://' + apiHost + ':' + apiPort); |
| 149 | + cy.wrap(body).find('.vertical-form .username-field span').contains('Username:') |
| 150 | + .find('+ input.theia-input[type=text]').should('have.value', 'admin'); |
| 151 | + cy.wrap(body).find('.vertical-form .password-field span').contains('Password') |
| 152 | + .find('+ input.theia-input[type=password]').should('have.value', ''); |
| 153 | + cy.get(dialogSecondaryButton).should('be.visible').click(); |
| 154 | + cy.get(dialog).should('not.exist'); |
| 155 | + }); |
| 156 | + }) |
139 | 157 | }) |
140 | 158 | describe('Renaming objects', function () { |
| 159 | + it('Rename a connection', function () { |
| 160 | + cy.waitForLoading(); |
| 161 | + cy.getTreeNode(mkApiPathUrl('admin')).rightclick() |
| 162 | + .getMenuCommand('fusion.properties').should('be.visible').click() |
| 163 | + cy.get(dialogTitle).should('contain.text', 'Edit Connection'); |
| 164 | + cy.get(dialogBody).should('be.visible').then(body => { |
| 165 | + cy.wrap(body).find('.vertical-form .name-field span').contains('Connection Name:') |
| 166 | + .find('+ input.theia-input[type=text]').should('have.value', apiHost).clear().type('new_name'); |
| 167 | + cy.get(dialogMainButton).should('be.visible').click(); |
| 168 | + cy.get(dialog).should('not.exist'); |
| 169 | + }); |
| 170 | + cy.getTreeNode(mkApiPathUrl('admin')).should('be.visible').contains('new_name'); |
| 171 | + cy.waitForLoading(); |
| 172 | + cy.getTreeNode(mkApiPathUrl('admin', '/db')).click(); |
| 173 | + cy.waitForLoading(); |
| 174 | + cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col')).click(); |
| 175 | + }) |
141 | 176 | it('rename a document', function () { |
142 | 177 | cy.waitForLoading(); |
143 | 178 | cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/text_file.txt')).should('be.visible').rightclick(); |
|
0 commit comments