diff --git a/src/app/network-optin/index.jade b/src/app/network-optin/index.jade index c0b48bdd386..8f79903e6f8 100644 --- a/src/app/network-optin/index.jade +++ b/src/app/network-optin/index.jade @@ -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. diff --git a/src/internal-packages/server-stats/lib/component/current-op-component.jsx b/src/internal-packages/server-stats/lib/component/current-op-component.jsx index 4d08042aaad..e098fdf4d14 100644 --- a/src/internal-packages/server-stats/lib/component/current-op-component.jsx +++ b/src/internal-packages/server-stats/lib/component/current-op-component.jsx @@ -106,7 +106,11 @@ class CurrentOpComponent extends React.Component {

Slowest Operations

-
✔ No Slow Operations
+
+ ✔ No Slow Operations +
); } diff --git a/src/internal-packages/server-stats/lib/component/time-and-pause-button.jsx b/src/internal-packages/server-stats/lib/component/time-and-pause-button.jsx index 347edcfbe7d..1a960a285c8 100644 --- a/src/internal-packages/server-stats/lib/component/time-and-pause-button.jsx +++ b/src/internal-packages/server-stats/lib/component/time-and-pause-button.jsx @@ -20,8 +20,26 @@ class TimeAndPauseButton extends React.Component { render() { return (
- - + +
00:00:00
); diff --git a/test/compass-functional.test.js b/test/compass-functional.test.js index 38fe254fc63..227c66b4670 100644 --- a/test/compass-functional.test.js +++ b/test/compass-functional.test.js @@ -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'); }); @@ -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'); + }); }); }); diff --git a/test/support/spectron-support.js b/test/support/spectron-support.js index 6db86e893c5..221066959ce 100644 --- a/test/support/spectron-support.js +++ b/test/support/spectron-support.js @@ -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. * @@ -282,7 +330,7 @@ function addClickCommands(client) { return this.getText('div[data-hook=optin-container]').then(function(text) { return text.length === 0; }); - }); + }, TIMEOUT); }); /** @@ -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. */