Skip to content

Commit 1e66f2f

Browse files
authored
Merge pull request #223 from evolvedbinary/more-ci
Further Cypress targets
2 parents d331175 + 41df134 commit 1e66f2f

File tree

10 files changed

+157
-75
lines changed

10 files changed

+157
-75
lines changed

.travis.yml

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,66 @@ jobs:
3030
dist: xenial
3131
node_js: 14
3232

33-
- name: Ubuntu Xenial (16.04) / NodeJS 12 / Python 2 / Cypress
33+
- name: Ubuntu Xenial (16.04) / NodeJS 12 / Python 2 / Cypress @ FusionDB Nightly
34+
os: linux
35+
dist: xenial
36+
node_js: 12
37+
env:
38+
- IMG=repo.evolvedbinary.com:9543/evolvedbinary/fusiondb-server:nightly
39+
before_script:
40+
- docker login --username $FDB_NIGHTLY_DOCKER_USER --password $FDB_NIGHTLY_DOCKER_PASS repo.evolvedbinary.com:9543
41+
- docker pull $IMG
42+
- docker create --name fusiondb-server-ci -p 4059:4059 $IMG
43+
- docker start fusiondb-server-ci
44+
- sleep 10
45+
script:
46+
- yarn test
47+
- yarn run cypress run --record --tag "FusionDB,Nightly"
48+
49+
- name: Ubuntu Xenial (16.04) / NodeJS 12 / Python 2 / Cypress @ FusionDB 1.0.0-ALPHA3
50+
os: linux
51+
dist: xenial
52+
node_js: 12
53+
env:
54+
- IMG=repo.evolvedbinary.com:9443/evolvedbinary/fusiondb-server:1.0.0-ALPHA3
55+
before_script:
56+
- docker login --username $FDB_DOCKER_USER --password $FDB_DOCKER_PASS repo.evolvedbinary.com:9443
57+
- docker pull $IMG
58+
- docker create --name fusiondb-server-ci -p 4059:4059 $IMG
59+
- docker start fusiondb-server-ci
60+
- sleep 10
61+
script:
62+
- yarn test
63+
- yarn run cypress run --record --tag "FusionDB,1.0.0-ALPHA3"
64+
65+
- name: Ubuntu Xenial (16.04) / NodeJS 12 / Python 2 / Cypress @ eXist-db Latest
66+
os: linux
67+
dist: xenial
68+
node_js: 12
69+
env:
70+
- IMG=existdb/existdb:latest
71+
- API_XAR=https://www.fusiondb.com/download/fusion-studio-api-1.1.1.xar
72+
- API_PORT=8080
73+
before_script:
74+
- docker pull $IMG
75+
- docker create --name exist-ci -p 8080:8080 $IMG
76+
- wget $API_XAR
77+
- docker cp ./*.xar exist-ci:exist/autodeploy
78+
- docker start exist-ci
79+
- rm *.xar
80+
- sleep 10
81+
script:
82+
- yarn test
83+
- yarn run cypress run --record --tag "eXist-db,Latest"
84+
85+
- name: Ubuntu Xenial (16.04) / NodeJS 12 / Python 2 / Cypress @ eXist-db 5.2.0
3486
os: linux
3587
dist: xenial
3688
node_js: 12
3789
env:
3890
- IMG=existdb/existdb:5.2.0
3991
- API_XAR=https://www.fusiondb.com/download/fusion-studio-api-1.1.1.xar
92+
- API_PORT=8080
4093
before_script:
4194
- docker pull $IMG
4295
- docker create --name exist-ci -p 8080:8080 $IMG
@@ -47,7 +100,7 @@ jobs:
47100
- sleep 10
48101
script:
49102
- yarn test
50-
- yarn run cypress run --record
103+
- yarn run cypress run --record --tag "eXist-db,5.2.0"
51104

52105
- name: Ubuntu Focal (20.04) / NodeJS 14 / Python 3
53106
os: linux

cypress/integration/api.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/// <reference types="Cypress" />
2+
import { mkApiUrl, mkApiPathUrl, fsUrl } from '../support/config.js';
23
import { dialogTitle, dialogBody, dialogMainButton, dialog } from '../support/utils';
34

45
context('Fusion Studio', function () {
56
describe('API minimum version', function () {
67
it('should connect with newer api', function () {
7-
cy.visit('http://localhost:3000', {
8+
cy.visit(fsUrl, {
89
onBeforeLoad(win) {
9-
cy.stub(win, 'fetch').callThrough().withArgs('http://localhost:8080/exist/restxq/fusiondb/version').as('version api').resolves({
10+
cy.stub(win, 'fetch').callThrough().withArgs(mkApiUrl('/version')).as('version api').resolves({
1011
status: 200,
1112
ok: true,
1213
json: () => ({
@@ -24,12 +25,12 @@ context('Fusion Studio', function () {
2425
.should('be.visible')
2526
.get('.theia-preload').should('not.exist');
2627
cy.addConnection();
27-
cy.getTreeNode('admin@http://localhost:8080/db').should('exist');
28+
cy.getTreeNode(mkApiPathUrl('admin', '/db')).should('exist');
2829
})
2930
it('shouldn\'t connect with older api', function () {
30-
cy.visit('http://localhost:3000', {
31+
cy.visit(fsUrl, {
3132
onBeforeLoad(win) {
32-
cy.stub(win, 'fetch').callThrough().withArgs('http://localhost:8080/exist/restxq/fusiondb/version').as('version api').resolves({
33+
cy.stub(win, 'fetch').callThrough().withArgs(mkApiUrl('/version')).as('version api').resolves({
3334
status: 200,
3435
ok: true,
3536
json: () => ({

cypress/integration/eval_panel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/// <reference types="Cypress" />
2+
import { fsUrl } from '../support/config.js';
23
context('Fusion Studio', function() {
34
beforeEach('IDE', function(){
4-
cy.visit('http://localhost:3000')
5+
cy.visit(fsUrl)
56
.get('#theia-top-panel', {timeout: 30000})
67
.should('be.visible')
78
.get('.theia-preload').should('not.exist');
Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/// <reference types="Cypress" />
2+
import { mkApiPathUrl, fsUrl } from '../support/config.js';
23
import '@4tw/cypress-drag-drop'
34
import { treenode, dialogTitle, dialogBody, dialogMainButton, dialog } from '../support/utils';
45
context('Fusion Studio', function () {
@@ -9,102 +10,102 @@ context('Fusion Studio', function () {
910
});
1011
describe('Documents and Collections', function () {
1112
it('Browse to root dir "db"', function () {
12-
cy.visit('http://localhost:3000')
13+
cy.visit(fsUrl)
1314
.get('#theia-top-panel', { timeout: 30000 })
1415
.should('be.visible')
1516
.get('.theia-preload').should('not.exist');
1617
cy.addConnection();
1718
cy.get('.fusion-item').should('have.length', 5).its('length').then(count => {
18-
cy.getTreeNode('admin@http://localhost:8080/db').click();
19+
cy.getTreeNode(mkApiPathUrl('admin', '/db')).click();
1920
cy.get('.fusion-item').should('have.length.gt', count);
2021
});
2122
})
2223
it('create test collections', function () {
23-
cy.addCollection('admin@http://localhost:8080/db', 'test_col');
24-
cy.getTreeNode('admin@http://localhost:8080/db/test_col').click();
25-
cy.addCollection('admin@http://localhost:8080/db/test_col', 'col1');
26-
cy.addCollection('admin@http://localhost:8080/db/test_col', 'col2');
27-
cy.addCollection('admin@http://localhost:8080/db/test_col', 'col3');
24+
cy.addCollection(mkApiPathUrl('admin', '/db'), 'test_col');
25+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col')).click();
26+
cy.addCollection(mkApiPathUrl('admin', '/db/test_col'), 'col1');
27+
cy.addCollection(mkApiPathUrl('admin', '/db/test_col'), 'col2');
28+
cy.addCollection(mkApiPathUrl('admin', '/db/test_col'), 'col3');
2829
})
2930
it('create text document', function () {
30-
cy.addDocument('admin@http://localhost:8080/db/test_col', 'text_file.txt');
31+
cy.addDocument(mkApiPathUrl('admin', '/db/test_col'), 'text_file.txt');
3132
})
3233
})
3334
describe('Drag and drop', function () {
3435
it('drag move document', function () {
3536
cy.waitForLoading();
36-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/text_file.txt').should('be.visible')
37-
.drag(treenode('admin@http://localhost:8080/db/test_col/col1'));
37+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/text_file.txt')).should('be.visible')
38+
.drag(treenode(mkApiPathUrl('admin', '/db/test_col/col1')));
3839
cy.waitForLoading();
39-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/text_file.txt').should('not.exist');
40-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col1/text_file.txt').should('be.visible');
40+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/text_file.txt')).should('not.exist');
41+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col1/text_file.txt')).should('be.visible');
4142
})
4243
it('drag copy document', function () {
4344
cy.waitForLoading();
44-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col1/text_file.txt')
45-
.drag(treenode('admin@http://localhost:8080/db/test_col/col2'), { ctrlKey: true });
45+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col1/text_file.txt'))
46+
.drag(treenode(mkApiPathUrl('admin', '/db/test_col/col2')), { ctrlKey: true });
4647
cy.waitForLoading();
47-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col1/text_file.txt').should('be.visible');
48-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2/text_file.txt').should('be.visible');
48+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col1/text_file.txt')).should('be.visible');
49+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/text_file.txt')).should('be.visible');
4950
})
5051
it('drag copy collection', function () {
5152
cy.waitForLoading();
52-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col1').should('be.visible')
53-
.drag(treenode('admin@http://localhost:8080/db/test_col/col2'), { ctrlKey: true });
53+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col1')).should('be.visible')
54+
.drag(treenode(mkApiPathUrl('admin', '/db/test_col/col2')), { ctrlKey: true });
5455
cy.waitForLoading();
55-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col1').should('be.visible');
56-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2/col1').should('be.visible').click();
56+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col1')).should('be.visible');
57+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/col1')).should('be.visible').click();
5758
cy.waitForLoading();
58-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2/col1/text_file.txt').should('be.visible');
59+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/col1/text_file.txt')).should('be.visible');
5960
})
6061
it('drag move collection', function () {
6162
cy.waitForLoading();
62-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col1').should('be.visible')
63-
.drag(treenode('admin@http://localhost:8080/db/test_col/col3'));
63+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col1')).should('be.visible')
64+
.drag(treenode(mkApiPathUrl('admin', '/db/test_col/col3')));
6465
cy.waitForLoading();
65-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col3/col1').should('be.visible');
66-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col1').should('not.exist');
66+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col3/col1')).should('be.visible');
67+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col1')).should('not.exist');
6768
})
6869
})
6970
describe('Renaming', function () {
7071
it('rename a document', function () {
7172
cy.waitForLoading();
72-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2/text_file.txt').should('be.visible').rightclick();
73+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/text_file.txt')).should('be.visible').rightclick();
7374
cy.getMenuCommand('fusion.rename').should('be.visible').click()
7475
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}');
7576
cy.waitForLoading();
76-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2/text_file.txt').should('not.exist');
77-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2/new_name.txt').should('be.visible');
77+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/text_file.txt')).should('not.exist');
78+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/new_name.txt')).should('be.visible');
7879
})
7980
it('rename a collection', function () {
8081
cy.waitForLoading();
81-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2/col1').should('be.visible').rightclick();
82+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/col1')).should('be.visible').rightclick();
8283
cy.getMenuCommand('fusion.rename').should('be.visible').click()
8384
cy.get('.fs-inline-input').should('exist').find('input.theia-input[type=text]').should('contain.value', 'col1').clear().type('other_col1{enter}');
8485
cy.waitForLoading();
85-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2/col1').should('not.exist');
86-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2/other_col1').should('be.visible');
86+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/col1')).should('not.exist');
87+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/other_col1')).should('be.visible');
8788
})
8889
})
8990
describe('Deleting', function () {
9091
it('delete a document', function () {
9192
cy.waitForLoading();
92-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2/new_name.txt').should('be.visible').rightclick();
93+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/new_name.txt')).should('be.visible').rightclick();
9394
cy.getMenuCommand('fusion.delete').should('be.visible').click()
9495
cy.get(dialogTitle).should('contain.text', 'Delete document');
9596
cy.get(dialogBody).should('be.visible').find('p').should('contain.text', 'Are you sure you want to delete the document: new_name.txt?');
9697
cy.get(dialogMainButton).should('be.visible').click();
9798
cy.get(dialog).should('not.exist');
9899
cy.waitForLoading();
99-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2/new_name.txt').should('not.exist');
100+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2/new_name.txt')).should('not.exist');
100101
})
101102
it('delete multiple objects', function () {
102103
cy.waitForLoading();
103-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2').should('be.visible').click();
104+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2')).should('be.visible').click();
104105
cy.get('body').type('{ctrl}', {release: false})
105-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col3').should('be.visible').click();
106+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col3')).should('be.visible').click();
106107
cy.get('body').type('{ctrl}')
107-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2').should('be.visible').rightclick();
108+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2')).should('be.visible').rightclick();
108109
cy.getMenuCommand('fusion.delete').should('be.visible').click()
109110
cy.get(dialogTitle).should('contain.text', 'Delete items');
110111
cy.get(dialogBody).should('be.visible').find('p')
@@ -114,19 +115,19 @@ context('Fusion Studio', function () {
114115
cy.get(dialogMainButton).should('be.visible').click();
115116
cy.get(dialog).should('not.exist');
116117
cy.waitForLoading();
117-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col2').should('not.exist');
118-
cy.getTreeNode('admin@http://localhost:8080/db/test_col/col3').should('not.exist');
118+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col2')).should('not.exist');
119+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col/col3')).should('not.exist');
119120
})
120121
it('delete a collection', function () {
121122
cy.waitForLoading();
122-
cy.getTreeNode('admin@http://localhost:8080/db/test_col').should('be.visible').rightclick();
123+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col')).should('be.visible').rightclick();
123124
cy.getMenuCommand('fusion.delete').should('be.visible').click()
124125
cy.get(dialogTitle).should('contain.text', 'Delete collection');
125126
cy.get(dialogBody).should('be.visible').find('p').should('contain.text', 'Are you sure you want to delete the collection: test_col?');
126127
cy.get(dialogMainButton).should('be.visible').click();
127128
cy.get(dialog).should('not.exist');
128129
cy.waitForLoading();
129-
cy.getTreeNode('admin@http://localhost:8080/db/test_col').should('not.exist');
130+
cy.getTreeNode(mkApiPathUrl('admin', '/db/test_col')).should('not.exist');
130131
})
131132
})
132133
})

0 commit comments

Comments
 (0)