Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,22 @@ jobs:
- v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
- v1-deps-{{ .Branch }}
- v1-deps
# TODO (DP) slim this down
# TODO (DP) slim this down source: https://github.com/cypress-io/cypress-docker-images/blob/ec0962672571ff557bd3654000a0aa5a0a02057b/base/14.7.0/Dockerfile#L11
- run: |
sudo apt-get update
sudo apt-get --yes install fonts-liberation libx11-dev libxkbfile-dev libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xdg-utils xvfb
sudo apt-get --yes install libx11-dev libxkbfile-dev libgtk2.0-0 libgtk-3-0 libgconf-2-4 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb

# - setup_remote_docker:
# version: 20.10.2
# docker_layer_caching: false
- run:
name: get and install chrome
command: |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
# docker_layer_caching: false

# (DP) only activate on CI if absolutely necessary. Electron browser tests are our gold standard
# - run:
# name: get and install chrome
# command: |
# sudo apt-get --yes install fonts-liberation xdg-utils
# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# sudo dpkg -i google-chrome-stable_current_amd64.deb
- run:
name: install dockerize
command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
Expand Down Expand Up @@ -72,8 +75,8 @@ jobs:
curl -v --connect-timeout 4 --max-time 8 http://localhost:3000
- run:
working_directory: .
# command: npx cypress run --config defaultCommandTimeout=58000
command: npx cypress run -b chrome
command: npx cypress run --config defaultCommandTimeout=20000
# command: npx cypress run -b chrome --config defaultCommandTimeout=58000
no_output_timeout: 2m
workflows:
browser_build:
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ lib
# ide apps
*-app/*
!*-app/package.json
!*-app/webpack.config.js
fusion-studio-extension/src/browser/style/index.css

# integration test files
Expand All @@ -80,3 +81,7 @@ cypress/screenshots/*
# node-gyp
build/
fusion-studio-extension/src/variables.ts

# Expath
*.xar
autodeploy/
17 changes: 9 additions & 8 deletions browser-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
"version": "1.1.0",
"dependencies": {
"@theia/core": "^1.15.0",
"@theia/editor": "^1.15.0",
"@theia/filesystem": "^1.15.0",
"@theia/workspace": "^1.15.0",
"@theia/preferences": "^1.15.0",
"@theia/markers": "^1.15.0",
"@theia/messages": "^1.15.0",
"@theia/monaco": "^1.15.0",
"@theia/navigator": "^1.15.0",
"@theia/preferences": "^1.15.0",
"@theia/process": "^1.15.0",
"@theia/terminal": "^1.15.0",
"@theia/editor": "^1.15.0",
"@theia/markers": "^1.15.0",
"@theia/monaco": "^1.15.0",
"@theia/messages": "^1.15.0",
"fusion-studio-extension": "1.2.0"
"@theia/workspace": "^1.15.0",
"fusion-studio-extension": "1.2.0",
"process": "^0.11.10"
},
"devDependencies": {
"@theia/cli": "^1.15.0"
Expand All @@ -32,4 +33,4 @@
}
}
}
}
}
13 changes: 13 additions & 0 deletions browser-app/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This file can be edited to customize webpack configuration.
* To reset delete this file and rerun theia build again.
*/
const webpack = require('webpack');
const config = require('./gen-webpack.config.js');
const yargs = require('yargs');

if (yargs.option('mode').argv.mode === 'development') {
console.log('Development mode. Including process variable...');
config.plugins.push(new webpack.ProvidePlugin({ process: require.resolve('process/browser') }));
}
module.exports = config;
97 changes: 61 additions & 36 deletions cypress/integration/01_api-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,66 @@

