-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af2cbaf
commit 71b332b
Showing
2 changed files
with
41 additions
and
16 deletions.
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
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
25
staff_features/locations/step_definitions/location_create.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,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 |