Skip to content

Commit

Permalink
Location create
Browse files Browse the repository at this point in the history
  • Loading branch information
blacksmith-welder committed Mar 11, 2025
1 parent af2cbaf commit 71b332b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 16 deletions.
32 changes: 16 additions & 16 deletions staff_features/locations/location_create.feature
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
Feature: Location Create
Background:
Given an administrator user is logged in
Scenario: Simple Location is created
Given the user is on the New Location page
Scenario: Single Location is created
Given the New Location page is displayed
When the user fills in 'Building'
And the user fills in 'Barcode'
And the user clicks on 'Save Location'
Then the 'Location' created message is displayed
Scenario: Simple Location is not created because required field Building is missing
Given the user is on the New Location page
Scenario: Single Location is not created because required field Building is missing
Given the New Location page is displayed
When the user clicks on 'Save Location'
Then the following error message is displayed
| Building - Property is required but was missing |
Scenario: Simple Location is not created because required field Barcode is missing
Given the user is on the New Location page
Scenario: Single Location is not created because required field Barcode is missing
Given the New Location page is displayed
When the user fills in 'Building'
And the user clicks on 'Save Location'
Then the following error message is displayed
| You must either specify a barcode, a classification, or both a coordinate 1 label and coordinate 1 indicator |
Scenario: Batch Location is created
Given the user is on the New Batch Location page
Given the New Batch Location page is displayed
When the user fills in 'Building'
And the user fills in 'Label' for 'Coordinate Range 1'
And the user fills in 'Range Start' for 'Coordinate Range 1'
And the user fills in 'Range End' for 'Coordinate Range 1'
And the user fills in Coordinate Range 1 Label with 'Test'
And the user fills in Coordinate Range 1 Range Start with '1'
And the user fills in Coordinate Range 1 Range End with '3'
And the user clicks on 'Create Location'
Then the 'Batch Locations' created message is displayed
Then the '3 Locations' created message is displayed
Scenario: Batch Location is not created because required fields are missing
Given the user is on the New Batch Location page
When the user clicks on 'Create Locations'
Then the following error messages are displayed
| Building - Property is required but was missing |
| Coordinate Range 1 - Property is required but was missing |
Scenario: Number of Locations is previewed
Given the user is on the New Batch Location page
Given the New Batch Location page is displayed
When the user fills in 'Building'
And the user fills in 'Label' for 'Coordinate Range 1'
And the user fills in 'Range Start' for 'Coordinate Range 1'
And the user fills in 'Range End' for 'Coordinate Range 1'
And the user fills in Coordinate Range 1 Label with 'Test'
And the user fills in Coordinate Range 1 Range Start with '1'
And the user fills in Coordinate Range 1 Range End with '3'
And the user clicks on 'Preview Locations'
Then the Preview Locations modal with the number of Locations is displayed
Then the Preview Locations modal with the number of Locations is displayed
25 changes: 25 additions & 0 deletions staff_features/locations/step_definitions/location_create.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

Given 'the New Location page is displayed' do
visit "#{STAFF_URL}/locations/new"
end

Given 'the New Batch Location page is displayed' do
visit "#{STAFF_URL}/locations/batch"
end

When 'the user fills in Coordinate Range 1 Label with {string}' do |value|
fill_in 'location_batch_coordinate_1_range__label_', with: value
end

When 'the user fills in Coordinate Range 1 Range Start with {string}' do |value|
fill_in 'location_batch_coordinate_1_range__start_', with: value
end

When 'the user fills in Coordinate Range 1 Range End with {string}' do |value|
fill_in 'location_batch_coordinate_1_range__end_', with: value
end

Then 'the Preview Locations modal with the number of Locations is displayed' do
expect(page).to have_css '#batchPreviewModal'
end

0 comments on commit 71b332b

Please sign in to comment.