mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Functional browser tests: update history options tests
This commit is contained in:
@@ -114,8 +114,15 @@ spaceghost.then( function(){
|
||||
this.test.assertDoesntExist( '#' + testUploadInfo.hdaElement.attributes.id,
|
||||
"Deleted HDA is not in the DOM (using history options -> " + includeDeletedOptionsLabel + ")" );
|
||||
});
|
||||
});
|
||||
|
||||
spaceghost.then( function(){
|
||||
// undelete the uploaded file
|
||||
this.historypanel.undeleteHda( '#' + testUploadInfo.hdaElement.attributes.id );
|
||||
this.historyoptions.includeDeleted( function(){
|
||||
this.historypanel.undeleteHda( '#' + testUploadInfo.hdaElement.attributes.id );
|
||||
spaceghost.debug( 'undeleted' );
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------- hidden hdas aren't shown
|
||||
@@ -132,10 +139,8 @@ spaceghost.then( function(){
|
||||
|
||||
this.historyoptions.collapseExpanded( function(){
|
||||
var uploadedSelector = '#' + testUploadInfo.hdaElement.attributes.id;
|
||||
this.withHistoryPanel( function(){
|
||||
this.test.assertNotVisible( uploadedSelector + ' ' + this.historypanel.data.selectors.hda.body,
|
||||
"Body for uploaded file is not visible" );
|
||||
});
|
||||
this.test.assertNotVisible( uploadedSelector + ' ' + this.historypanel.data.selectors.hda.body,
|
||||
"Body for uploaded file is not visible" );
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -34,8 +34,11 @@ var xpath = require( 'casper' ).selectXPath;
|
||||
* @returns {Any} the return value of fn
|
||||
*/
|
||||
HistoryOptions.prototype.openMenu = function openMenu( fn ){
|
||||
|
||||
return this.spaceghost.jumpToTop( function(){
|
||||
this.click( this.historyoptions.data.selectors.button );
|
||||
if( !spaceghost.visible( this.historyoptions.data.selectors.menu ) ){
|
||||
this.click( this.historyoptions.data.selectors.button );
|
||||
}
|
||||
return fn.call( this );
|
||||
});
|
||||
};
|
||||
@@ -170,41 +173,32 @@ HistoryOptions.prototype.collapseExpanded = function collapseExpanded( then ){
|
||||
* @param {Function} then casper step to run when option is set
|
||||
*/
|
||||
HistoryOptions.prototype.includeDeleted = function includeDeleted( then ){
|
||||
return this.spaceghost.then( function(){
|
||||
this.historyoptions.toggle( this.historyoptions.data.labels.options.includeDeleted, true );
|
||||
this.historypanel.waitForHdas( then );
|
||||
});
|
||||
this.toggle( this.data.labels.options.includeDeleted, true );
|
||||
this.spaceghost.historypanel.waitForHdas( then );
|
||||
};
|
||||
|
||||
/** set 'Include Deleted Datasets' to off
|
||||
* @param {Function} then casper step to run when option is set
|
||||
*/
|
||||
HistoryOptions.prototype.excludeDeleted = function excludeDeleted( then ){
|
||||
return this.spaceghost.then( function(){
|
||||
this.historyoptions.toggle( this.historyoptions.data.labels.options.includeDeleted, false );
|
||||
//TODO:?? this puts in the history frame. Is that what we want?
|
||||
this.historypanel.waitForHdas( then );
|
||||
});
|
||||
this.toggle( this.data.labels.options.includeDeleted, false );
|
||||
this.spaceghost.historypanel.waitForHdas( then );
|
||||
};
|
||||
|
||||
/** set 'Include Hidden Datasets' to on
|
||||
* @param {Function} then casper step to run when option is set
|
||||
*/
|
||||
HistoryOptions.prototype.includeHidden = function includeHidden( then ){
|
||||
return this.spaceghost.then( function(){
|
||||
this.historyoptions.toggle( this.historyoptions.data.labels.options.includeHidden, true );
|
||||
this.historypanel.waitForHdas( then );
|
||||
});
|
||||
this.toggle( this.data.labels.options.includeHidden, true );
|
||||
this.spaceghost.historypanel.waitForHdas( then );
|
||||
};
|
||||
|
||||
/** set 'Include Hidden Datasets' to off
|
||||
* @param {Function} then casper step to run when option is set
|
||||
*/
|
||||
HistoryOptions.prototype.excludeHidden = function excludeHidden( then ){
|
||||
return this.spaceghost.then( function(){
|
||||
this.historyoptions.toggle( this.historyoptions.data.labels.options.includeHidden, false );
|
||||
this.historypanel.waitForHdas( then );
|
||||
});
|
||||
this.toggle( this.data.labels.options.includeHidden, false );
|
||||
this.spaceghost.historypanel.waitForHdas( then );
|
||||
};
|
||||
|
||||
|
||||
@@ -213,14 +207,14 @@ HistoryOptions.prototype.excludeHidden = function excludeHidden( then ){
|
||||
HistoryOptions.prototype.data = {
|
||||
selectors : {
|
||||
button : '#history-options-button',
|
||||
buttonIcon : '#history-options-button span.fa-icon-cog',
|
||||
buttonIcon : '#history-options-button span.fa-cog',
|
||||
menu : '#history-options-button-menu',
|
||||
optionXpathByLabelFn : function optionXpathByLabelFn( label ){
|
||||
return xpath( '//ul[@id="history-options-button-menu"]/li/a[text()[contains(.,"' + label + '")]]' );
|
||||
},
|
||||
optionIsOnXpathByLabelFn : function optionIsOnXpathByLabelFn( label ){
|
||||
return xpath( '//ul[@id="history-options-button-menu"]/li/a[text()[contains(.,"' + label + '")]]'
|
||||
+ '/span[@class="fa-icon-ok"]' );
|
||||
+ '/span[@class="fa fa-check"]' );
|
||||
}
|
||||
},
|
||||
labels : {
|
||||
|
||||
@@ -271,7 +271,7 @@ HistoryPanel.prototype.deleteHda = function deleteHda( hdaSelector, whenDeletedF
|
||||
*/
|
||||
HistoryPanel.prototype.undeleteHda = function undeleteHda( hdaSelector, whenUndeletedFn ){
|
||||
this.spaceghost.historyoptions.includeDeleted( function(){
|
||||
this.click( hdaSelector + ' ' + this.historypanel.data.selectors.history.undeleteLink );
|
||||
this.click( hdaSelector + ' ' + this.historypanel.data.selectors.hda.undeleteLink );
|
||||
this.historyoptions.excludeDeleted( function(){
|
||||
this.info( 'hda undeleted: ' + hdaSelector );
|
||||
if( utils.isFunction( whenUndeletedFn ) ){ whenUndeletedFn.call( this ); }
|
||||
@@ -338,7 +338,6 @@ HistoryPanel.prototype.data = {
|
||||
annoArea : '.history-controls .annotation-display',
|
||||
emptyMsg : '.empty-history-message',
|
||||
hdaContainer: '.datasets-list'
|
||||
//undeleteLink : '.historyItemUndelete',
|
||||
},
|
||||
hda : {
|
||||
wrapper : {
|
||||
@@ -361,6 +360,9 @@ HistoryPanel.prototype.data = {
|
||||
primaryActionButtons : '.dataset-actions .left',
|
||||
secondaryActionButtons : '.dataset-actions .right',
|
||||
|
||||
undeleteLink : '.dataset-undelete',
|
||||
purgeLink : '.dataset-purge',
|
||||
|
||||
peek : '.dataset-peek'
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user