-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Digital Object edit #58
Open
kdimopulu
wants to merge
2
commits into
master
Choose a base branch
from
digital_object_edit
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
staff_features/digital_objects/digital_object_edit.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Feature: Digital Object Edit | ||
Background: | ||
Given an administrator user is logged in | ||
And a Digital Object has been created | ||
Scenario: Digital Object is opened in the edit mode from the browse menu | ||
Given the Digital Object appears in the search results list | ||
When the user clicks on 'Edit' | ||
Then the Digital Object is opened in the edit mode | ||
Scenario: Digital Object is opened in the edit mode from the view mode | ||
Given the Digital Object is opened in the view mode | ||
When the user clicks on 'Edit' | ||
Then the Digital Object is opened in the edit mode | ||
Scenario Outline: Digital Object is successfully updated | ||
Given the Digital Object is opened in edit mode | ||
When the user changes the '<Field>' field to '<NewValue>' | ||
And the user clicks on 'Save' | ||
Then the 'Digital Object' updated message is displayed | ||
And the field '<Field>' has value '<NewValue>' | ||
Examples: | ||
| Field | NewValue | | ||
| Title | Updated Test Digital Object | | ||
| Digital Object Type | Mixed Materials | | ||
Scenario: Digital Object is not updated after changes are reverted | ||
Given the Digital Object is opened in edit mode | ||
When the user changes the 'Title' field | ||
And the user clicks on 'Revert Changes' | ||
Then the Digital Object Title field has the original value | ||
Scenario: Digital Object update fails due to invalid date input | ||
Given the Digital Object is opened in edit mode | ||
When the user fills in 'Begin' with '2024-13-15' in the 'Dates' form | ||
And the user clicks on 'Save' | ||
Then the following error message is displayed | ||
| Begin - Not a valid date | | ||
Scenario: Digital Object update fails due to missing required field | ||
Given the Digital Object is opened in edit mode | ||
When the user clears the 'Identifier' field | ||
And the user clicks on 'Save' | ||
Then the following error message is displayed | ||
| Identifier - Property is required but was missing | | ||
And the Digital Object Identifier field has the original value |
This file was deleted.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
staff_features/digital_objects/step_definitions/digital_object_shared.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# frozen_string_literal: true | ||
|
||
Given 'a Digital Object has been created' do | ||
visit "#{STAFF_URL}/digital_objects/new" | ||
|
||
fill_in 'digital_object_digital_object_id_', with: "Digital Object Identifier #{@uuid}" | ||
fill_in 'digital_object_title_', with: "Digital Object Title #{@uuid}" | ||
|
||
click_on 'Add Date' | ||
select 'Single', from: 'digital_object_dates__0__date_type_' | ||
fill_in 'digital_object_dates__0__begin_', with: '2000-01-01' | ||
|
||
click_on 'Save' | ||
|
||
wait_for_ajax | ||
expect(find('.alert.alert-success.with-hide-alert').text).to have_text "Digital Object Digital Object Title #{@uuid} Created" | ||
@digital_object_id = current_url.split('::digital_object_').pop | ||
end | ||
|
||
Given 'the Digital Object appears in the search results list' do | ||
visit "#{STAFF_URL}/digital_objects" | ||
|
||
fill_in 'filter-text', with: "Digital Object Identifier #{@uuid}" | ||
|
||
within '.search-filter' do | ||
find('button').click | ||
end | ||
|
||
search_result_rows = all('#tabledSearchResults tbody tr') | ||
expect(search_result_rows.length).to eq 1 | ||
end | ||
|
||
Then 'the Digital Object is opened in the edit mode' do | ||
wait_for_ajax | ||
expect(current_url).to include 'edit' | ||
expect(@digital_object_id).to eq current_url.split('::digital_object_').pop | ||
end | ||
|
||
Given 'the Digital Object is opened in the view mode' do | ||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}" | ||
end | ||
|
||
Given 'the Digital Object is opened in edit mode' do | ||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}/edit" | ||
|
||
wait_for_ajax | ||
end | ||
|
||
Then 'the Digital Object Title field has the original value' do | ||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}/edit" | ||
|
||
expect(page).to have_field('Title', with: "Digital Object Title #{@uuid}") | ||
end | ||
|
||
Then 'the Digital Object Identifier field has the original value' do | ||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}/edit" | ||
|
||
expect(page).to have_field('Identifier', with: "Digital Object Identifier #{@uuid}") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as #55 - necessary?