Skip to content

Commit af125d4

Browse files
committed
refactor(_spec): refactoring cleaning up ...
1 parent 2110a85 commit af125d4

File tree

5 files changed

+84
-59
lines changed

5 files changed

+84
-59
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/// <reference types="Cypress" />
2+
context('Fusion Studio', () => {
3+
describe('Connection Dialogue', () => {
4+
before(() => {
5+
cy.connect()
6+
})
7+
8+
it('should create a connection', () => {
9+
cy.visit('/')
10+
// see it in action
11+
cy.get('.ReactVirtualized__Grid')
12+
.should('be.visible')
13+
.should('contain', 'localhost')
14+
cy.get('.fusion-item')
15+
.click()
16+
.then(() => {
17+
cy.get('.ReactVirtualized__Grid__innerScrollContainer')
18+
.should('contain', 'db')
19+
.should('contain', 'RestXQ')
20+
})
21+
})
22+
23+
})
24+
25+
26+
})

cypress/integration/01_connection_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ context('Connecting to Servers', () => {
6262
})
6363

6464

65-
// TODO(DP): add Connection properties test here
65+
// TODO(DP): add Connection properties tests here (rename and contencheck)
6666
// it('Connection properties', function () {
6767
// cy.waitForLoading();
6868
// cy.getTreeNode(mkApiPathUrl('admin')).rightclick()

cypress/integration/04_document_spec.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ context('Basic Operations', () => {
2424
.should('be.visible')
2525
.click()
2626
})
27-
// TODO(DP): start workaround for #413
27+
// (DP): start workaround for #413
2828
cy.get('[node-id$=db]')
2929
.trigger('mousemove')
3030
.type('{enter}')
@@ -33,20 +33,17 @@ context('Basic Operations', () => {
3333
.contains('untitled-1')
3434

3535
// TODO(DP):
36-
// - add test for #413,
37-
// - check if tree view is deselected,
38-
// - check if Explorer is updated properly,
39-
// - check if editor window is opening the newly create doc in a new tab
40-
// - two routes one with follow-up dialog (xquery lib) one without (txt, xml)
36+
// - add test for #413 : change order, remove workaround, might need a call to focused()
37+
// - check if tree view is deselected (it is but need not be),
38+
// - check if Explorer is updated properly (seems inconsistent need to double click)
39+
// - check if editor window is opening the newly create doc in a new tab (it doesn't)
40+
// - two file create routes one with follow-up dialog (xquery lib) one without (txt, xml)
4141
})
4242

