From bc9972bae27d9b24904744c280c9d52f873d43d2 Mon Sep 17 00:00:00 2001 From: carlfeberhard Date: Mon, 19 Oct 2015 15:45:13 -0400 Subject: [PATCH] Testing: update casperjs functional tests; change expected size string; remove nice_size from expected history api keys; remove test for rerun button on uploaded dataset; attempt to fix linux+python unicode error in hda api tests --- test/casperjs/anon-history-tests.js | 2 +- test/casperjs/api-hda-tests.js | 2 +- test/casperjs/api-history-tests.js | 2 +- test/casperjs/hda-state-tests.js | 4 ++-- test/casperjs/history-panel-tests.js | 11 ++++++----- test/casperjs/modules/historypanel.js | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/test/casperjs/anon-history-tests.js b/test/casperjs/anon-history-tests.js index e2b2ccd0566..80e16a16f87 100644 --- a/test/casperjs/anon-history-tests.js +++ b/test/casperjs/anon-history-tests.js @@ -40,7 +40,7 @@ spaceghost.test.begin( 'Testing histories for anonymous users', 0, function suit this.test.assertVisible( nameSelector, 'History name is visible' ); this.test.assertSelectorHasText( nameSelector, unnamedName, 'History name is ' + unnamedName ); - this.test.comment( "history should display size and size should be 0 bytes" ); + this.test.comment( "history should display size and size should be " + initialSizeStr ); this.test.assertExists( sizeSelector, 'Found ' + sizeSelector ); this.test.assertVisible( sizeSelector, 'History size is visible' ); this.test.assertSelectorHasText( sizeSelector, initialSizeStr, diff --git a/test/casperjs/api-hda-tests.js b/test/casperjs/api-hda-tests.js index 882cd2c144e..8f0395a9567 100644 --- a/test/casperjs/api-hda-tests.js +++ b/test/casperjs/api-hda-tests.js @@ -124,7 +124,7 @@ spaceghost.test.begin( 'Test the HDA API', 0, function suite( test ){ //this.test.comment( 'update should sanitize any new name' ); this.test.comment( 'update should allow unicode in names' ); - var unicodeName = 'Ржевский сапоги'; + var unicodeName = 'ржевский сапоги'; returned = this.api.hdas.update( lastHistory.id, firstHda.id, { name : unicodeName }); diff --git a/test/casperjs/api-history-tests.js b/test/casperjs/api-history-tests.js index d97063cc739..31fdc2afa65 100644 --- a/test/casperjs/api-history-tests.js +++ b/test/casperjs/api-history-tests.js @@ -37,7 +37,7 @@ spaceghost.openHomePage().then( function(){ var historyShow = this.api.histories.show( firstHistory.id ); //this.debug( this.jsonStr( historyShow ) ); this.test.assert( this.hasKeys( historyShow, [ - 'id', 'name', 'annotation', 'nice_size', 'contents_url', + 'id', 'name', 'annotation', 'size', 'contents_url', 'state', 'state_details', 'state_ids' ]), 'Has the proper keys' ); diff --git a/test/casperjs/hda-state-tests.js b/test/casperjs/hda-state-tests.js index 3e13fac90ca..e1584885dec 100644 --- a/test/casperjs/hda-state-tests.js +++ b/test/casperjs/hda-state-tests.js @@ -173,8 +173,8 @@ spaceghost.test.begin( 'Test the form of various HDA states', 0, function suite( // different states, datatypes will have different action buttons testIconButton.call( this, hdaDbId, buttonsSelector, 'info', this.historypanel.data.hdaPrimaryActionButtons.info ); - testIconButton.call( this, hdaDbId, buttonsSelector, 'rerun', - this.historypanel.data.hdaPrimaryActionButtons.rerun ); + // testIconButton.call( this, hdaDbId, buttonsSelector, 'rerun', + // this.historypanel.data.hdaPrimaryActionButtons.rerun ); //TODO: move to testDownloadButton as its own step if( !expectedMetadataFiles ){ diff --git a/test/casperjs/history-panel-tests.js b/test/casperjs/history-panel-tests.js index 9e78b3b7fd7..bf6488b9a48 100644 --- a/test/casperjs/history-panel-tests.js +++ b/test/casperjs/history-panel-tests.js @@ -33,12 +33,13 @@ spaceghost.test.begin( 'Testing the form of the main/current history panel', 0, annoIconSelector = spaceghost.historypanel.data.selectors.history.annoIcon, emptyMsgSelector = spaceghost.historypanel.data.selectors.history.emptyMsg, emptyMsgStr = spaceghost.historypanel.data.text.history.emptyMsg, - tagAreaSelector = spaceghost.historypanel.data.selectors.history.tagArea, - annoAreaSelector = spaceghost.historypanel.data.selectors.history.annoArea, + tagAreaSelector = spaceghost.historypanel.data.selectors.history.tagArea, + annoAreaSelector = spaceghost.historypanel.data.selectors.history.annoArea, nameTooltip = spaceghost.historypanel.data.text.history.tooltips.name, refreshButtonSelector = 'a#history-refresh-button', - refreshButtonIconSelector = 'span.fa-refresh'; + refreshButtonIconSelector = 'span.fa-refresh', + bytesString = 'b'; // local var newHistoryName = "Test History", @@ -145,8 +146,8 @@ spaceghost.test.begin( 'Testing the form of the main/current history panel', 0, this.test.assertSelectorHasText( nameSelector, newHistoryName, 'History name is ' + newHistoryName ); var onetxtFilesize = require( 'fs' ).size( filepathToUpload ), - expectedSize = onetxtFilesize + ' bytes'; - this.test.comment( "history should display size and size should be " + onetxtFilesize + " bytes" ); + expectedSize = onetxtFilesize + ' ' + bytesString; + this.test.comment( "history should display size and size should be " + onetxtFilesize + " " + bytesString ); this.test.assertExists( sizeSelector, 'Found ' + sizeSelector ); this.test.assertVisible( sizeSelector, 'History size is visible' ); this.test.assertSelectorHasText( sizeSelector, expectedSize, diff --git a/test/casperjs/modules/historypanel.js b/test/casperjs/modules/historypanel.js index 0067a2d01a2..963bafd340e 100644 --- a/test/casperjs/modules/historypanel.js +++ b/test/casperjs/modules/historypanel.js @@ -414,7 +414,7 @@ HistoryPanel.prototype.data = { annoIcon : 'Edit history annotation' }, newName : 'Unnamed history', - newSize : '0 bytes', + newSize : '0 b', emptyMsg : "This history is empty. You can load your own data or get data from an external source" }, hda : {