Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

within '#draft_data_centers_1' do
select 'Originator', from: 'Role'
add_data_center('ESA/ED')
add_data_center_with_retry('ESA/ED')
add_contact_information(type: 'data_center', single: false, button_type: 'Data Center')
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

within '.multiple.data-centers > .multiple-item-1' do
select 'Originator', from: 'Role'
add_data_center('ESA/ED')
add_data_center_with_retry('ESA/ED')
end

within '.nav-top' do
Expand Down
6 changes: 6 additions & 0 deletions spec/features/collection_drafts/forms/validation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@
fill_in 'draft_temporal_extents_0_single_date_times_0', with: '2015-07-01T00:00:00Z'
end

# Bamboo spontaneously started failling this test with the apparent
# cause being that 'done' was not being clicked. Clicking something
# outside of the datepicker widget allows the done click to be
# processed correctly. Previously, it looks like the click for done
# was only exiting the single date time field.
find('#draft_temporal_extents_0_precision_of_seconds').click
within '.nav-top' do
click_on 'Done'
end
Expand Down
15 changes: 15 additions & 0 deletions spec/support/draft_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ def add_data_center(value)
end
end

# Bamboo started failing some tests where it seemed that the select2 was not
# opening properly. This is notably slower, so it should only be used when
# necessary.
def add_data_center_with_retry(value)
ActiveSupport::Notifications.instrument 'mmt.performance', activity: 'Helpers::DraftHelpers#add_data_center_with_retry' do
find('.select2-container .select2-selection').click
begin
find(:xpath, '//body').find('.select2-dropdown li.select2-results__option', text: value)
rescue Capybara::ElementNotFound
find('.select2-container .select2-selection').click
end
find(:xpath, '//body').find('.select2-dropdown li.select2-results__option', text: value).click
end
end

def add_person
ActiveSupport::Notifications.instrument 'mmt.performance', activity: 'Helpers::DraftHelpers#add_person' do
fill_in 'First Name', with: 'First Name'
Expand Down