Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
4d1c5fe
noop
pzrq Mar 13, 2017
4b72672
Revert "noop"
pzrq Sep 28, 2017
cf19884
noop
pzrq Mar 13, 2017
1e85079
Revert "noop"
pzrq Sep 28, 2017
74f2eb3
noop
pzrq Mar 13, 2017
e4e5b6e
Revert "noop"
pzrq Sep 28, 2017
4c458ab
noop
pzrq Mar 13, 2017
8c50a21
Revert "noop"
pzrq Sep 28, 2017
502f15a
noop
pzrq Mar 13, 2017
1f12d18
Revert "noop"
pzrq Sep 28, 2017
40d54e4
:fire: Remove #databases dropDatabase('music') call
pzrq Sep 28, 2017
4c11032
Add logging statements around data-service
pzrq Sep 28, 2017
3424626
noop
pzrq Mar 13, 2017
a9967d0
Revert "noop"
pzrq Sep 28, 2017
14bef70
noop
pzrq Mar 13, 2017
5034b66
Revert "noop"
pzrq Sep 28, 2017
4a5f6ac
noop
pzrq Mar 13, 2017
4bf7852
Revert "noop"
pzrq Sep 28, 2017
b699442
noop
pzrq Mar 13, 2017
c1b0258
Revert "noop"
pzrq Sep 28, 2017
e8282dc
noop
pzrq Mar 13, 2017
2e3409a
Revert "noop"
pzrq Sep 28, 2017
2c37049
Revert "Add logging statements around data-service"
pzrq Sep 28, 2017
3f21f17
:bug: Handle the case where app is undefined
pzrq Sep 29, 2017
ab80fcf
:construction: Add DEBUG for just the functional tests
pzrq Sep 29, 2017
83d6da6
:bug: Handle app null as well as undefined
pzrq Sep 29, 2017
c869fd8
:construction: Try timing launchCompass
pzrq Sep 29, 2017
6a8b68e
:construction: More timing
pzrq Sep 29, 2017
85088c1
:construction: Increase timeouts
pzrq Sep 29, 2017
829b7fc
noop
pzrq Mar 13, 2017
efbf105
Revert "noop"
pzrq Sep 28, 2017
9462448
:construction: Add even more logging
pzrq Sep 29, 2017
72b68a6
:construction: Add 'ps ax' calls
pzrq Sep 29, 2017
15850d8
:construction: Switch to 'ps -ef'
pzrq Sep 29, 2017
f329558
:construction: Drop .waitForStatusBar()
pzrq Sep 29, 2017
023b0ab
Revert ":construction: Drop .waitForStatusBar()"
pzrq Sep 29, 2017
a751c06
Revert ":construction: Increase timeouts"
pzrq Sep 29, 2017
6d8d66b
:construction: Add `top -n1` output too
pzrq Sep 29, 2017
3f35b81
Revert ":construction: Add `top -n1` output too"
pzrq Sep 29, 2017
6ffcc2c
:construction: Try clearing out possibly hanging electron-chromedrive…
pzrq Sep 29, 2017
28a2be3
:rotating_light:
pzrq Sep 29, 2017
2539759
:construction: Try container-based infrastructure
pzrq Sep 29, 2017
ba36d2b
noop
pzrq Mar 13, 2017
acfe44e
Revert "noop"
pzrq Sep 28, 2017
3633358
noop
pzrq Mar 13, 2017
5a955fc
Revert "noop"
pzrq Sep 28, 2017
fa4aab2
noop
pzrq Mar 13, 2017
338f35f
Revert "noop"
pzrq Sep 28, 2017
374c01a
noop
pzrq Mar 13, 2017
66d1bf8
Revert "noop"
pzrq Sep 28, 2017
8c2985f
noop
pzrq Mar 13, 2017
9798eea
Revert "noop"
pzrq Sep 28, 2017
9116c75
:art: Remove clickDatabaseInSidebar/waitForSidebar calls
pzrq Oct 3, 2017
31e01f3
noop
pzrq Mar 13, 2017
7086cb2
Revert "noop"
pzrq Sep 28, 2017
77aea87
noop
pzrq Mar 13, 2017
84975b0
Revert "noop"
pzrq Sep 28, 2017
75cea96
noop
pzrq Mar 13, 2017
15ae586
Revert "noop"
pzrq Sep 28, 2017
433b736
noop
pzrq Mar 13, 2017
ed5a26d
Revert "noop"
pzrq Sep 28, 2017
e9e83bb
noop
pzrq Mar 13, 2017
ae05221
Revert "noop"
pzrq Sep 28, 2017
c12353e
:construction: Add more logging to 'shows a schema on refresh'
pzrq Oct 3, 2017
bf0a6ae
noop
pzrq Mar 13, 2017
c454189
Revert "noop"
pzrq Sep 28, 2017
19c5e11
noop
pzrq Mar 13, 2017
9bf7f4f
Revert "noop"
pzrq Sep 28, 2017
df925e2
noop
pzrq Mar 13, 2017
e09be10
Revert "noop"
pzrq Sep 28, 2017
541a47b
noop
pzrq Mar 13, 2017
704073a
Revert "noop"
pzrq Sep 28, 2017
385dec1
noop
pzrq Mar 13, 2017
51008bf
Revert "noop"
pzrq Sep 28, 2017
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sudo: required
sudo: false
dist: trusty
language: node_js
node_js:
Expand All @@ -24,7 +24,7 @@ before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm run check
script: npm run test
script: DEBUG=* npm run test -- --functional
cache:
directories:
- $HOME/.electron
Expand Down
2 changes: 1 addition & 1 deletion test/functional/collections.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Connection = require('mongodb-connection-model');
const DataService = require('mongodb-data-service');
const { launchCompass, quitCompass} = require('./support/spectron-support');
const { launchCompass, quitCompass } = require('./support/spectron-support');

