Skip to content

Commit

Permalink
Container profile create
Browse files Browse the repository at this point in the history
  • Loading branch information
blacksmith-welder committed Mar 5, 2025
1 parent d23b9bb commit 6e1344a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 18 deletions.
39 changes: 21 additions & 18 deletions staff_features/container_profiles/container_profile_create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,45 @@ Feature: Container Profile Create
Background:
Given an administrator user is logged in
Scenario: Open new container profile page from Create in the main toolbar
When the user clicks on 'Create' in the main toolbar
When the user clicks on 'Create'
And the user clicks on 'Container Profile' in the dropdown menu
Then the user is on the New Container Profile page
Then the New Container Profile page is displayed
Scenario: Open new container profile page from Manage Container Profile
When the user clicks on 'System'
And the user clicks on 'Manage Container Profiles' in the dropdown menu
And the user clicks on 'Create Container Profile'
Then the user is on the New Container Profile page
Then the New Container Profile page is displayed
Scenario: Open new container profile page from Browse in the main toolbar
When the user clicks on 'Browse' in the main toolbar
And the user clicks on 'Container Profile' in the dropdown menu
When the user clicks on 'Browse'
And the user clicks on 'Container Profiles' in the dropdown menu
And the user clicks on 'Create Container Profile'
Then the user is on the New Container Profile page
Then the New Container Profile page is displayed
Scenario: Container Profile is created
Given the user is on the New Container Profile page
When the user fills in 'Name' with 'Test Container'
And the user fills in 'Depth' with '90'
And the user fills in 'Height' with '90'
And the user fills in 'Width' with '90'
When the user clicks on 'Create'
And the user clicks on 'Container Profile' in the dropdown menu
And the user fills in 'Name'
And the user fills in 'Depth' with '1.1'
And the user fills in 'Height' with '2.2'
And the user fills in 'Width' with '3.3'
And the user clicks on 'Save'
Then the 'Container Profile' created message is displayed
And the Container Profile is created
Scenario: Container Proofile is not created because required fields are missing
Given the user is on the New Container Profile page
When the user clicks on 'Save'
When the user clicks on 'Create'
And the user clicks on 'Container Profile' in the dropdown menu
And the user clicks on 'Save'
Then the following error messages are displayed
| Name - Property is required but was missing |
| Height - Property is required but was missing |
| Width - Property is required but was missing |
| Depth - Property is required but was missing |
Scenario: Container Profile is not created because Depth is alphanumeric
Given the user is on the New Container Profile page
When the user fills in 'Name' with 'Test Container'
When the user clicks on 'Create'
And the user clicks on 'Container Profile' in the dropdown menu
And the user fills in 'Name'
And the user fills in 'Depth' with 'abc'
And the user fills in 'Height' with '90'
And the user fills in 'Width' with '90'
And the user fills in 'Height' with '2.2'
And the user fills in 'Width' with '3.3'
And the user clicks on 'Save'
Then the following error message is displayed
| Depth - Must be a number with no more than 2 decimal places |
| Depth - Must be a number with no more than 2 decimal places |
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

Then 'the New Container Profile page is displayed' do
expect(current_url).to eq "#{STAFF_URL}/container_profiles/new"
expect(find('h2').text).to eq 'New Container Profile Container Profile'
end

Then 'the Container Profile is created' do
@container_profile_id = current_url.split('/').pop

visit "#{STAFF_URL}/container_profiles/#{@container_profile_id}/edit"

expect(find('#container_profile_name_').value).to eq @uuid
end

0 comments on commit 6e1344a

Please sign in to comment.