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
10 changes: 5 additions & 5 deletions src/app/network-optin/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@
ul
li
label
input(type='checkbox', name='enableFeedbackPanel', data-hook='product-feedback-checkbox')
input(type='checkbox', name='enableFeedbackPanel', data-hook='product-feedback-checkbox', data-test-id='product-feedback-checkbox')
span Enable Product Feedback Tool
p.option-description Enables a tool for sending feedback or talking to our Product and Development teams directly from Compass.

li
label
input(type='checkbox', name='enableMaps', data-hook='enable-maps-checkbox')
input(type='checkbox', name='enableMaps', data-hook='enable-maps-checkbox', data-test-id='enable-maps-checkbox')
span Enable Geographic Visualizations
p.option-description Allow Compass to make requests to a 3rd party mapping service.

li
label
input(type='checkbox', name='trackErrors', data-hook='track-errors-checkbox')
input(type='checkbox', name='trackErrors', data-hook='track-errors-checkbox' data-test-id='track-errors-checkbox')
span Enable Crash Reports
p.option-description Allow Compass to send crash reports containing stack traces and unhandled exceptions.

li
label
input(type='checkbox', name='trackUsageStatistics', data-hook='usage-stats-checkbox')
input(type='checkbox', name='trackUsageStatistics', data-hook='usage-stats-checkbox', data-test-id='usage-stats-checkbox')
span Enable Usage Statistics
p.option-description Allow Compass to send anonymous usage statistics.

