Skip to content

Commit 71b332b

Browse files
Location create
1 parent af2cbaf commit 71b332b

File tree

2 files changed

+41
-16
lines changed

2 files changed

+41
-16
lines changed
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
Feature: Location Create
22
Background:
33
Given an administrator user is logged in
4-
Scenario: Simple Location is created
5-
Given the user is on the New Location page
4+
Scenario: Single Location is created
5+
Given the New Location page is displayed
66
When the user fills in 'Building'
77
And the user fills in 'Barcode'
88
And the user clicks on 'Save Location'
99
Then the 'Location' created message is displayed
10-
Scenario: Simple Location is not created because required field Building is missing
11-
Given the user is on the New Location page
10+
Scenario: Single Location is not created because required field Building is missing
11+
Given the New Location page is displayed
1212
When the user clicks on 'Save Location'
1313
Then the following error message is displayed
1414
| Building - Property is required but was missing |
15-
Scenario: Simple Location is not created because required field Barcode is missing
16-
Given the user is on the New Location page
15+
Scenario: Single Location is not created because required field Barcode is missing
16+
Given the New Location page is displayed
1717
When the user fills in 'Building'
1818
And the user clicks on 'Save Location'
1919
Then the following error message is displayed
2020
| You must either specify a barcode, a classification, or both a coordinate 1 label and coordinate 1 indicator |
2121
Scenario: Batch Location is created
22-
Given the user is on the New Batch Location page
22+
Given the New Batch Location page is displayed
2323
When the user fills in 'Building'
24-
And the user fills in 'Label' for 'Coordinate Range 1'
25-
And the user fills in 'Range Start' for 'Coordinate Range 1'
26-
And the user fills in 'Range End' for 'Coordinate Range 1'
24+
And the user fills in Coordinate Range 1 Label with 'Test'
25+
And the user fills in Coordinate Range 1 Range Start with '1'
26+
And the user fills in Coordinate Range 1 Range End with '3'
2727
And the user clicks on 'Create Location'
28-
Then the 'Batch Locations' created message is displayed
28+
Then the '3 Locations' created message is displayed
2929
Scenario: Batch Location is not created because required fields are missing
3030
Given the user is on the New Batch Location page
3131
When the user clicks on 'Create Locations'
3232
Then the following error messages are displayed
3333
| Building - Property is required but was missing |
3434
| Coordinate Range 1 - Property is required but was missing |
3535
Scenario: Number of Locations is previewed
36-
Given the user is on the New Batch Location page
36+
Given the New Batch Location page is displayed
3737
When the user fills in 'Building'
38-
And the user fills in 'Label' for 'Coordinate Range 1'
39-
And the user fills in 'Range Start' for 'Coordinate Range 1'
40-
And the user fills in 'Range End' for 'Coordinate Range 1'
38+
And the user fills in Coordinate Range 1 Label with 'Test'
39+
And the user fills in Coordinate Range 1 Range Start with '1'
40+
And the user fills in Coordinate Range 1 Range End with '3'
4141
And the user clicks on 'Preview Locations'
42-
Then the Preview Locations modal with the number of Locations is displayed
42+
Then the Preview Locations modal with the number of Locations is displayed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# frozen_string_literal: true
2+
3+
Given 'the New Location page is displayed' do
4+
visit "#{STAFF_URL}/locations/new"
5+
end
6+
7+
Given 'the New Batch Location page is displayed' do
8+
visit "#{STAFF_URL}/locations/batch"
9+
end
10+
11+
When 'the user fills in Coordinate Range 1 Label with {string}' do |value|
12+
fill_in 'location_batch_coordinate_1_range__label_', with: value
13+
end
14+
15+
When 'the user fills in Coordinate Range 1 Range Start with {string}' do |value|
16+
fill_in 'location_batch_coordinate_1_range__start_', with: value
17+
end
18+
19+
When 'the user fills in Coordinate Range 1 Range End with {string}' do |value|
20+
fill_in 'location_batch_coordinate_1_range__end_', with: value
21+
end
22+
23+
Then 'the Preview Locations modal with the number of Locations is displayed' do
24+
expect(page).to have_css '#batchPreviewModal'
25+
end

0 commit comments

Comments
 (0)