Skip to content

Commit 708f978

Browse files
committed
added tests for connection properties
1 parent e4eb741 commit 708f978

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

cypress/integration/properties.js

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// <reference types="Cypress" />
2-
import { mkApiPathUrl, fsUrl } from '../support/config.js';
2+
import { mkApiPathUrl, fsUrl, apiHost, apiPort, apiScheme } from '../support/config.js';
33
import '@4tw/cypress-drag-drop'
44
import { dialogTitle, dialogBody, dialogMainButton, dialogSecondaryButton, dialog } from '../support/utils';
55
context('Properties dialog', function () {
@@ -136,8 +136,43 @@ context('Properties dialog', function () {
136136
cy.get(dialog).should('not.exist');
137137
});
138138
})
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+
})
139157
})
140158
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+
})
141176
it('rename a document', function () {
142177
cy.waitForLoading();
143178
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/text_file.txt')).should('be.visible').rightclick();

cypress/support/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const apiUrl = apiScheme + "://" + apiHost + ":" + apiPort + "/exist/res
66
export function mkApiUrl(apiService) {
77
return apiUrl + apiService;
88
};
9-
export function mkApiPathUrl(username, dbPath) {
9+
export function mkApiPathUrl(username, dbPath = '') {
1010
return username + '@' + apiScheme + '://' + apiHost + ':' + apiPort + dbPath;
1111
};
1212

0 commit comments

Comments
 (0)