Scenario 1: User creates a basic Party record
- Given the User is on the Parties Page
- When the User clicks the 'Add New Party' button
- And the User selects "Party" as the Party Type
- And the User enters "John Smith" in the Name field
- And the User enters "0123456789" in the Mobile Number field
- And the User clicks 'Save'
- Then the new Party appears in the parties list
- And a success message is displayed
Scenario 2: User creates a Party with full details
- Given the User is on the Parties Page
- When the User clicks the 'Add New Party' button
- And the User selects "Party" as the Party Type
- And the User enters "ABC Electronics Ltd" in the Name field
- And the User enters "9876543210" in the Mobile Number field
- And the User enters "0123456789" in the Alternative Mobile Number field
- And the User enters "123 Business Park, Tech City" in the Street Address field
- And the User enters "12345" in the Postal Code
- And the User enters "Dhaka" in the City
- And the User clicks 'Save'
- Then the new Party appears in the parties list
- And all entered details are saved correctly
Scenario 3: User attempts to create a party with duplicate mobile number
- Given a Party with mobile number "5555555555" already exists
- And the User is on the Parties Page
- When the User clicks the 'Add New Party' button
- And the User selects "Party" as the Party Type
- And the User enters "James Wilson" in the Name field
- And the User enters "5555555555" in the Mobile Number field
- And the User clicks 'Save'
- Then an error message is displayed: "Mobile number already exists"
- And the form remains open with entered data
Scenario 4: User searches for an existing party
- Given a Party named "Sarah Johnson" with mobile number "7777777777" exists
- And the User is on the Parties Page
- When the User enters "777" in the search field
- Then "Sarah Johnson" appears in the search results
- When the User enters "Sarah" in the search field
- Then "Sarah Johnson" appears in the search results
Scenario 5: User attempts to create a party with missing required fields
- Given the User is on the Parties Page
- When the User clicks the 'Add New Party' button
- And the User selects "Party" as the Party Type
- And the User enters "John Smith" in the Name field
- And leaves the Mobile Number field empty
- And the User clicks 'Save'
- Then an error message is displayed: "Mobile number is required"
- When the User enters "0123456789" in the Mobile Number field
- And clears the Name field
- And the User clicks 'Save'
- Then an error message is displayed: "Name is required"
Scenario 6: User can archive and unarchive a Party
- Given the User is on the Active Parties tab
- When the User clicks the 'Archive' button for Party 'Sarah Johnson'
- Then 'Sarah Johnson' should no longer appear in the Active Parties table
- And the User navigates to the Archived Parties tab
- Then 'Sarah Johnson' should appear in the Archived Parties table
- When the User clicks the 'Unarchive' button for Party 'Sarah Johnson'
- Then 'Sarah Johnson' should no longer appear in the Archived Parties table
- And the User navigates to the Active Parties tab
- Then 'Sarah Johnson' should appear again in the Active Parties table
Scenario 7: User attempts to add a party with an invalid mobile number
- Given the User is on the Parties Page
- When the User clicks the 'Add New Party' button
- And the User selects "Party" as the Party Type
- And the User enters "ABC Electronics Ltd" in the Name field
- And the User enters "[email protected]" in the Mobile Number field
- And the User clicks 'Save'
- Then the it should show a message "Invalid Mobile Number Format"
Scenario 8: User creates a parties invoice
- Given the User is on the Active Parties tab
- When the User clicks the 'Add Invoice' button on the first supplier row
- And selects "Main Branch" from the branch dropdown
- And selects an inventory item from the dropdown
- And enters "50" in the quantity field
- And enters "60" in the price field
- And clicks the "Create Invoice" button
- Then a success message "Invoice created successfully" should appear