Skip to content

Commit 7507342

Browse files
Container profile edit
1 parent 4be1ca2 commit 7507342

File tree

2 files changed

+62
-10
lines changed

2 files changed

+62
-10
lines changed

staff_features/container_profiles/container_profile_edit.feature

+11-10
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@ Feature: Container Profile Edit
44
And a Container Profile has been created
55
Scenario: Container Profile is opened in the edit mode from the browse menu
66
Given the Container Profile appears in the search results list
7-
When the user clicks on 'Edit'
8-
Then the Container Profile is opened in the edit mode
7+
When the user clicks on 'Edit'
8+
Then the Container Profile is opened in the edit mode
99
Scenario: Container Profile is opened in the edit mode from the view mode
1010
Given the Container Profile is opened in the view mode
11-
When the user clicks on 'Edit'
12-
Then the Container Profile is opened in the edit mode
11+
When the user clicks on 'Edit'
12+
Then the Container Profile is opened in the edit mode
1313
Scenario Outline: Container Profile is successfully updated
14-
Given the Container Profile is opened in edit mode
15-
When the user changes the '<Field>' field to '<NewValue>'
14+
Given the Container Profile is opened in the view mode
15+
When the user clicks on 'Edit'
16+
And the user changes the '<Field>' field to '<NewValue>'
1617
And the user clicks on 'Save'
18+
And the user clicks on 'Edit'
1719
Then the field '<Field>' has value '<NewValue>'
1820
Examples:
19-
| Field | NewValue |
20-
| Name | Updated Test Container Profile |
21-
| Width | 10 |
21+
| Field | NewValue |
22+
| Width | 10 |
2223
Scenario: Container Profile is not updated after changes are reverted
2324
Given the Container Profile is opened in edit mode
2425
When the user changes the 'Name' field
@@ -30,4 +31,4 @@ Feature: Container Profile Edit
3031
And the user clicks on 'Save'
3132
Then the following error message is displayed
3233
| Name - Property is required but was missing |
33-
And the Container Profile Name field has the original value
34+
And the Container Profile Name field has the original value
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# frozen_string_literal: true
2+
3+
Given 'a Container Profile has been created' do
4+
visit "#{STAFF_URL}/container_profiles/new"
5+
6+
fill_in 'container_profile_name_', with: "Container Profile #{@uuid}"
7+
fill_in 'container_profile_depth_', with: '1.1'
8+
fill_in 'container_profile_height_', with: '2.2'
9+
fill_in 'container_profile_width_', with: '3.3'
10+
11+
click_on 'Save'
12+
expect(find('.alert.alert-success.with-hide-alert').text).to eq 'Container Profile Created'
13+
14+
@container_profile_id = current_url.split('/').pop
15+
end
16+
17+
Given 'the Container Profile appears in the search results list' do
18+
visit "#{STAFF_URL}/container_profiles"
19+
20+
fill_in 'filter-text', with: @uuid
21+
22+
within '.search-filter' do
23+
find('button').click
24+
end
25+
26+
search_result_rows = all('#tabledSearchResults tbody tr')
27+
expect(search_result_rows.length).to eq 1
28+
end
29+
30+
Then 'the Container Profile is opened in the edit mode' do
31+
url_parts = current_url.split('/')
32+
action = url_parts.pop
33+
container_profile_id = url_parts.pop
34+
35+
expect(action).to eq 'edit'
36+
expect(container_profile_id).to eq @container_profile_id
37+
end
38+
39+
Given 'the Container Profile is opened in the view mode' do
40+
visit "#{STAFF_URL}/container_profiles/#{@container_profile_id}"
41+
end
42+
43+
Given 'the Container Profile is opened in edit mode' do
44+
visit "#{STAFF_URL}/container_profiles/#{@container_profile_id}/edit"
45+
end
46+
47+
Then 'the Container Profile Name field has the original value' do
48+
visit "#{STAFF_URL}/container_profiles/#{@container_profile_id}/edit"
49+
50+
expect(page).to have_field('Name', with: "Container Profile #{@uuid}")
51+
end

0 commit comments

Comments
 (0)