Skip to content

Commit

Permalink
Third person step names (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
blacksmith-welder authored Sep 7, 2024
1 parent b665782 commit 05b981f
Show file tree
Hide file tree
Showing 15 changed files with 100 additions and 104 deletions.
6 changes: 3 additions & 3 deletions staff-features/accessions/accession_create.feature
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Feature: Accession Create
Background:
Given I am logged in as an admin user
Given the user is logged in as an administrator
Scenario: Accession is created
Given I am on the New Accession page
Given the user is on the New Accession page
When the user fills in all the required fields
When the user clicks on Save
Then a new accession is created
Scenario: Accession is not created
Given I am on the New Accession page
Given the user is on the New Accession page
When the user does not fill in all the required fields
When the user clicks on Save
Then a new accession is not created
20 changes: 10 additions & 10 deletions staff-features/accessions/accession_delete.feature
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Feature: Accession Delete
Background:
Given I am logged in as an admin user
Given the user is logged in as an administrator
Scenario: Accession is deleted from the search results
Given an accession has been created
And the accession is in the search results
When I click on the checkbox of the accession
And I click on Delete
And I click on Delete Records
When the user clicks on the checkbox of the accession
And the user clicks on Delete
And the user clicks on Delete Records
And the message "Records deleted" is displayed
And the message "No records found" is displayed
Scenario: Accession is deleted from the view page
Given an accession has been created
And I am in the accession details page
When I click on Delete
And I confirm the delete action
And the user is on the accession details page
When the user clicks on Delete
And the user confirms the delete action
Then the accession is deleted
Scenario: Cancel accession delete from the view page
Given an accession has been created
And I am in the accession details page
When I click on Delete
When I click on Cancel
And the user is on the accession details page
When the user clicks on Delete
When the user clicks on Cancel
Then the accession is not deleted
14 changes: 7 additions & 7 deletions staff-features/accessions/accessions_search.feature
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
Feature: Accessions Search
Background:
Given I am logged in as an admin user
Given the user is logged in as an administrator
Scenario: Search accession by title
Given an accession has been created
When I click on Browse
And I click on Accessions
And I search for the accession title
When the user clicks on Browse
And the user clicks on Accessions
And the user searches for the accession title
Then the accession is in the search results
Scenario: Sort accessions by title
Given two accessions have been created
And the accessions are on the search results sorted by ascending title
When I click on Title
When the user clicks on Title
Then the accessions are sorted by descending title
Scenario: View accession
Given an accession has been created
When the accession is in the search results
And I click on the View button
Then I can view the accession details page
And the user clicks on the View button
Then the user can view the accession details page
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

Given('I am on the New Accession page') do
Given('the user is on the New Accession page') do
@uuid = SecureRandom.uuid

click_on 'Create'
Expand All @@ -15,10 +15,6 @@
fill_in 'accession_id_0_', with: ''
end

When('the user clicks on Save') do
click_button 'Save'
end

Then('a new accession is created') do
expect(find('h2').text).to eq "Accession #{@uuid} Accession"
expect(find('.alert.alert-success.with-hide-alert').text).to eq 'Accession created'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

Given 'I am in the accession details page' do
Given 'the user is on the accession details page' do
visit "#{STAFF_URL}/accessions"

fill_in 'filter-text', with: @uuid
Expand All @@ -16,15 +16,15 @@
end
end

When 'I click on the checkbox of the accession' do
When 'the user clicks on the checkbox of the accession' do
table_row = find('tr', text: @uuid, match: :first)

within table_row do
check 'multiselect-item'
end
end

When 'I confirm the delete action' do
When 'the user confirms the delete action' do
within '#confirmChangesModal' do
click_on 'Delete'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
click_on 'Save'
end

When 'I search for the accession title' do
When 'the user searches for the accession title' do
fill_in 'filter-text', with: @uuid

within '.search-filter' do
Expand All @@ -26,15 +26,15 @@
end
end

When 'I click on the View button' do
When 'the user clicks on the View button' do
table_row = find('tr', text: @uuid, match: :first)

within table_row do
click_on 'View'
end
end

Then 'I can view the accession details page' do
Then 'the user can view the accession details page' do
title = find('h2')

expect(title.text).to eq "Accession #{@uuid} Accession"
Expand Down
14 changes: 7 additions & 7 deletions staff-features/digital-objects/digital_object_create.feature
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Feature: Create Digital Object
Background:
Given I am logged in as an admin user
Given the user is logged in as an administrator
Scenario: Digital Object is created
Given I am on the New Digital Object page
When I fill in Title with a unique id
And I fill in Identifier with a unique id
And I click on Save
Given the user is on the New Digital Object page
When the user fills in Title with a unique id
And the user fills in Identifier with a unique id
And the user clicks on Save
Then the digital object is created
Scenario: Digital Object is not created because required fields are missing
Given I am on the New Digital Object page
When I click on Save
Given the user is on the New Digital Object page
When the user clicks on Save
Then the following error messages are displayed:
| Title - Property is required but was missing |
| Identifier - Property is required but was missing |
Expand Down
6 changes: 3 additions & 3 deletions staff-features/digital-objects/digital_object_create.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# frozen_string_literal: true

Given('I am on the New Digital Object page') do
Given('the user is on the New Digital Object page') do
@uuid = SecureRandom.uuid

visit "#{STAFF_URL}/digital_objects/new"
end

When('I fill in Title with a unique id') do
When('the user fills in Title with a unique id') do
fill_in 'Title', with: "Digital Object Title #{@uuid}"
end

When('I fill in Identifier with a unique id') do
When('the user fills in Identifier with a unique id') do
fill_in 'Identifier', with: @uuid
end

Expand Down
18 changes: 9 additions & 9 deletions staff-features/repositories/repository_create.feature
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Feature: Create repository
Scenario: Repository is created from an admin user
Given I am logged in as an admin user
When I click on System
And I click on Manage Repositories
And I click on Create Repository
And I fill in the Repository Short Name
And I fill in the Repository Name
And I click on Save
Given the user is logged in as an administrator
When the user clicks on System
And the user clicks on Manage Repositories
And the user clicks on Create Repository
And the user fills in the Repository Short Name
And the user fills in the Repository Name
And the user clicks on Save
Then the message "Repository Created" is displayed
And the repository is created
Scenario: Repository is not created from a view-only user
Given I am logged in as a view-only user
When I click on System
Given the user is logged in as a view-only user
When the user clicks on System
Then the Manage Repositories button should not be in the dropdown menu
4 changes: 2 additions & 2 deletions staff-features/repositories/repository_create.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# frozen_string_literal: true

When 'I fill in the Repository Short Name' do
When 'the user fills in the Repository Short Name' do
@uuid = SecureRandom.uuid

fill_in 'Repository Short Name', with: "Repository Short Name #{@uuid}"
end

When 'I fill in the Repository Name' do
When 'the user fills in the Repository Name' do
@uuid = SecureRandom.uuid

fill_in 'Repository Name', with: "Repository Name #{@uuid}"
Expand Down
22 changes: 11 additions & 11 deletions staff-features/resources/update_basic_information.feature
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Feature: Update Resource Basic Information
Background:
Given I am logged in as an admin user
Given the user is logged in as an administrator
Given a resource has been created
Scenario: Successfully update resource basic information
Given I am on the resource edit page
When I select "Records" from "Resource Type"
When I check Publish?
When I check Restrictions Apply?
When I fill in Repository Processing Note with "Repository Processing Note"
When I click on Save Resource
Given the user is on the resource edit page
When the user selects "Records" from "Resource Type"
When the user checks Publish?
When the user checks Restrictions Apply?
When the user fills in Repository Processing Note with "Repository Processing Note"
When the user clicks on Save Resource
Then the resource is updated
Then Resource Type has value Records
Then Publish? is checked
Then Restrictions Apply? is checked
Then Repository Processing Note has value "Repository Processing Note"
Scenario: Revert changes
Given I am on the resource edit page
When I change the resource Title
When I change the resource Identifier
When I click on Revert Changes
Given the user is on the resource edit page
When the user changes the resource Title
When the user changes the resource Identifier
When the user clicks on Revert Changes
Then the resource Title does not change
Then the resource Identifier does not change
12 changes: 6 additions & 6 deletions staff-features/resources/update_basic_information.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@
create_resource(@uuid)
end

Given 'I am on the resource edit page' do
Given 'the user is on the resource edit page' do
search(@uuid)

click_on 'Edit'
end

When 'I check Publish?' do
When 'the user checks Publish?' do
find('#resource_publish_').check
end

When 'I check Restrictions Apply?' do
When 'the user checks Restrictions Apply?' do
find('#resource_restrictions_').check
end

When 'I fill in Repository Processing Note with {string}' do |value|
When 'the user fills in Repository Processing Note with {string}' do |value|
fill_in 'Repository Processing Note', with: value
end

When 'I change the resource Title' do
When 'the user changes the resource Title' do
fill_in 'resource_title_', with: 'Resource title chagned'
end

When 'I change the resource Identifier' do
When 'the user changes the resource Identifier' do
fill_in 'resource_id_0_', with: 'Resource identifier chagned'
end

Expand Down
Loading

0 comments on commit 05b981f

Please sign in to comment.