From 3d1a971d8dc18688a8f0b5295936fa157c6df633 Mon Sep 17 00:00:00 2001 From: Thimios Dimopulos Date: Tue, 19 Mar 2024 20:54:09 +0200 Subject: [PATCH] ANW-1925 port enumeration_management spec --- .../features/enumeration_management_spec.rb | 355 ++++++++++++++++++ .../spec/enumeration_management_spec.rb | 315 ---------------- 2 files changed, 355 insertions(+), 315 deletions(-) create mode 100644 frontend/spec/features/enumeration_management_spec.rb delete mode 100644 frontend/spec/selenium/spec/enumeration_management_spec.rb diff --git a/frontend/spec/features/enumeration_management_spec.rb b/frontend/spec/features/enumeration_management_spec.rb new file mode 100644 index 0000000000..e6adcf873f --- /dev/null +++ b/frontend/spec/features/enumeration_management_spec.rb @@ -0,0 +1,355 @@ +# frozen_string_literal: true + +require 'spec_helper' +require 'rails_helper' + +describe 'Enumeration Management', js: true do + let(:admin) { BackendClientMethods::ASpaceUser.new('admin', 'admin') } + let!(:repository) { create(:repo, repo_code: "enum_test_#{Time.now.to_i}", publish: true) } + + before(:each) do + login_user(admin) + select_repository(repository) + end + + it 'lets you add a new value to an enumeration' do + now = Time.now.to_i + click_on 'System' + click_on 'Manage Controlled Value Lists' + + element = find('.alert.alert-info.with-hide-alert') + expect(element.text).to eq 'Please select a Controlled Value List' + + select 'Accession Acquisition Type (accession_acquisition_type)', from: 'enum_selector' + + element = find('a', text: 'Create Value') + element.click + + within '#form_enumeration' do + fill_in 'enumeration_value_', with: "enumaration_value_#{now}" + click_on 'Create Value' + end + + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq 'Value Created' + expect(page).to have_css 'tr', text: "enumaration_value_#{now}" + end + + it 'lets you delete a value from an enumeration' do + now = Time.now.to_i + click_on 'System' + click_on 'Manage Controlled Value Lists' + element = find('.alert.alert-info.with-hide-alert') + expect(element.text).to eq 'Please select a Controlled Value List' + + select 'Accession Acquisition Type (accession_acquisition_type)', from: 'enum_selector' + + element = find('a', text: 'Create Value') + element.click + + within '#form_enumeration' do + fill_in 'enumeration_value_', with: "enumaration_value_#{now}" + click_on 'Create Value' + end + + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq 'Value Created' + + element = find('tr', text: "enumaration_value_#{now}") + within element do + click_on 'Delete' + end + + within '#form_enumeration' do + click_on 'Delete Value' + end + + expect(page).to_not have_css 'tr', text: "enumaration_value_#{now}" + end + + it 'lets you merge one value into another in an enumeration' do + now = Time.now.to_i + enumeration_a = "Enumeration_a_#{now}" + enumeration_b = "Enumeration_b_#{now}" + click_on 'System' + click_on 'Manage Controlled Value Lists' + element = find('.alert.alert-info.with-hide-alert') + expect(element.text).to eq 'Please select a Controlled Value List' + + select 'Accession Acquisition Type (accession_acquisition_type)', from: 'enum_selector' + + element = find('a', text: 'Create Value') + element.click + within '#form_enumeration' do + fill_in 'enumeration_value_', with: "#{enumeration_a}" + click_on 'Create Value' + end + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq 'Value Created' + expect(page).to have_css 'tr', text: enumeration_a + + element = find('a', text: 'Create Value') + element.click + within '#form_enumeration' do + fill_in 'enumeration_value_', with: "#{enumeration_b}" + click_on 'Create Value' + end + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq 'Value Created' + + element = find('tr', text: enumeration_b) + within element do + click_on 'Merge' + end + + within '#form_enumeration' do + select enumeration_a, from: 'merge_into' + click_on 'Merge Value' + end + + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq 'Value Merged' + + expect(page).to_not have_css 'tr', text: enumeration_b + end + + it 'lets you set a default enumeration (date_type)' do + click_on 'System' + click_on 'Manage Controlled Value Lists' + element = find('.alert.alert-info.with-hide-alert') + expect(element.text).to eq 'Please select a Controlled Value List' + + select 'Date Type (date_type)', from: 'enum_selector' + + elements = all('tr', text: 'Set as Default') + expect(elements.length > 0).to eq true + + default_value = elements[0].all('td').first.text + + within elements[0] do + click_on 'Set as Default' + end + + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq 'Default Value Set' + + click_on 'Create' + click_on 'Accession' + click_on 'Add Date' + + element = find('#accession_dates__0__date_type_') + + expect(element.value).to eq default_value + end + + it 'lets you add a new value to an enumeration, reorder it and then you can use it' do + now = Time.now.to_i + click_on 'System' + click_on 'Manage Controlled Value Lists' + element = find('.alert.alert-info.with-hide-alert') + expect(element.text).to eq 'Please select a Controlled Value List' + + select 'Collection Management Processing Priority (collection_management_processing_priority)', from: 'enum_selector' + + element = find('a', text: 'Create Value') + element.click + + within '#form_enumeration' do + fill_in 'enumeration_value_', with: "enumaration_value_#{now}" + click_on 'Create Value' + end + + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq 'Value Created' + expect(page).to have_css 'tr', text: "enumaration_value_#{now}" + + click_on 'Create' + click_on 'Accession' + fill_in 'accession_title_', with: "Accession Title #{now}" + fill_in 'accession_id_0_', with: "1 #{now}" + fill_in 'accession_id_1_', with: "2 #{now}" + fill_in 'accession_id_2_', with: "3 #{now}" + fill_in 'accession_id_3_', with: "4 #{now}" + fill_in 'accession_accession_date_', with: '2012-01-01' + fill_in 'accession_content_description_', with: "Accession Description #{now}" + fill_in 'accession_condition_description_', with: "Accession Condition Description #{now}" + click_on 'Add Collection Management Fields' + select "enumaration_value_#{now}", from: 'accession_collection_management__processing_priority_' + + # Click on save + find('button', text: 'Save Accession', match: :first).click + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq "Accession Accession Title #{now} created" + + find('a', text: "Accession Title #{now}").click + + element = find('#accession_collection_management__accordian') + expect(element).to have_text "enumaration_value_#{now}" + end + + it 'lets you see how many times the term has been used and search for it' do + now = Time.now.to_i + click_on 'System' + click_on 'Manage Controlled Value Lists' + element = find('.alert.alert-info.with-hide-alert') + expect(element.text).to eq 'Please select a Controlled Value List' + + select 'Collection Management Processing Priority (collection_management_processing_priority)', from: 'enum_selector' + + element = find('a', text: 'Create Value') + element.click + + within '#form_enumeration' do + fill_in 'enumeration_value_', with: "enumaration_value_#{now}" + click_on 'Create Value' + end + + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq 'Value Created' + expect(page).to have_css 'tr', text: "enumaration_value_#{now}" + + click_on 'Create' + click_on 'Accession' + fill_in 'accession_title_', with: "Accession Title #{now}" + fill_in 'accession_id_0_', with: "1 #{now}" + fill_in 'accession_id_1_', with: "2 #{now}" + fill_in 'accession_id_2_', with: "3 #{now}" + fill_in 'accession_id_3_', with: "4 #{now}" + fill_in 'accession_accession_date_', with: '2012-01-01' + fill_in 'accession_content_description_', with: "Accession Description #{now}" + fill_in 'accession_condition_description_', with: "Accession Condition Description #{now}" + click_on 'Add Collection Management Fields' + select "enumaration_value_#{now}", from: 'accession_collection_management__processing_priority_' + + # Click on save + find('button', text: 'Save Accession', match: :first).click + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq "Accession Accession Title #{now} created" + + run_index_round + + visit '/' + click_on 'System' + click_on 'Manage Controlled Value Lists' + select 'Collection Management Processing Priority (collection_management_processing_priority)', from: 'enum_selector' + + element = find('tr', text: "enumaration_value_#{now}") + expect(element).to have_text '1 related item' + end + + it 'lets you suppress an enumeration value' do + now = Time.now.to_i + click_on 'System' + click_on 'Manage Controlled Value Lists' + element = find('.alert.alert-info.with-hide-alert') + expect(element.text).to eq 'Please select a Controlled Value List' + + select 'Collection Management Processing Priority (collection_management_processing_priority)', from: 'enum_selector' + + element = find('a', text: 'Create Value') + element.click + + within '#form_enumeration' do + fill_in 'enumeration_value_', with: "enumaration_value_#{now}" + click_on 'Create Value' + end + + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq 'Value Created' + + element = find('tr', text: "enumaration_value_#{now}") + within element do + click_on 'Suppress' + end + + element = find('tr', text: "enumaration_value_#{now}") + expect(element).to have_css 'a', text: 'Unsuppress' + + click_on 'Create' + click_on 'Accession' + fill_in 'accession_title_', with: "Accession Title #{now}" + fill_in 'accession_id_0_', with: "1 #{now}" + fill_in 'accession_id_1_', with: "2 #{now}" + fill_in 'accession_id_2_', with: "3 #{now}" + fill_in 'accession_id_3_', with: "4 #{now}" + fill_in 'accession_accession_date_', with: '2012-01-01' + fill_in 'accession_content_description_', with: "Accession Description #{now}" + fill_in 'accession_condition_description_', with: "Accession Condition Description #{now}" + click_on 'Add Collection Management Fields' + + elements = all('#accession_collection_management__processing_priority_ option') + options = elements.map { |option| option.value } + expect(options.include?("enumaration_value_#{now}")).to eq false + + # Click on save + find('button', text: 'Save Accession', match: :first).click + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq "Accession Accession Title #{now} created" + end + + it 'lets you delete a suppressed enumeration value' do + now = Time.now.to_i + click_on 'System' + click_on 'Manage Controlled Value Lists' + element = find('.alert.alert-info.with-hide-alert') + expect(element.text).to eq 'Please select a Controlled Value List' + + select 'Collection Management Processing Priority (collection_management_processing_priority)', from: 'enum_selector' + + element = find('a', text: 'Create Value') + element.click + + within '#form_enumeration' do + fill_in 'enumeration_value_', with: "enumaration_value_#{now}" + click_on 'Create Value' + end + + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq 'Value Created' + + element = find('tr', text: "enumaration_value_#{now}") + within element do + click_on 'Suppress' + end + + element = find('tr', text: "enumaration_value_#{now}") + within element do + click_on 'Delete' + end + + within '#form_enumeration' do + click_on 'Delete Value' + end + + element = find('.alert.alert-success.with-hide-alert') + expect(element.text).to eq 'Value Deleted' + + expect(page).to_not have_css 'tr', text: "enumaration_value_#{now}" + end + + it 'lets you set a default value with another value suppressed' do + now = Time.now.to_i + click_on 'System' + click_on 'Manage Controlled Value Lists' + + element = find('.alert.alert-info.with-hide-alert') + expect(element.text).to eq 'Please select a Controlled Value List' + + select 'Record Control Level of Detail (level_of_detail)', from: 'enum_selector' + + element = find('tr', text: 'natc') + within element do + click_on 'Suppress' + end + + element = find('tr', text: 'not_applicable') + within element do + click_on 'Set as Default' + end + + element = find('tr', text: 'not_applicable') + within element do + click_on 'Unset Default' + end + end +end diff --git a/frontend/spec/selenium/spec/enumeration_management_spec.rb b/frontend/spec/selenium/spec/enumeration_management_spec.rb deleted file mode 100644 index fce78b3bdf..0000000000 --- a/frontend/spec/selenium/spec/enumeration_management_spec.rb +++ /dev/null @@ -1,315 +0,0 @@ -# frozen_string_literal: true - -require_relative '../spec_helper' - -describe 'Enumeration Management' do - before(:all) do - @repo = create(:repo, repo_code: "enum_test_#{Time.now.to_i}") - set_repo @repo - - @driver = Driver.get.login($admin) - end - - after(:all) do - @driver ? @driver.quit : next - end - - it 'lets you add a new value to an enumeration' do - @driver.find_element(:link, 'System').click - @driver.wait_for_dropdown - @driver.click_and_wait_until_gone(:link, 'Manage Controlled Value Lists') - - sleep(0.5) - enum_select = @driver.find_element(id: 'enum_selector') - enum_select.select_option_with_text('Accession Acquisition Type (accession_acquisition_type)') - - @driver.find_element(:link, 'Create Value').click - @driver.clear_and_send_keys([:id, 'enumeration_value_'], 'manna') - - @driver.click_and_wait_until_gone(:css, '.modal-footer .btn-primary') - - @driver.find_element_with_text('//td', /^manna$/) - end - - it 'lets you delete a value from an enumeration' do - @driver.find_element(:link, 'System').click - @driver.wait_for_dropdown - @driver.click_and_wait_until_gone(:link, 'Manage Controlled Value Lists') - - enum_select = @driver.find_element(id: 'enum_selector') - enum_select.select_option_with_text('Accession Acquisition Type (accession_acquisition_type)') - - # Wait for the table of enumerations to load - @driver.find_element(:css, '.enumeration-list') - - manna = 'spiritual_nourishment_of_divine_origin' - @driver.find_element(:link, 'Create Value').click - @driver.clear_and_send_keys([:id, 'enumeration_value_'], manna) - - @driver.click_and_wait_until_gone(:css, '.modal-footer .btn-primary') - - manna = @driver.find_element_with_text('//td', /#{manna}/) - manna.find_element(:xpath, './..').find_element(:link, 'Delete').click - @driver.click_and_wait_until_gone(css: "form#delete_enumeration button[type='submit']") - - @driver.find_element_with_text('//div', /Value Deleted/) - - @driver.ensure_no_such_element(:xpath, "//td[contains(text(), \"#{manna}\" )]") - end - - it 'lets you merge one value into another in an enumeration' do - enum_a = "EnumA_#{Time.now.to_i}_#{$$}" - enum_b = "EnumB_#{Time.now.to_i}_#{$$}" - - # create enum A - @driver.find_element(:link, 'Create Value').click - @driver.clear_and_send_keys([:id, 'enumeration_value_'], enum_a.to_s) - @driver.click_and_wait_until_gone(:css, '.modal-footer .btn-primary') - - # create enum B - @driver.find_element(:link, 'Create Value').click - @driver.clear_and_send_keys([:id, 'enumeration_value_'], enum_b.to_s) - @driver.click_and_wait_until_gone(:css, '.modal-footer .btn-primary') - - # merge enum B into A - @driver.find_element(:xpath, "//a[contains(@href, \"#{enum_b}\")][contains(text(), \"Merge\")]").click - - # merge form is eventually displayed - merge_form = @driver.find_element(:id, 'merge_enumeration') - merge_form.find_element(:id, 'merge_into').select_option_with_text(enum_a) - - @driver.click_and_wait_until_gone(css: "form#merge_enumeration button[type='submit']") - - @driver.find_element_with_text('//div', /Merged/) - - @driver.ensure_no_such_element(:xpath, "//td[contains(text(), \"#{enum_b}\")]") - end - - it 'lets you set a default enumeration (date_type)' do - # go home first so the enumeration-list check below diesn't get - # a false positive on the list from the previous test - @driver.go_home - @driver.find_element(:link, 'System').click - @driver.wait_for_dropdown - @driver.click_and_wait_until_gone(:link, 'Manage Controlled Value Lists') - - enum_select = @driver.find_element(id: 'enum_selector') - enum_select.select_option_with_text('Date Type (date_type)') - - # Wait for the table of enumerations to load - @driver.find_element(:css, '.enumeration-list') - - # find the first row that is not the default - value_row = @driver.find_element_with_text('//tr', /Set as Default/) - new_default_type = value_row.find_element(xpath: './td').text - default_btn = value_row.find_element(:link, 'Set as Default') - @driver.click_and_wait_until_element_gone(default_btn) - - @driver.find_element(:link, 'Create').click - @driver.click_and_wait_until_gone(:link, 'Accession') - - @driver.find_element(css: '#accession_dates_ .subrecord-form-heading .btn:not(.show-all)').click - - date_type_select = @driver.find_element(id: 'accession_dates__0__date_type_') - selected_type = date_type_select.get_select_value - - # make sure the new default takes effect - expect(selected_type).to eq new_default_type - - @driver.click_and_wait_until_gone(css: "form#accession_form button[type='submit']") - end - - it 'lets you add a new value to an enumeration, reorder it and then you can use it' do - @driver.get($frontend) - @driver.find_element(:link, 'System').click - @driver.wait_for_dropdown - @driver.click_and_wait_until_gone(:link, 'Manage Controlled Value Lists') - - enum_select = @driver.find_element(id: 'enum_selector') - enum_select.select_option_with_text('Collection Management Processing Priority (collection_management_processing_priority)') - - # Wait for the table of enumerations to load - @driver.find_element(:css, '.enumeration-list') - - @driver.find_element(:link, 'Create Value').click - @driver.clear_and_send_keys([:id, 'enumeration_value_'], 'IMPORTANT.') - @driver.click_and_wait_until_gone(:css, '.modal-footer .btn-primary') - - @driver.find_element_with_text('//td', /^IMPORTANT\.$/) - - # now lets make sure it's there - @driver.find_element(:link, 'Create').click - @driver.click_and_wait_until_gone(:link, 'Accession') - - cm_accession_title = 'CM Punk TEST' - @driver.find_hidden_element(:css, '#accession_title_').wait_for_class('initialised') - @driver.execute_script("$('#accession_title_').data('CodeMirror').setValue('#{cm_accession_title}')") - - @driver.complete_4part_id('accession_id_%d_', @driver.generate_4part_id) - @driver.clear_and_send_keys([:id, 'accession_accession_date_'], '2012-01-01') - @driver.clear_and_send_keys([:id, 'accession_content_description_'], 'STUFFZ') - @driver.clear_and_send_keys([:id, 'accession_condition_description_'], 'stuffy') - - # now add collection management - @driver.find_element(css: '#accession_collection_management_ .subrecord-form-heading .btn:not(.show-all)').click - - @driver.find_element(id: 'accession_collection_management__processing_priority_').select_option('IMPORTANT.') - @driver.click_and_wait_until_gone(css: "form#accession_form button[type='submit']") - - @driver.click_and_wait_until_gone(link: cm_accession_title) - - assert(5) { @driver.find_element(css: '#accession_collection_management__accordian div:last-child').text.include?('IMPORTANT.') } - end - - it 'lets you see how many times the term has been used and search for it' do - # now lets make sure it's there - @driver.find_element(:link, 'Create').click - @driver.click_and_wait_until_gone(:link, 'Accession') - - cm_accession_title = SecureRandom.hex - @driver.find_hidden_element(:css, '#accession_title_').wait_for_class('initialised') - @driver.execute_script("$('#accession_title_').data('CodeMirror').setValue('#{cm_accession_title}')") - @driver.complete_4part_id('accession_id_%d_', @driver.generate_4part_id) - @driver.clear_and_send_keys([:id, 'accession_accession_date_'], '2012-01-01') - @driver.clear_and_send_keys([:id, 'accession_content_description_'], 'more stuff') - @driver.clear_and_send_keys([:id, 'accession_condition_description_'], 'stuffier') - - # now add collection management - @driver.find_element(css: '#accession_collection_management_ .subrecord-form-heading .btn:not(.show-all)').click - - @driver.find_element(id: 'accession_collection_management__processing_priority_').select_option_with_text('High') - @driver.click_and_wait_until_gone(css: "form#accession_form button[type='submit']") - - @driver.click_and_wait_until_gone(link: cm_accession_title) - @driver.get($frontend) - @driver.find_element(:link, 'System').click - @driver.wait_for_dropdown - @driver.click_and_wait_until_gone(:link, 'Manage Controlled Value Lists') - run_index_round - - enum_select = @driver.find_element(id: 'enum_selector') - enum_select.select_option_with_text('Collection Management Processing Priority (collection_management_processing_priority)') - - @driver.find_element(:link, '1 related item.') - end - - it 'lets you suppress an enumeration value' do - @driver.go_home - @driver.get($frontend) - @driver.find_element(:link, 'System').click - @driver.wait_for_dropdown - @driver.click_and_wait_until_gone(:link, 'Manage Controlled Value Lists') - - enum_select = @driver.find_element(id: 'enum_selector') - enum_select.select_option_with_text('Collection Management Processing Priority (collection_management_processing_priority)') - - # Wait for the table of enumerations to load - @driver.find_element(:css, '.enumeration-list') - - # Wait for click event to be bound to the Create Value link - @driver.wait_for_dropdown - @driver.find_element(:link, 'Create Value').click - - @driver.clear_and_send_keys([:id, 'enumeration_value_'], 'fooman') - @driver.click_and_wait_until_gone(:css, '.modal-footer .btn-primary') - - foo = @driver.find_element_with_text('//tr', /fooman/) - @driver.click_and_wait_until_element_gone(foo.find_element(:link, 'Suppress')) - - expect(@driver.find_element_with_text('//tr', /fooman/).find_element(:link, 'Unsuppress')).not_to be_nil - - # now lets make sure it's there - @driver.find_element(:link, 'Create').click - @driver.click_and_wait_until_gone(:link, 'Accession') - - cm_accession_title = 'CM Punk TEST2' - @driver.find_hidden_element(:css, '#accession_title_').wait_for_class('initialised') - @driver.execute_script("$('#accession_title_').data('CodeMirror').setValue('#{cm_accession_title}')") - - @driver.complete_4part_id('accession_id_%d_', @driver.generate_4part_id) - @driver.clear_and_send_keys([:id, 'accession_accession_date_'], '2012-01-01') - @driver.clear_and_send_keys([:id, 'accession_content_description_'], 'STUFFZ') - @driver.clear_and_send_keys([:id, 'accession_condition_description_'], 'stuffy') - - # now add collection management - @driver.find_element(css: '#accession_collection_management_ .subrecord-form-heading .btn:not(.show-all)').click - - # make sure our suppressed value is not present - @driver.ensure_no_such_element(:xpath, "//option[@value='fooman']") - - # lets just finish up making the record and move on, shall we? - @driver.find_element(id: 'accession_collection_management__processing_priority_').select_option('IMPORTANT.') - @driver.click_and_wait_until_gone(css: "form#accession_form button[type='submit']") - - # tidy up - @driver.go_home - @driver.get($frontend) - @driver.find_element(:link, 'System').click - @driver.wait_for_dropdown - @driver.click_and_wait_until_gone(:link, 'Manage Controlled Value Lists') - - enum_select = @driver.find_element(id: 'enum_selector') - enum_select.select_option_with_text('Collection Management Processing Priority (collection_management_processing_priority)') - - @driver.find_element(:css, '.enumeration-list') - foo = @driver.find_element_with_text('//tr', /fooman/) - @driver.click_and_wait_until_element_gone(foo.find_element(:link, 'Unsuppress')) - - @driver.find_element(:css, '.enumeration-list') - foo = @driver.find_element_with_text('//tr', /fooman/) - foo.find_element(:link, 'Delete').click - - @driver.click_and_wait_until_gone(css: "form#delete_enumeration button[type='submit']") - end - - it 'lets you delete a suppressed enumeration value' do - @driver.go_home - @driver.get($frontend) - @driver.find_element(:link, 'System').click - @driver.wait_for_dropdown - @driver.click_and_wait_until_gone(:link, 'Manage Controlled Value Lists') - - enum_select = @driver.find_element(id: 'enum_selector') - enum_select.select_option_with_text('Collection Management Processing Priority (collection_management_processing_priority)') - - @driver.find_element(:css, '.enumeration-list') - - @driver.wait_for_dropdown - @driver.find_element(:link, 'Create Value').click - - @driver.clear_and_send_keys([:id, 'enumeration_value_'], 'barman') - @driver.click_and_wait_until_gone(:css, '.modal-footer .btn-primary') - - foo = @driver.find_element_with_text('//tr', /barman/) - @driver.click_and_wait_until_element_gone(foo.find_element(:link, 'Suppress')) - - @driver.find_element_with_text('//tr', /barman/).find_element(:link, 'Delete').click - @driver.click_and_wait_until_gone(css: "form#delete_enumeration button[type='submit']") - - @driver.find_element_with_text('//div', /Value Deleted/) - @driver.ensure_no_such_element(:xpath, "//td[contains(text(), \"barman\" )]") - end - - it 'lets you set a default value with another value suppressed' do - @driver.go_home - @driver.get($frontend) - @driver.find_element(:link, 'System').click - @driver.wait_for_dropdown - @driver.click_and_wait_until_gone(:link, 'Manage Controlled Value Lists') - - enum_select = @driver.find_element(id: 'enum_selector') - enum_select.select_option_with_text('Record Control Level of Detail (level_of_detail)') - - # Wait for the table of enumerations to load - @driver.find_element(:css, '.enumeration-list') - - topical = @driver.find_element_with_text('//tr', /natc/) - @driver.click_and_wait_until_element_gone(topical.find_element(:link, 'Suppress')) - - temporal = @driver.find_element_with_text('//tr', /not_applicable/) - - @driver.click_and_wait_until_element_gone(temporal.find_element(:link, 'Set as Default')) - - @driver.find_element(:link, 'Unset Default') - end -end