43-
// Get rid of this:
44-
// cy.addDocument(mkApiPathUrl('admin', '/db/test_col'), 'text_file.txt');
45-
4643
// TODO(DP): make this work on all OS by either adjusting the key sequence ctrl+s cmd+s …
47-
// or by cicking through the file menu instead
44+
// or by using the file menu UI instead
4845
// see #414
49-
it('should let us edit the file', () => {
46+
it('should let users edit new document', () => {
5047
cy.get('[node-id$=untitled-1]')
5148
.dblclick()
5249
cy.get('.view-line')
@@ -64,7 +61,7 @@ context('Basic Operations', () => {
6461
.type('test.txt{enter}')
6562
})
6663

67-
// TODO(DP): file properties test could go here
64+
// TODO(DP): documents properties test could go here
6865

6966
// TODO(DP): only allow unique file creation test should go here
7067

cypress/integration/operations_spec.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ import { mkApiPathUrl, apiHost, apiPort } from '../support/config.js';
33
import '@4tw/cypress-drag-drop'
44
import { treenode, dialogTitle, dialogBody, dialogMainButton, dialog } from '../support/utils';
55
context('Fusion Studio', function () {
6-
afterEach(function() {
6+
afterEach(function () {
77
if (this.currentTest.state === 'failed') {
88
Cypress.runner.stop()
99
}
1010
});
1111
describe('Documents and Collections', function () {
1212
it('Browse to root dir "db"', function () {
1313
cy.visit('/')
14-
.get('#theia-top-panel', { timeout: 60000 })
15-
.should('be.visible')
16-
.get('.theia-preload').should('not.exist');
14+
.get('#theia-top-panel', { timeout: 60000 })
15+
.should('be.visible')
16+
.get('.theia-preload').should('not.exist');
1717
cy.addConnection();
1818
cy.get('.fusion-item').should('have.length', 5).its('length').then(count => {
1919
cy.getTreeNode(mkApiPathUrl('admin', '/db')).click();
@@ -30,9 +30,9 @@ context('Fusion Studio', function () {
3030
cy.addCollection(mkApiPathUrl('admin', '/db/test_col'), 'col2');
3131
cy.addCollection(mkApiPathUrl('admin', '/db/test_col'), 'col3');
3232
})
33-
it('create text document', function () {
34-
cy.addDocument(mkApiPathUrl('admin', '/db/test_col'), 'text_file.txt');
35-
})
33+
// it('create text document', function () {
34+
// cy.addDocument(mkApiPathUrl('admin', '/db/test_col'), 'text_file.txt');
35+
// })
3636
})
3737
describe('Drag and drop', function () {
3838
it('drag move document', function () {
@@ -71,15 +71,15 @@ context('Fusion Studio', function () {
7171
})
7272
})
7373
describe('Renaming', function () {
74-
it('rename a document', function () {
75-
cy.waitForLoading();
76-
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/text_file.txt')).should('be.visible').rightclick();
77-
cy.getMenuCommand('fusion.rename').should('be.visible').click()
78-
cy.get('.fs-inline-input').should('exist').find('input.theia-input[type=text]').should('contain.value', 'text_file.txt').clear().type('new_name.txt{enter}');
79-
cy.waitForLoading();
80-
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/text_file.txt')).should('not.exist');
81-
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/new_name.txt')).should('be.visible');
82-
})
74+
// it('rename a document', function () {
75+
// cy.waitForLoading();
76+
// cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/text_file.txt')).should('be.visible').rightclick();
77+
// cy.getMenuCommand('fusion.rename').should('be.visible').click()
78+
// cy.get('.fs-inline-input').should('exist').find('input.theia-input[type=text]').should('contain.value', 'text_file.txt').clear().type('new_name.txt{enter}');
79+
// cy.waitForLoading();
80+
// cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/text_file.txt')).should('not.exist');
81+
// cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/new_name.txt')).should('be.visible');
82+
// })
8383
it('rename a collection', function () {
8484
cy.waitForLoading();
8585
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/col1')).should('be.visible').rightclick();
@@ -100,21 +100,21 @@ context('Fusion Studio', function () {
100100
})
101101
})
102102
describe('Deleting', function () {
103-
it('delete a document', function () {
104-
cy.waitForLoading();
105-
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/new_name.txt')).should('be.visible').rightclick();
106-
cy.getMenuCommand('fusion.delete').should('be.visible').click()
107-
cy.get(dialogTitle).should('contain.text', 'Delete document');
108-
cy.get(dialogBody).should('be.visible').find('p').should('contain.text', 'Are you sure you want to delete the document: new_name.txt?');
109-
cy.get(dialogMainButton).should('be.visible').click();
110-
cy.get(dialog).should('not.exist');
111-
cy.waitForLoading();
112-
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/new_name.txt')).should('not.exist');
113-
})
103+
// it('delete a document', function () {
104+
// cy.waitForLoading();
105+
// cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/new_name.txt')).should('be.visible').rightclick();
106+
// cy.getMenuCommand('fusion.delete').should('be.visible').click()
107+
// cy.get(dialogTitle).should('contain.text', 'Delete document');
108+
// cy.get(dialogBody).should('be.visible').find('p').should('contain.text', 'Are you sure you want to delete the document: new_name.txt?');
109+
// cy.get(dialogMainButton).should('be.visible').click();
110+
// cy.get(dialog).should('not.exist');
111+
// cy.waitForLoading();
112+
// cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/new_name.txt')).should('not.exist');
113+
// })
114114
it('delete multiple objects', function () {
115115
cy.waitForLoading();
116116
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2')).should('be.visible').click();
117-
cy.get('body').type('{ctrl}', {release: false})
117+
cy.get('body').type('{ctrl}', { release: false })
118118
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col3')).should('be.visible').click();
119119
cy.get('body').type('{ctrl}')
120120
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2')).should('be.visible').rightclick();
@@ -154,6 +154,6 @@ context('Fusion Studio', function () {
154154
// cy.get(dialog).should('not.exist');
155155
// cy.waitForLoading();
156156
// cy.getTreeNode(mkApiPathUrl('admin')).should('not.exist');
157-
})
158157
})
159158
})
159+
})

cypress/integration/properties.js

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,23 +162,25 @@ context('Properties dialog', function () {
162162
// })
163163
})
164164
describe('Renaming objects', function () {
165-
it('Rename a connection', function () {
166-
cy.waitForLoading();
167-
cy.getTreeNode(mkApiPathUrl('admin')).rightclick()
168-
.getMenuCommand('fusion.properties').should('be.visible').click()
169-
cy.get(dialogTitle).should('contain.text', 'Edit Connection');
170-
cy.get(dialogBody).should('be.visible').then(body => {
171-
cy.wrap(body).find('.vertical-form .name-field span').contains('Connection Name:')
172-
.find('+ input.theia-input[type=text]').should('have.value', 'localhost').clear().type('new_name');
173-
cy.get(dialogMainButton).should('be.visible').click();
174-
cy.get(dialog).should('not.exist');
175-
});
176-
cy.getTreeNode(mkApiPathUrl('admin')).should('be.visible').contains('new_name');
177-
cy.waitForLoading();
178-
cy.getTreeNode(mkApiPathUrl('admin', '/db')).click();
179-
cy.waitForLoading();
180-
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col')).click();
181-
})
165+
// it('Rename a connection', function () {
166+
// cy.waitForLoading();
167+
// cy.getTreeNode(mkApiPathUrl('admin')).rightclick()
168+
// .getMenuCommand('fusion.properties').should('be.visible').click()
169+
// cy.get(dialogTitle).should('contain.text', 'Edit Connection');
170+
// cy.get(dialogBody).should('be.visible').then(body => {
171+
// cy.wrap(body).find('.vertical-form .name-field span').contains('Connection Name:')
172+
// .find('+ input.theia-input[type=text]').should('have.value', 'localhost').clear().type('new_name');
173+
// cy.get(dialogMainButton).should('be.visible').click();
174+
// cy.get(dialog).should('not.exist');
175+
// });
176+
// cy.getTreeNode(mkApiPathUrl('admin')).should('be.visible').contains('new_name');
177+
// cy.waitForLoading();
178+
// cy.getTreeNode(mkApiPathUrl('admin', '/db')).click();
179+
// cy.waitForLoading();
180+
// cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col')).click();
181+
// })
182+
183+
// TODO(DP): Add second rename route via properties to document_spec
182184
it('rename a document', function () {
183185
cy.waitForLoading();
184186
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/text_file.txt')).should('be.visible').rightclick();

0 commit comments

Comments
 (0)