context('Talking to the api directly', () => {
describe('API version', () => {
before(function() {
cy.connect();
cy.visit('/');
});
it('should fail to connect with older api', () => {
cy.intercept('GET', Cypress.env('API_HOST') + '/exist/restxq/fusiondb/version', { fixture: 'bad_api' });
cy.get('.fusion-item').click().then(() => {
cy.get('.dialogTitle').should('contain.text', 'New Connection');
cy.get('.dialogContent').should('be.visible')
.should('contain.text', 'Outdated API "0.0.1"')
.should('contain.text', 'You need to update your API to version "0.2.0" or higher');
cy.get('.theia-button.main').should('be.visible').click();
cy.get('.dialogBlock').should('not.exist');
});
});
it('should connect with newer api', () => {
cy.window().then(function(win) {
const fetchSpy = cy.spy(win, 'fetch');
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/version').as('/version');
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/explorer?uri=/').as('/explorer');
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/user').as('/user');
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/group').as('/group');
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/index').as('/index');
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/restxq').as('/restxq');
cy.get('.fusion-item').click();
before(function () {
cy.connect()
cy.visit('/')
})
describe('With outdated API', () => {
it('should fail to connect with older api', () => {
cy.intercept('GET', Cypress.env('API_HOST') + '/exist/restxq/fusiondb/version', { fixture: 'bad_api' })
cy.get('.fusion-item').click().then(() => {
cy.get('.dialogTitle').should('contain.text', 'New Connection')
cy.get('.dialogContent').should('be.visible')
.should('contain.text', 'Outdated API "0.0.1"')
.should('contain.text', 'You need to update your API to version "0.2.0" or higher')
cy.get('.theia-button.main').should('be.visible').click()
cy.get('.dialogBlock').should('not.exist')
})
})
})
describe('With current API', () => {
it('should reach all api endpoints', () => {
cy.window().then(function (win) {
const fetchSpy = cy.spy(win, 'fetch')
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/version').as('/version')
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/explorer?uri=/').as('/explorer')
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/user').as('/user')
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/group').as('/group')
fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/index').as('/index')
// See #508
// fetchSpy.withArgs(Cypress.env('API_HOST') + '/exist/restxq/fusiondb/restxq').as('/restxq')
cy.get('.fusion-item').click()
cy.get('@/version').should('be.called')
cy.get('@/explorer').should('be.called')
cy.get('@/user').should('be.called')
cy.get('@/group').should('be.called')
cy.get('@/index').should('be.called')
// See #508
// cy.get('@/restxq').should('be.called')
})
})

// (DP) we might want to merge the three cases again at a future time
it('should display db tree item', () => {
cy.contains('localhost').click()
cy.get('.fusion-view')
.should('contain', 'db')
.should('contain', 'RestXQ');
cy.get('@/version').should('be.called');
cy.get('@/explorer').should('be.called');
cy.get('@/user').should('be.called');
cy.get('@/group').should('be.called');
cy.get('@/index').should('be.called');
cy.get('@/restxq').should('be.called');
});
});
});
})
// .should('contain', 'Security')
// .should('contain', 'RestXQ')
})

it('should display security tree item', () => {
cy.contains('localhost')
cy.get('.fusion-view')
.should('contain', 'Security')
})

// see #508
it.skip('should display restxq tree item', () => {
cy.contains('localhost')
cy.get('.fusion-view')
.should('contain', 'RestXQ')
})
})
})
})
17 changes: 11 additions & 6 deletions cypress/integration/02_eval_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ context('Evaluation', () => {
describe('The Theia Panel', () => {
it('should be accessible from command panel', () => {
// invoke command panel and run the command
cy.get('body').trigger('keydown', { keyCode: 112, which: 112 })
.trigger('keyup', { keyCode: 112, which: 112 })
cy.get('.quick-open-overlay .quick-open-input input')
if (Cypress.platform === 'darwin') {
cy.get('body')
.type('{shift+meta+P}')
} else {
cy.get('body')
.type('{shift+ctrl+P}')
}
cy.get('input.input')
.clear()
.type('>Toggle Evaluation View{enter}')
// check the panel
Expand Down Expand Up @@ -43,7 +48,7 @@ context('Evaluation', () => {
.contains('file')
.click()
})

it('should have proper header and footer', () => {
cy.get('.x-header > button')
.should('be.disabled')
Expand All @@ -54,13 +59,13 @@ context('Evaluation', () => {
.should('be.disabled')
.should('contain', 'New file')
})

it('should disappear again', () => {
// invoke command panel and run the command again
cy.get('body')
.trigger('keydown', { keyCode: 112, which: 112 })
.trigger('keyup', { keyCode: 112, which: 112 })
cy.get('.quick-open-overlay .quick-open-input input')
cy.get('input.input')
.clear()
.type('>Toggle Evaluation View{enter}')
// check the panel
Expand Down
3 changes: 2 additions & 1 deletion cypress/integration/03_connection_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ context('Connecting to Servers', () => {
.then(() => {
cy.get('.ReactVirtualized__Grid__innerScrollContainer')
.should('contain', 'db')
.should('contain', 'RestXQ')
// see #508
// .should('contain', 'RestXQ')
})
})

Expand Down
6 changes: 4 additions & 2 deletions cypress/integration/04_document_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="Cypress" />

context('Document Operations', () => {
context.skip('Document Operations', () => {
describe('working with tree view', () => {
before(() => {
cy.connect()
Expand Down Expand Up @@ -28,7 +28,9 @@ context('Document Operations', () => {
.should('be.visible')
.click()
})
// (DP): start workaround for #413
// (DP): start workaround for #413
cy.get('.fusion-item')
.click()
cy.get('[node-id$=db]')
.trigger('mousemove')
.type('{enter}')
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/05_collection_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="Cypress" />

context('Collection Operations', () => {
context.skip('Collection Operations', () => {
let fetchSpy;
describe('working with tree view', () => {
before(() => {
Expand Down
26 changes: 21 additions & 5 deletions cypress/integration/06_permission_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,24 @@ context('Permission Manager', () => {
.click()
})

// (DP)) we need frequent assertions to work around the fact that the tree collapes on new requests
// see #513 #397
it('should have user entries', () => {
cy.get('[node-id$=security]')
.click()
cy.get('.ReactVirtualized__Grid')
.contains('Users')
.click()
cy.get('[node-id$=user\\/guest]')
.should('be.visible')
.click()
.then(() => {
cy.get('[node-id$=security\\/user]')
.should('be.visible')
.click()
.then(() => {
cy.get(`[node-id=${CSS.escape('admin@' + Cypress.env('API_HOST'))}]`)
.should('be.visible')
.click()
cy.get('[node-id$=user\\/guest]')
.should('be.visible')
})
})
})

it('should have group entries', () => {
Expand All @@ -30,6 +40,7 @@ context('Permission Manager', () => {
describe('the user item', () => {
it('should let us create a new user', () => {
cy.get('[node-id$=security]')
.should('be.visible')
.rightclick()
cy.get('[data-command="fusion.add-user"]')
.contains('Add')
Expand All @@ -53,6 +64,7 @@ context('Permission Manager', () => {

it('should display user properties card', () => {
cy.get('[node-id$=user\\/guest]')
.should('be.visible')
.rightclick()
cy.get('.p-Menu > ul > .p-Menu-item')
.should('be.visible')
Expand All @@ -79,6 +91,7 @@ context('Permission Manager', () => {

it('should let us delete a user', () => {
cy.get('[node-id$=user\\/cy-usr]')
.should('be.visible')
.rightclick()
cy.get('[data-command="fusion.delete-user"]')
.click()
Expand All @@ -94,6 +107,7 @@ context('Permission Manager', () => {
describe('the groups item', () => {
it('should let us create a new group', () => {
cy.get('[node-id$=security]')
.should('be.visible')
.rightclick()
cy.get('[data-command="fusion.add-group"]')
.contains('Add')
Expand All @@ -107,6 +121,7 @@ context('Permission Manager', () => {

it('should display group properties card', () => {
cy.get('[node-id$=group\\/guest]')
.should('be.visible')
.rightclick()
cy.get('.p-Menu > ul > .p-Menu-item')
.should('be.visible')
Expand All @@ -129,6 +144,7 @@ context('Permission Manager', () => {

it('should let us delete a group', () => {
cy.get('[node-id$=group\\/cy-group]')
.should('be.visible')
.rightclick()
cy.get('[data-command="fusion.delete-group"]')
.click()
Expand Down
Loading