Skip to content

Commit

Permalink
Digital Object Publish (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdimopulu authored Feb 5, 2025
1 parent b1102e8 commit c4a6209
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
21 changes: 21 additions & 0 deletions staff_features/digital_objects/digital_object_publish.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Feature: Digital Object Publish
Background:
Given an administrator user is logged in
And a Digital Object has been created
Scenario: Publish the Digital Object from toolbar
Given the Digital Object is opened in edit mode
When the user clicks on 'Publish All'
And the user clicks on 'Publish All' in the modal
Then the 'Digital Object' published message is displayed
And the 'View Published' button is displayed
Scenario: Publish the Digital Object from the Publish checkbox in the Basic Information section
Given the Digital Object is opened in edit mode
When the user checks 'Publish'
And the user clicks on 'Save'
Then the 'Digital Object' updated message is displayed
And the 'View Published' button is displayed
Scenario: View a published Digital Object in the public interface
Given the Digital Object is opened in edit mode
And the Digital Object is published
When the user clicks on 'View Published'
Then the Digital Object opens on a new tab in the public interface
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
click_on 'Add Date'
select 'Single', from: 'digital_object_dates__0__date_type_'
fill_in 'digital_object_dates__0__begin_', with: '2000-01-01'
check 'Publish'

@digital_object_number_of_file_versions = 0

Expand Down Expand Up @@ -135,3 +136,24 @@

expect(subrecords.length).to eq @digital_object_number_of_file_versions - 1
end

Given 'the Digital Object is published' do
expect(find('#digital_object_publish_').checked?).to eq true
end

Then 'the Digital Object opens on a new tab in the public interface' do
expect(page.windows.size).to eq 2
switch_to_window(page.windows[1])

tries = 0

while current_url == 'about:blank'
break if tries == 3

tries += 1
sleep 1
end

expect(current_url).to eq "#{PUBLIC_URL}/repositories/#{@repository_id}/digital_objects/#{@digital_object_id}"
expect(page).to have_text "Digital Object Title #{@uuid}"
end

0 comments on commit c4a6209

Please sign in to comment.