commit/galaxy-central: davebgx: Fix sample tracking functional tests.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/43cf1476a774/ Changeset: 43cf1476a774 User: davebgx Date: 2014-04-29 19:21:28 Summary: Fix sample tracking functional tests. Affected #: 3 files diff -r b67a59a2beca5072eb19ad7c7e20beb40adda8da -r 43cf1476a77405f9890a6b97fe9993c2936650a5 templates/webapps/galaxy/requests/common/edit_samples.mako --- a/templates/webapps/galaxy/requests/common/edit_samples.mako +++ b/templates/webapps/galaxy/requests/common/edit_samples.mako @@ -78,7 +78,7 @@ grid_header = '<h3>Edit Current Samples of Sequencing Request "%s"</h3>' % request.name %> ${render_samples_grid( cntrller, request, displayable_sample_widgets, action='edit_samples', encoded_selected_sample_ids=encoded_selected_sample_ids, render_buttons=False, grid_header=grid_header )} - %if len( sample_operation_select_field.options ) > 1 and not is_unsubmitted: + %if len( sample_operation_select_field.options ) >= 1 and not is_unsubmitted: <div class="form-row" style="background-color:#FAFAFA;"> For selected samples: ${sample_operation_select_field.get_html()} diff -r b67a59a2beca5072eb19ad7c7e20beb40adda8da -r 43cf1476a77405f9890a6b97fe9993c2936650a5 test/base/twilltestcase.py --- a/test/base/twilltestcase.py +++ b/test/base/twilltestcase.py @@ -1633,7 +1633,7 @@ tc.submit( "create_form_button" ) if form_type == "Sequencing Sample Form": tc.submit( "add_layout_grid" ) - tc.fv( "create_form_definition", "grid_layout0", form_layout_name ) + tc.fv( "edit_form_definition", "grid_layout0", form_layout_name ) # if not adding any fields at this time, remove the default empty field if num_fields == 0: tc.submit( "remove_button" ) @@ -1677,9 +1677,9 @@ for check_str in strings_displayed: self.check_page_for_string( check_str ) if new_form_name: - tc.fv( "1", "name", new_form_name ) + tc.fv( "edit_form_definition", "name", new_form_name ) if new_form_desc: - tc.fv( "1", "description", new_form_desc ) + tc.fv( "edit_form_definition", "description", new_form_desc ) for i, field_dict in enumerate( field_dicts ): index = i + field_index tc.submit( "add_field_button" ) @@ -1693,18 +1693,18 @@ field_required_value = field_dict[ 'required' ] field_name = "field_name_%i" % index field_name_value = field_dict.get( 'name', '%i_field_name' % index ) - tc.fv( "1", field_label, field_label_value ) - tc.fv( "1", field_help, field_help_value ) - tc.fv( "1", field_required, field_required_value ) - tc.fv( "1", field_name, field_name_value ) + tc.fv( "edit_form_definition", field_label, field_label_value ) + tc.fv( "edit_form_definition", field_help, field_help_value ) + tc.fv( "edit_form_definition", field_required, field_required_value ) + tc.fv( "edit_form_definition", field_name, field_name_value ) if field_type_value.lower() == 'selectfield': # SelectFields require a refresh_on_change self.refresh_form( field_type, field_type_value ) for option_index, option in enumerate( field_dict[ 'selectlist' ] ): tc.submit( "addoption_%i" % index ) - tc.fv( "1", "field_%i_option_%i" % ( index, option_index ), option ) + tc.fv( "edit_form_definition", "field_%i_option_%i" % ( index, option_index ), option ) else: - tc.fv( "1", field_type, field_type_value ) + tc.fv( "edit_form_definition", field_type, field_type_value ) tc.submit( "save_changes_button" ) for check_str in strings_displayed_after_submit: self.check_page_for_string( check_str ) @@ -1892,20 +1892,22 @@ for check_str in strings_displayed: self.check_page_for_string( check_str ) for sample_index, ( sample_name, target_library_info, sample_field_values ) in enumerate( sample_value_tuples ): - tc.fv( "1", "sample_%i_name" % sample_index, sample_name ) - tc.fv( "1", "sample_%i_library_id" % sample_index, target_library_info[ 'library' ] ) - self.refresh_form( "sample_%i_library_id" % sample_index, target_library_info[ 'library' ] ) + tc.fv( "add_samples", "sample_%i_name" % sample_index, sample_name ) + if target_library_info[ 'library' ] is not None: + tc.fv( "add_samples", "sample_%i_library_id" % sample_index, target_library_info[ 'library' ] ) + self.refresh_form( "sample_%i_library_id" % sample_index, target_library_info[ 'library' ] ) # check if the folder selectfield has been correctly populated for check_str in folder_options: self.check_page_for_string( check_str ) - tc.fv( "1", "sample_%i_folder_id" % sample_index, target_library_info[ 'folder' ] ) + if target_library_info[ 'folder' ] is not None: + tc.fv( "add_samples", "sample_%i_folder_id" % sample_index, target_library_info[ 'folder' ] ) for field_index, field_value in enumerate( sample_field_values ): - tc.fv( "1", "sample_%i_field_%i" % ( sample_index, field_index ), field_value ) + tc.fv( "add_samples", "sample_%i_field_%i" % ( sample_index, field_index ), field_value ) # Do not click on Add sample button when all the sample have been added if sample_index < len( sample_value_tuples ) - 1: tc.submit( "add_sample_button" ) # select the correct form before submitting it - tc.fv( "1", "copy_sample_index", "-1" ) + tc.fv( "add_samples", "copy_sample_index", "-1" ) tc.submit( "save_samples_button" ) for check_str in strings_displayed_after_submit: self.check_page_for_string( check_str ) diff -r b67a59a2beca5072eb19ad7c7e20beb40adda8da -r 43cf1476a77405f9890a6b97fe9993c2936650a5 test/functional/test_sample_tracking.py --- a/test/functional/test_sample_tracking.py +++ b/test/functional/test_sample_tracking.py @@ -722,7 +722,7 @@ % ( request2.name, request2.states.NEW ) def test_0100_add_samples_to_request( self ): - target_library_info = dict( library='none', folder='none' ) + target_library_info = dict( library=None, folder=None ) # Sample fields - the tuple represents a sample name and a list of sample form field values sample_value_tuples = \ [ ( 'Sample1', target_library_info, [ 'option1', 'sample1 field2 value', 'sample1 field3 value' ] ), @@ -741,12 +741,10 @@ '<input type="text" name="sample_0_name" value="Sample_1" size="10"/>' ], # sample name input field strings_displayed_after_submit=strings_displayed_after_submit ) # Submit the request - select_target_library_message = "Select a target data library and folder for a sample before selecting its datasets to transfer from the external service" self.submit_request( cntrller='requests_admin', request_id=self.security.encode_id( request2.id ), request_name=request2.name, - strings_displayed_after_submit=[ select_target_library_message, - 'The sequencing request has been submitted.' ] ) + strings_displayed_after_submit=[ 'The sequencing request has been submitted.' ] ) refresh( request2 ) # Make sure the request is showing in the 'submitted' filter self.check_request_grid( cntrller='requests_admin', @@ -776,7 +774,8 @@ strings_displayed_count = [] strings_displayed_count.append( ( library2.name, len( request1.samples ) ) ) strings_displayed_count.append( ( library2_folder1.name, len( request1.samples ) ) ) - strings_displayed = [ 'Sequencing request "%s"' % name, regular_user1.email, request2.states.SUBMITTED ] + strings_displayed = [ 'Sequencing request "%s"' % request2.name, regular_user1.email, request2.states.SUBMITTED ] + select_target_library_message = "Select a target data library and folder for a sample before selecting its datasets to transfer from the external service" self.view_request( cntrller='requests', request_id=self.security.encode_id( request2.id ), strings_displayed=strings_displayed, 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