Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location create #109

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions staff_features/locations/location_create.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Feature: Location Create
Background:
Given an administrator user is logged in
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: 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: 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 New Batch Location page is displayed
When the user fills in 'Building'
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 '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 New Batch Location page is displayed
When the user fills in 'Building'
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
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
Loading