li
label
input(type='checkbox', name='autoUpdates', data-hook='auto-updates-checkbox')
input(type='checkbox', name='autoUpdates', data-hook='auto-updates-checkbox', data-test-id='auto-updates-checkbox')
span Enable Automatic Updates
p.option-description Allow Compass to periodically check for new updates.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ class CurrentOpComponent extends React.Component {
<header className="rt-lists__header">
<h2 className="rt-lists__headerlabel">Slowest Operations</h2>
</header>
<div className="rt-lists__empty-error">&#10004; No Slow Operations</div>
<div
data-test-id="no-slow-operations"
className="rt-lists__empty-error">
&#10004; No Slow Operations
</div>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,26 @@ class TimeAndPauseButton extends React.Component {
render() {
return (
<div className="time-and-pause action-bar">
<button onClick={this.handlePause.bind(this)} className="play btn btn-xs btn-primary" style={{display: this.state.paused ? null : 'none'}}><text className="playbutton"><i className="fa fa-play"></i>PLAY</text></button>
<button onClick={this.handlePause.bind(this)} className="pause btn btn-default btn-xs" style={{display: this.state.paused ? 'none' : null}}><text className="pausebutton"><i className="fa fa-pause"></i>PAUSE</text></button>
<button
onClick={this.handlePause.bind(this)}
className="play btn btn-xs btn-primary"
data-test-id="performance-play"
style={{display: this.state.paused ? null : 'none'}}>
<text className="playbutton">
<i className="fa fa-play"></i>
PLAY
</text>
</button>
<button
onClick={this.handlePause.bind(this)}
className="pause btn btn-default btn-xs"
data-test-id="performance-pause"
style={{display: this.state.paused ? 'none' : null}}>
<text className="pausebutton">
<i className="fa fa-pause"></i>
PAUSE
</text>
</button>
<div className="time"><text className="currentTime">00:00:00</text></div>
</div>
);
Expand Down
55 changes: 51 additions & 4 deletions test/compass-functional.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ describe('Compass Functional Test Suite #spectron', function() {
return client
.clickCloseFeatureTourButton()
.waitForPrivacySettingsModal()
.clickEnableProductFeedbackCheckbox()
.clickEnableCrashReportsCheckbox()
.clickEnableUsageStatsCheckbox()
.clickEnableAutoUpdatesCheckbox()
.getModalTitle()
.should.eventually.equal('Privacy Settings');
});
Expand Down Expand Up @@ -151,12 +155,55 @@ describe('Compass Functional Test Suite #spectron', function() {
.should.eventually.equal('0');
});

it('renders the network graph');
it('renders the memory graph');
it('renders the hottest collections');
it('renders the slow operations');
it('renders the network bytes in', function() {
return client
.getNetworkBytesIn()
.should.eventually.not.equal(null);
});

it('renders the network bytes out', function() {
return client
.getNetworkBytesOut()
.should.eventually.not.equal(null);
});

it('renders the network connections', function() {
return client
.getNetworkConnections()
.should.eventually.equal('5');
});

it('renders the memory vsize', function() {
return client
.getMemoryVSize()
.should.eventually.not.equal(null);
});

it('renders the memory resident size', function() {
return client
.getMemoryResident()
.should.eventually.not.equal(null);
});

it('renders the memory mapped size', function() {
return client
.getMemoryMapped()
.should.eventually.not.equal(null);
});

it('renders the slow operations', function() {
return client
.getSlowestOperations()
.should.eventually.include('No Slow Operations');
});

context('when pausing the performance tab', function() {
it('pauses the performance tab', function() {
return client
.clickPerformancePauseButton()
.getSlowestOperations()
.should.eventually.include('No Slow Operations');
});
});
});

Expand Down
106 changes: 105 additions & 1 deletion test/support/spectron-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,54 @@ function addWaitCommands(client) {
*/
function addClickCommands(client) {

/**
* Click the enable product feedback checkbox.
*/
client.addCommand('clickEnableProductFeedbackCheckbox', function() {
const checkbox = selector('product-feedback-checkbox');
return this.waitForVisible(checkbox, TIMEOUT).click(checkbox);
});

/**
* Click the enable geo viz checkbox.
*/
client.addCommand('clickEnableGeoCheckbox', function() {
const checkbox = selector('enable-maps-checkbox');
return this.waitForVisible(checkbox, TIMEOUT).click(checkbox);
});

/**
* Click the enable crash reports checkbox.
*/
client.addCommand('clickEnableCrashReportsCheckbox', function() {
const checkbox = selector('track-errors-checkbox');
return this.waitForVisible(checkbox, TIMEOUT).click(checkbox);
});

/**
* Click the enable usage stats checkbox.
*/
client.addCommand('clickEnableUsageStatsCheckbox', function() {
const checkbox = selector('usage-stats-checkbox');
return this.waitForVisible(checkbox, TIMEOUT).click(checkbox);
});

/**
* Click the enable auto updates checkbox.
*/
client.addCommand('clickEnableAutoUpdatesCheckbox', function() {
const checkbox = selector('auto-updates-checkbox');
return this.waitForVisible(checkbox, TIMEOUT).click(checkbox);
});

/**
* click the pause button the performance tab.
*/
client.addCommand('clickPerformancePauseButton', function() {
const button = selector('performance-pause');
return this.waitForVisible(button, TIMEOUT).click(button);
});

/**
* Click the LAST delete database trash icon in the list.
*
Expand Down Expand Up @@ -282,7 +330,7 @@ function addClickCommands(client) {
return this.getText('div[data-hook=optin-container]').then(function(text) {
return text.length === 0;
});
});
}, TIMEOUT);
});

/**
Expand Down Expand Up @@ -559,6 +607,62 @@ function addClickCommands(client) {
*/
function addGetCommands(client) {

/**
* Get the slow operations list.
*/
client.addCommand('getSlowestOperations', function() {
const base = selector('no-slow-operations');
return this.waitForVisible(base, TIMEOUT).getText(base);
});

/**
* Get the memory vsize from the memory graph.
*/
client.addCommand('getMemoryVSize', function() {
const base = selector('performance-virtual');
return this.waitForVisible(base, TIMEOUT).getText(base);
});

/**
* Get the memory resident out from the memory graph.
*/
client.addCommand('getMemoryResident', function() {
const base = selector('performance-resident');
return this.waitForVisible(base, TIMEOUT).getText(base);
});

/**
* Get the memory mapped from the memory graph.
*/
client.addCommand('getMemoryMapped', function() {
const base = selector('performance-mapped');
return this.waitForVisible(base, TIMEOUT).getText(base);
});

/**
* Get the network bytes in from the network graph.
*/
client.addCommand('getNetworkBytesIn', function() {
const base = selector('performance-bytesIn');
return this.waitForVisible(base, TIMEOUT).getText(base);
});

/**
* Get the network bytes out from the network graph.
*/
client.addCommand('getNetworkBytesOut', function() {
const base = selector('performance-bytesOut');
return this.waitForVisible(base, TIMEOUT).getText(base);
});

/**
* Get the network connections from the network graph.
*/
client.addCommand('getNetworkConnections', function() {
const base = selector('performance-connections');
return this.waitForVisible(base, TIMEOUT).getText(base);
});

/**
* Get active reads count from the read & write graph.
*/
Expand Down