Skip to content

Commit 33e6be4

Browse files
committed
gherkin scenarios for edit accessions
1 parent 089aae3 commit 33e6be4

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Feature: Accession edit
2+
Background:
3+
Given an administrator user is logged in
4+
And an Accession has been created
5+
Scenario: Accession is opened in the edit mode from the browse menu
6+
Given the Accession appears in the search results list
7+
When the user clicks on 'Edit'
8+
Then the Accession is opened in the edit mode
9+
And all fields become editable
10+
Scenario: Accession is opened in the edit mode from the view mode
11+
Given the Accession is opened in the view mode
12+
When the user clicks on 'Edit'
13+
Then the Accession is opened in the edit mode
14+
And all fields become editable
15+
Scenario Outline: Accession is successfully updated
16+
Given the Accession is opened in edit mode
17+
When the user changes the <Field> field to <NewValue>
18+
And the user saves the changes
19+
Then the Accession is updated with the new <Field> as <NewValue>
20+
And the 'Accession updated' message is displayed
21+
And the updated value appears in the accession details
22+
Examples:
23+
| Field | NewValue |
24+
| Title | Updated Test Accession |
25+
| Date | 2024-10-03 |
26+
Scenario: Accession is not updated after changes are reverted
27+
Given the Accession is opened in edit mode
28+
When the user changes the 'Title' field
29+
And the user clicks on 'Revert changes'
30+
Then the Accession is not updated
31+
And the 'Title' field still shows the original title
32+
Scenario: Accession update fails due to invalid date input
33+
Given the Accession is opened in edit mode
34+
When the user changes the 'Date' field to '2024-13-15'
35+
And the user saves the changes
36+
Then the following error message is displayed
37+
| Accession Date - Not a valid date |
38+
And the Accession is not updated
39+
And the 'Date' field still shows the original date
40+
Scenario: Accession update succeeds for User A with a warning for other user editing it
41+
Given the Accession is opened in edit mode by User A
42+
And the Accession is also opened in edit mode by User B
43+
When User A changes the 'Title' field
44+
And User A saves the changes
45+
Then the 'Accession updated' message is displayed
46+
And User A sees the following conflict message
47+
| This record is currently being edited by another user. Please contact the following users to ensure no conflicts occur: B |
48+
Scenario: Accession update fails due to concurrent edit by another user
49+
Given the Accession is opened in edit mode by User A
50+
And the Accession is also opened in edit mode by User B
51+
When User A changes the 'Title' field and saves the changes
52+
And User B changes the 'Title' field and saves the changes
53+
Then User B sees the following conflict message
54+
| Failed to save your changes - This record has been updated by another user. Please refresh the page to access the latest version.|
55+
Scenario: Accession update fails due to missing required field
56+
Given the Accession is opened in edit mode
57+
When the user clears the 'Identifier' field
58+
And the user saves the changes
59+
Then the following error message is displayed
60+
| Identifier - Property is required but was missing |
61+
And the Accession is not updated
62+
Scenario: User is warned about unsaved changes when navigating away
63+
Given the Accession is opened in edit mode
64+
When the user changes the 'Title' field
65+
And the user attempts to navigate away without saving
66+
Then a confirmation dialog is displayed asking if the user wants to leave the site with unsaved changes
67+
When the user chooses to leave the page
68+
Then the Accession is not updated

0 commit comments

Comments
 (0)