/**
* Global connection model for this test.
Expand Down
9 changes: 0 additions & 9 deletions test/functional/databases.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@ describe('#databases', function() {
});
});

after(function(done) {
dataService.connect(function() {
dataService.dropDatabase('music', function() {
dataService.disconnect();
done();
});
});
});

context('when the escape key is pressed', function() {
it('closes the create databases modal', function() {
return client
Expand Down
2 changes: 0 additions & 2 deletions test/functional/schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ describe('#schema', function() {

it('shows a schema on refresh', function() {
return client
.clickDatabaseInSidebar('music')
.waitForSidebar('collection')
.goToCollection('music', 'artists')
.clickApplyFilterButtonFromSchemaTab()
.waitForStatusBar()
Expand Down
197 changes: 197 additions & 0 deletions test/functional/support/extracted_dump.txt

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions test/functional/support/packages/spectron-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function addWaitConnectCommands(client) {
* Wait for the connect screen to finish loading.
*/
client.addCommand('waitForConnectView', function() {
console.log('-> waitForConnectView');
return this.waitForVisibleInCompass(selector('connect-form'));
});
}
Expand All @@ -26,6 +27,7 @@ function addClickConnectCommands(client) {
* click the Connect button on the connect screen.
*/
client.addCommand('clickConnectButton', function() {
console.log('-> clickConnectButton');
return this.click(selector('connect-button'));
});
}
Expand All @@ -38,6 +40,7 @@ function addInputConnectCommands(client) {
* @param {Object} model - The connection model.
*/
client.addCommand('inputConnectionDetails', function(model) {
console.log('-> inputConnectionDetails');
const that = this;
let sequence = Promise.resolve();

Expand Down
2 changes: 2 additions & 0 deletions test/functional/support/packages/spectron-database-ddl.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ function addGetDatabaseDDLCommands(client) {
* Gets the human-readable text of the Databases Tab.
*/
client.addCommand('getDatabasesTabText', function() {
console.log('-> getDatabasesTabText');
console.timeEnd('connectToCompass -> getDatabasesTabText');
return this.getText(selector('databases-tab'));
});
}
Expand Down
1 change: 1 addition & 0 deletions test/functional/support/packages/spectron-home.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function addWaitHomeCommands(client) {
* Wait for the home screen to finish loading.
*/
client.addCommand('waitForHomeView', function() {
console.log('-> waitForHomeView');
return this.waitForVisibleInCompass(selector('home-view'));
});
}
Expand Down
2 changes: 2 additions & 0 deletions test/functional/support/packages/spectron-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function addClickSchemaCommands(client) {
* Click the apply filter button from the schema tab.
*/
client.addCommand('clickApplyFilterButtonFromSchemaTab', function() {
console.log('clickApplyFilterButtonFromSchemaTab');
const base = selector('schema-content');
const button = `${base} ${selector('apply-filter-button')}`;
return this.waitForVisibleInCompass(button).click(button);
Expand All @@ -34,6 +35,7 @@ function addGetSchemaCommands(client) {
* Get the sampling message on the schema tab.
*/
client.addCommand('getSamplingMessageFromSchemaTab', function() {
console.log('getSamplingMessageFromSchemaTab');
const base = selector('schema-content');
const div = `${base} .sampling-message`;
return this.waitForVisibleInCompass(div).getText(div);
Expand Down
5 changes: 5 additions & 0 deletions test/functional/support/packages/spectron-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ function addWaitSidebarCommands(client) {
* @param {String} type - One of database or collection.
*/
client.addCommand('waitForSidebar', function(type) {
console.log('waitForSidebar');
return this.waitForVisibleInCompass(selector('sidebar-' + type));
});

/**
* Wait for the instance refresh to finish.
*/
client.addCommand('waitForInstanceRefresh', function() {
console.log('waitForInstanceRefresh');
const button = selector('instance-refresh-button');
const icon = `${button} i.fa-spin`;
return this.waitForVisibleInCompass(icon, true);
Expand All @@ -35,6 +37,7 @@ function addClickSidebarCommands(client) {
* Click the instance refresh button in the top right corner of the sidebar.
*/
client.addCommand('clickInstanceRefreshIcon', function() {
console.log('clickInstanceRefreshIcon');
const button = selector('instance-refresh-button');
return this
.waitForVisibleInCompass(button).click(button);
Expand All @@ -46,6 +49,7 @@ function addClickSidebarCommands(client) {
* @param {String} name - The full collection name.
*/
client.addCommand('clickCollectionInSidebar', function(name) {
console.log('clickCollectionInSidebar');
const base = `${selector('sidebar-collection')}[title='${name}']`;
return this.waitForVisibleInCompass(base).click(base);
});
Expand All @@ -56,6 +60,7 @@ function addClickSidebarCommands(client) {
* @param {String} name - The database name.
*/
client.addCommand('clickDatabaseInSidebar', function(name) {
console.log('clickDatabaseInSidebar');
const base = `${selector('sidebar-database')}[title='${name}']`;
return this.waitForVisibleInCompass(base).click(base);
});
Expand Down
1 change: 1 addition & 0 deletions test/functional/support/packages/spectron-status-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ function addWaitStatusBarCommands(client) {
* Waits for the status bar to finish its progress and unlock the page.
*/
client.addCommand('waitForStatusBar', function() {
console.log('-> waitForStatusBar');
return this.waitForVisibleInCompass('#statusbar', true);
});
}
Expand Down
3 changes: 3 additions & 0 deletions test/functional/support/packages/spectron-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ function addWorkflowCommands(client) {
* Connect to Compass
*/
client.addCommand('connectToCompass', function(connection) {
console.timeEnd('launchCompass -> connectToCompass');
console.time('connectToCompass -> getDatabasesTabText');
return this
.waitForConnectView()
.inputConnectionDetails(connection)
Expand All @@ -36,6 +38,7 @@ function addWorkflowCommands(client) {
* Go to collection, assumes refresh is required
*/
client.addCommand('goToCollection', function(database, collection) {
console.log('goToCollection');
return this
.clickInstanceRefreshIcon()
.waitForInstanceRefresh()
Expand Down
50 changes: 47 additions & 3 deletions test/functional/support/spectron-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,69 @@ function addCommands(client) {
addWorkflowCommands(client);
}

const cleanupElectronChromeDriver = () => {
const { spawn } = require('child_process');
const killall = spawn('killall', ['chromedriver']);

killall.stdout.on('data', (data) => {
console.log(`ps stdout: ${data}`);
});

killall.stderr.on('data', (data) => {
console.log(`ps stderr: ${data}`);
});

killall.on('close', (code) => {
if (code !== 0) {
console.log(`ps process exited with code ${code}`);
}
});
};

const printProcessInfo = () => {
// From https://nodejs.org/docs/latest/api/child_process.html#child_process_class_childprocess
const { spawn } = require('child_process');
const ps = spawn('ps', ['-ef']);

ps.stdout.on('data', (data) => {
console.log(`ps stdout: ${data}`);
});

ps.stderr.on('data', (data) => {
console.log(`ps stderr: ${data}`);
});

ps.on('close', (code) => {
if (code !== 0) {
console.log(`ps process exited with code ${code}`);
}
});
};

/**
* Call launchCompass in beforeEach for all UI tests:
*
* @returns {Promise} Promise that resolves when app starts.
*/
function launchCompass() {
printProcessInfo();
cleanupElectronChromeDriver();
console.time('launchCompass -> connectToCompass');
return new App(ROOT).launch(addCommands);
}

/**
* Call quitCompass in afterEach for all UI tests:

* @param {Object} app - The running application
* @param {Function} done - The callback to execute when finished.
*
* @returns {Promise} Promise that resolves when app stops.
* @returns {Promise} Promise that resolves when app stops or is undefined.
*/
function quitCompass(app) {
return app.quit();
if (app === undefined || app === null) {
return Promise.resolve().then(printProcessInfo).then(cleanupElectronChromeDriver);
}
return app.quit().then(printProcessInfo).then(cleanupElectronChromeDriver);
}

/**
Expand Down