Skip to content

Commit

Permalink
Resource generate bulk spreadsheet (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdimopulu authored Dec 28, 2024
1 parent ec68db2 commit cfaeaa3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Feature: Resource generate bulk spreadsheet
Background:
Given an administrator user is logged in
And a Resource has been created
And the Resource is opened in edit mode
Scenario: Resource Bulk archival object updater page is displayed
When the user clicks on 'More'
And the user clicks on 'Generate Bulk Archival Object Spreadsheet'
Then the Generate Bulk Archival Object Spreadsheet page is displayed
Scenario: Resource Bulk Archival Object Spreadsheet is downloaded
Given the user is on the Generate Bulk Archival Object Spreadsheet page
When the user selects the Archival Object
And the user clicks on 'Download Spreadsheet'
Then the Bulk Update Resource spreadsheet is downloaded
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

Given 'the user is on the Generate Bulk Archival Object Spreadsheet page' do
click_on 'More'
click_on 'Generate Bulk Archival Object Spreadsheet'
end

Then 'the Generate Bulk Archival Object Spreadsheet page is displayed' do
expect(current_url).to include 'bulk_archival_object_updater/download?resource='
expect(current_url).to include @resource_id
end

Then 'the user selects the Archival Object' do
input_fields = all('#bulk_archival_object_updater_table input')

expect(input_fields.length).to eq 2
input_fields[1].click
end

Then 'the Bulk Update Resource spreadsheet is downloaded' do
files = Dir.glob(File.join(Dir.tmpdir, '*.xlsx'))

downloaded_file = nil
files.each do |file|
downloaded_file = file if file.include?("bulk_update.resource_#{@resource_id}")
end

expect(downloaded_file).to_not eq nil
end

0 comments on commit cfaeaa3

Please sign in to comment.