Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Commit 6322ad3

Browse files
Accession transfer
1 parent 8391b39 commit 6322ad3

File tree

3 files changed

+44
-9
lines changed

3 files changed

+44
-9
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
Feature: Accession transfer to another Repository
1+
Feature: Accession Transfer
22
Background:
33
Given an administrator user is logged in
4+
And a Repository with name 'Transfer Test Repository' has been created
45
And an Accession has been created
5-
And a Repository has been created
66
And the Accession is opened in edit mode
77
Scenario: Accession is transferred to another Repository
8-
When the user clicks on 'Transfer' button on the toolbar
9-
And the user selects the destination Repository from the drop-down list
10-
And the user clicks on 'Transfer' button
11-
And the user clicks on 'Transfer' button at the modal
8+
When the user clicks on 'Transfer'
9+
And the user selects 'Transfer Test Repository' from 'Destination Repository'
10+
And the user clicks on 'Transfer' in the dropdown menu
11+
And the user clicks on 'Transfer' in the modal
1212
Then the following message is displayed
1313
| Transfer Successful. Records may take a moment to appear in the target repository while re-indexing takes place. |
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# frozen_string_literal: true
2+

staff_features/shared/step_definitions.rb

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,41 @@
1616
login_archivist
1717
end
1818

19+
Given 'a Repository with name {string} has been created' do |repository_name|
20+
visit "#{STAFF_URL}/repositories"
21+
22+
fill_in 'filter-text', with: repository_name
23+
24+
within '.search-filter' do
25+
find('button').click
26+
end
27+
28+
begin
29+
table_row = find('tr', text: repository_name, match: :first)
30+
rescue Capybara::ElementNotFound
31+
visit "#{STAFF_URL}/repositories/new"
32+
fill_in 'Repository Short Name', with: repository_name
33+
fill_in 'Repository Name', with: repository_name
34+
35+
click_on 'Save'
36+
end
37+
end
38+
1939
When 'the user clicks on {string}' do |string|
2040
click_on_string string
2141
end
2242

43+
When 'the user clicks on {string} in the modal' do |string|
44+
within '.modal-content' do
45+
click_on_string string
46+
end
47+
end
48+
2349
When 'the user clicks on {string} in the dropdown menu' do |string|
24-
within '.dropdown-menu' do |dropdown_menu|
25-
elements = dropdown_menu.all(:xpath, "//*[contains(text(), '#{string}')]")
26-
elements[1].click
50+
dropdown_menu = find('.dropdown-menu')
51+
52+
within dropdown_menu do
53+
click_on_string string
2754
end
2855
end
2956

@@ -101,6 +128,12 @@
101128
expect(find('.alert.alert-success.with-hide-alert').text).to match(/^#{string}.*deleted$/i)
102129
end
103130

131+
Then 'the following message is displayed' do |messages|
132+
messages.raw.each do |message|
133+
expect(page).to have_text message[0]
134+
end
135+
end
136+
104137
Then 'only the following info message is displayed' do |messages|
105138
expect(messages.raw.length).to eq 1
106139

0 commit comments

Comments
 (0)