commit/galaxy-central: carlfeberhard: Functional browser tests: update anon history tests
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/8ee5977b2173/ Changeset: 8ee5977b2173 User: carlfeberhard Date: 2014-01-08 21:06:57 Summary: Functional browser tests: update anon history tests Affected #: 3 files diff -r 83cbc7f1768231d92ee26604d1b03b8650f020a6 -r 8ee5977b21731ee1815995bbcc290b09a46a13cc test/casperjs/anon-history-tests.js --- a/test/casperjs/anon-history-tests.js +++ b/test/casperjs/anon-history-tests.js @@ -54,7 +54,8 @@ anonNameTooltip = spaceghost.historypanel.data.text.anonymous.tooltips.name; var historyFrameInfo = {}, - filepathToUpload = '../../test-data/1.txt', + filenameToUpload = '1.txt', + filepathToUpload = '../../test-data/' + filenameToUpload, testUploadInfo = {}; @@ -71,10 +72,6 @@ spaceghost.historypanel.waitForHdas( function testPanelStructure(){ this.test.comment( 'history panel for anonymous user, new history' ); - this.test.comment( "frame should have proper url and title: 'History'" ); - this.test.assertMatch( this.getCurrentUrl(), /\/history/, 'Found history frame url' ); - this.test.assertTitle( this.getTitle(), 'History', 'Found history frame title' ); - this.test.comment( "history name should exist, be visible, and have text " + unnamedName ); this.test.assertExists( nameSelector, nameSelector + ' exists' ); this.test.assertVisible( nameSelector, 'History name is visible' ); @@ -96,11 +93,6 @@ this.test.assertSelectorHasText( emptyMsgSelector, emptyMsgStr, 'Message contains "' + emptyMsgStr + '"' ); - this.test.comment( 'name should have a tooltip with info on anon-user name editing' ); - this.historypanel.hoverOver( nameSelector ); - this.test.assertExists( tooltipSelector, "Found tooltip after name hover" ); - this.test.assertSelectorHasText( tooltipSelector, anonNameTooltip ); - this.test.comment( 'name should NOT be editable when clicked by anon-user' ); this.assertDoesntHaveClass( nameSelector, editableTextClass, "Name field is not classed as editable text" ); this.click( nameSelector ); @@ -115,10 +107,11 @@ this.debug( 'uploaded HDA info: ' + this.jsonStr( this.quickInfo( _uploadInfo.hdaElement ) ) ); var hasHda = _uploadInfo.hdaElement, hasClass = _uploadInfo.hdaElement.attributes[ 'class' ], - hasOkClass = _uploadInfo.hdaElement.attributes[ 'class' ].indexOf( 'historyItem-ok' ) !== -1; + hasOkClass = _uploadInfo.hdaElement.attributes[ 'class' ].indexOf( 'state-ok' ) !== -1; this.test.assert( ( hasHda && hasClass && hasOkClass ), "Uploaded file: " + _uploadInfo.hdaElement.text ); testUploadInfo = _uploadInfo; }); + }); spaceghost.then( function testAnonUpload(){ this.test.comment( "empty should be NO LONGER be displayed" ); @@ -136,7 +129,7 @@ this.test.assert( loggedInAs === email, 'loggedInAs() matches email: "' + loggedInAs + '"' ); this.historypanel.waitForHdas( function(){ - var hdaInfo = this.historypanel.hdaElementInfoByTitle( testUploadInfo.hdaElement.text ); + var hdaInfo = this.historypanel.hdaElementInfoByTitle( filenameToUpload ); this.test.assert( hdaInfo !== null, "After logging in - found a matching hda by name and hid" ); if( hdaInfo ){ this.test.assert( testUploadInfo.hdaElement.attributes.id === hdaInfo.attributes.id, diff -r 83cbc7f1768231d92ee26604d1b03b8650f020a6 -r 8ee5977b21731ee1815995bbcc290b09a46a13cc test/casperjs/modules/historypanel.js --- a/test/casperjs/modules/historypanel.js +++ b/test/casperjs/modules/historypanel.js @@ -33,33 +33,16 @@ // =================================================================== API (external) // ------------------------------------------------------------------- frame control -///** Is casper currently 'in' the history frame? -// * @returns {Boolean} +///** Hover over an element in the history panel. +// * @param {String} selector a css or xpath selector for an historyItemWrapper // */ -//HistoryPanel.prototype.inFrame = function inFrame(){ -// return ( ( this.spaceghost.page.frameName === this.spaceghost.data.selectors.frames.history ) -// && ( this.spaceghost.page.frameTitle === this.data.text.frameTitle ) ); +//HistoryPanel.prototype.hoverOver = function hoverOver( selector ){ +// var spaceghost = this.spaceghost, +// elementInfo = spaceghost.getElementInfo( selector ); +// spaceghost.page.sendEvent( 'mousemove', elementInfo.x + 1, elementInfo.y + 1 ); +// return spaceghost; //}; -/** Hover over an element in the history panel. - * @param {String} selector a css or xpath selector for an historyItemWrapper - */ -HistoryPanel.prototype.hoverOver = function hoverOver( selector ){ - var spaceghost = this.spaceghost, - historyFrameInfo = spaceghost.jumpToTop( function(){ - return spaceghost.getElementInfo( 'iframe[name="galaxy_history"]' ); - }); - //spaceghost.debug( 'historyFrameInfo:\n' + spaceghost.jsonStr( historyFrameInfo ) ); - - spaceghost.jumpToHistory( function(){ - var elementInfo = spaceghost.getElementInfo( selector ), - newCoords = { x: ( historyFrameInfo.x + elementInfo.x ), - y: ( historyFrameInfo.y + elementInfo.y ) }; - spaceghost.page.sendEvent( 'mousemove', newCoords.x + 1, newCoords.y + 1 ); - }); - return spaceghost; -}; - // ------------------------------------------------------------------- hdas ///** Parse the hid and name from an HDA title. // * NOTE: if more than one is found, will return the first found. diff -r 83cbc7f1768231d92ee26604d1b03b8650f020a6 -r 8ee5977b21731ee1815995bbcc290b09a46a13cc test/casperjs/modules/tools.js --- a/test/casperjs/modules/tools.js +++ b/test/casperjs/modules/tools.js @@ -89,9 +89,11 @@ // click the upload tool spaceghost.thenOpen( spaceghost.baseUrl, function(){ // we can apprently click a tool label without expanding the tool container for it - this.click( xpath( '//a[contains(text(),"Upload File")]' ) ); - this.jumpToMain( function(){ - this.waitForSelector( 'body' ); + this.waitForSelector( '.toolMenu', function(){ + this.click( xpath( '//a[contains(text(),"Upload File")]' ) ); + this.jumpToMain( function(){ + this.waitForSelector( 'body' ); + }); }); }); Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org