CS180 Project5: Marketplace Messaging App -- Testing
This document contains test cases for our Project 5 Program.
Test 1: User Sign Up
Steps:
- User launches application
- User hits the "sign up" button
- User enters a valid name
- User enters a valid email
- User enters a valid password
- User enters the password again to confirm
- User choose the user type from a dropdown manu (seller/customer)
- User hits the "Sign Up!" button
Expected Result:
Application verifies the user's information, shows "Sign Up Success" message, and store user's information into
loginDetails.txt
. After user clicks "OK" on the dialog box, program returns to the initial log in page.
Test Result: PASS
Test 2: Invalid name when signing up
Steps:
- User launches application
- User hits the "sign up" button
- User enters an invalid name (empty or contains special character)
- User hits the "Sign UP!" button
Expected Result:
Application shows an error message box indicating a name error and goes back to the sign up page when user hits "OK"
button or close the error message.
Test Result: PASS
Test 3: Invalid email when signing up
Steps:
- User launches application
- User hits the "sign up" button
- User enters a valid name
- User enters an invalid email (not following email format or email being occupied)
- User hits the "Sign UP!" button
Expected Result:
Application shows an error message box indicating an email error and goes back to the sign up page when user hits "OK"
button or close the error message.
Test Result: PASS
Test 4: Invalid password when signing up
Steps:
- User launches application
- User hits the "sign up" button
- User enters a valid name
- User enters a valid email
- User enters an invalid password (less than 3 characters long or contains ",")
- User hits the "Sign UP!" button
Expected Result:
Application shows an error message box indicating a password error and goes back to the sign up page when user hits "OK"
button or close the error message.
Test Result: PASS
Test 5: Password doesn't match when signing up
Steps:
- User launches application
- User hits the "sign up" button
- User enters a valid name
- User enters a valid password
- User re-enter the password that doesn't match the previously entered password
- User hits the "Sign UP!" button
Expected Result:
Application shows an error message box indication that the two passwords entered doesn't match and goes back to the
sign up page when user hits "OK"button or close the error message.
Test Result: PASS
Test 6: Sign in
Steps:
- User launches application
- User enters their email and password
- User hits the "Sign In" button
Expected Result:
The program checks for login details and show the main manu according to the role type (seller or customer) of the
account.
Test Result: PASS
Test 7: Sign in with incorrect email
Steps:
- User launches application
- User enters an email that's not signed up
- User hits the "Sign In" button
Expected Result:
The program pops up an error message of "email not found" and returns to the sign in page when the user hits OK
or closes the window.
Test Result: PASS
Test 8: Sign in with incorrect password
Steps:
- User launches application
- User enters an email that's signed up
- User enters incorrect password for that account
Expected Result:
The program pops up an error message of "incorrect password" and returns to the sign in page when the user hits OK
or closes the window.
Test Result: PASS
Test 9: Log out in the main menu for seller
Steps:
- User launches application
- User logs in as a seller
- User hits the "log out" button on the main menu
Expected Result:
The application logs the user out and return to the sign in page.
Test Result: PASS
Test 10: Log out in the main menu for customer
Steps:
- User launches application
- User logs in as a customer
- User hits the "log out" button on the main menu
Expected Result:
The application logs the user out and return to the sign in page.
Test Result: PASS
Test 11: Seller creates a new store
Steps:
- User launches application
- User logs in as a seller
- User hits the "Create new store" button
- User enters a valid new store name and new store description
- User hits the "Create Store!" button
Expected Result:
The application creates a new store for that seller and returns to the seller's main menu.
Test Result: PASS
Test 12: Seller trying to create a store with empty store name
Steps:
- User launches application
- User logs in as a seller
- User hits the "Create new store" button
- User hits the "Create Store!" button without entering the store name
Expected Result:
The application opens a message panel showing error message "the name field cannot be empty!" and returns to the
create new store page when user hits "OK" or "X"
Test Result: PASS
Test 13: Seller trying to create a store with empty store description
Steps:
- User launches application
- User logs in as a seller
- User hits the "Create new store" button
- User enters a valid store name
- User hits the "Create Store!" button without entering the store description
Expected Result:
The application opens a message panel showing error message "the description field cannot be empty!" and returns
to the create new store page when user hits "OK" or "X".
Test Result: PASS
Test 14: Seller views messages with customers
Steps:
- User launches application
- User logs in as a seller
- User clicks "View Customers"
- User chooses the customer to view message and the store to use for messaging
from the drop-down menu
- User clicks "Next" Button
Expected Result:
Application shows the messaging interface which shows all the chat history between the seller and the
customer(if any) and provides a series of buttons for different functions.
Test Result: PASS
Test 15: User goes back to main menu from messaging interface
Steps:
- User launches the application
- User login as a seller
- User goes to messaging interface following steps in test 14
- User clicks on "Back" button in the lower right corner
- User clicks on "Back" button again on the next frame
Expected Result:
Application returns to the main seller menu
Test Result: PASS
Test 16: Seller send normal typed message
Steps:
- User launches application
- User logs in as a seller
- User hits the "View Customers" button
- User chooses the customer to message and the store to use for messaging
from the drop-down menu
- User hits "Next" button
- User hits the "Send Message" button
- User chooses "Typed Message" from the first drop-down menu
- User chooses "Message" from the second drop-down menu
- User write the message content to the text field
- User hits "Send" button
Expected Result:
The program goes back to the messaging window, shows the messaging history, a "NEW MESSAGES BELOW" divider, and
the message just sent below the divider. It also stores the message information in a text file for the other end
to read.
Test Result: PASS
Test 17: Seller send an empty message
Steps:
- User launches application
- User logs in as a seller
- User goes to messaging interface following steps in test 14
- User clicks "Send Message" button
- User chooses "Typed Message" from the first drop-down menu
- User chooses "Message" from the second drop-down menu
- User hits "Send" button without input in the "Write Message" text field
Expected Result:
An error message "You cannot send an empty message" pops up and the program returns to send message page when user hits
"OK" or "X".
Test Result: PASS
Test 18: Seller edit message
Steps:
- User launches application
- User logs in as a seller
- User goes to messaging interface following steps in test 14
- User clicks "Edit Message" button
- User chooses the message to be edited from the dropdown menu
- User enters the new message content into the text field below
- User clicks on "Edit" button
Expected Result:
The message is edited. The application returns to the messaging interface and shows the updated
chat history.
Test Result: PASS
Test 19: Seller editing a message to an empty one
Steps:
- User launches application
- User logs in as a seller
- User goes to messaging interface following steps in test 14
- User clicks "Edit Message" button
- User chooses the message to be edited from the dropdown menu
- User hits "Edit" button without entering anything in the text field
Expected Result:
Program pops up an error message "You cannot edit the message to an empty message", and returns to the
messaging interface when user hits "OK" or "X".
Test Result: PASS
Test 20: Seller export conversation history to a .csv file
Steps:
- User launches application
- User logs in as a seller
- User goes to messaging interface following steps in test 14
- User hits "Export Message" button
Expected Result:
The application exports the current conversation history to a .csv file and store that in the current file directory. It
also pops up a messaging panel showing "You have successfully downloaded the conversation history with this customer".
Test Result:PASS
Test 21: Seller export conversation history that doesn't exist to a .csv file
- User launches application
- User logs in as a seller
- User selects a customer with no conversation history and goes to messaging interface following steps in test 14
- User hits "Export Message" button
Expected Result:
The application doesn't export anything and shows an error message "You have no conversation history with this
customer", then go back to the messaging interface after user hits "OK" or "X".
Test Result: PASS
Test 22: Seller deleting a message
Steps:
- User launches application
- User logs in as a seller
- User goes to messaging interface following steps in test 14
- User hits Delete Message button
- User chooses the message to be deleted from the drop-down menu on the next page
- User hits Delete button
Expected Result:
The application deletes that message from the chat history only for this user. It then returns to the messaging
interface with the updated chat history. Upon checking the message interface for the receiver, the deleted message
will still appear in their message history as the message is only deleted for the user
who initiated the delete.
Test Result: PASS
Test 23: Seller blocking a customer
Steps:
- User launches application
- User logs in as a seller
- User goes to messaging interface following steps in test 14 with a customer that's not blocked
- User hits Block Customer button at the top
Expected Result:
The application blocks the customer of the current conversation and shows a panel with message "You have successfully
blocked this customer!" The Block Customer button automatically turns to Unblock Customer. After the user hits
"OK" or "X", the application returns to messaging interface. Using the blocked customer's
account to message the seller will result in the error: You have been blocked by
this seller and won't be able to send messages to any of their stores until they unblock you.
Test Result: PASS
Test 24: Seller unblocking a customer
Steps:
- User launches application
- User logs in as a seller
- User goes to messaging interface following steps in test 14 with a customer that's blocked
- User hits Unblock Customer button at the top
Expected Result:
The application unblocks the customer of the current conversation and shows a panel with message "You have successfully
unblocked this customer!" The Unlock Customer button automatically turns to Block Customer. After the user hits
"OK" or "X", the application returns to messaging interface. The customer can now send
messages to the seller.
Test Result: PASS
Test 25: Seller become invisible to customer
Steps:
- User launches application
- User logs in as a seller
- User goes to messaging interface following steps in test 14 with a customer set to be visible
- USer hits Become Invisible to Customer button
Expected Result:
The application sets the current seller to become invisible to the customer in current conversation and shows a panel
with message "You have successfully became invisible to this customer!" and returns to the message interface after
user hits "OK" or "X". The Become Invisible to Customer button automatically turns to Become Visible to Customer.
Upon trying to search for the seller in the customer's page, the seller's name would not
appear as a search result.
Test Result: PASS
Test 26: Seller become visible to customer
Steps:
- User launches application
- User logs in as a seller
- User goes to messaging interface following steps in test 14 with a customer set to be invisible
- USer hits Become Visible to Customer button
Expected Result:
The application sets the current seller to become visible to the customer in current conversation and shows a panel
with message "You have successfully became visible to this customer!" and returns to the message interface after
user hits "OK" or "X". The Become Visible to Customer button automatically turns to Become Invisible to Customer.
The seller's name now becomes visible when searching for them.
Test Result: PASS
Test 27: Seller searching a customer with empty text field input
Steps:
- User launches the application
- User logs in as a seller
- User hits Search Customers button
- On the next frame, user hits Next button without inputting anything into the text field
Expected Result:
The program shows a message panel with message "The search field cannot be empty!" and returns to the previous frame
when user hits "OK" or "X"
Test Result: PASS
Steps:
- User launches the application
- User logs in as a seller
- User hits Search Customers button
- On the next frame, user enters a customer name that's signed up to be searched
- User hits Next button
Expected Result:
The program opens a new frame with a dropdown box for stores and dropdown box for customer names that matches the word
for searching from user.
Test Result: PASS
Test 29: Seller choosing from the result of searching customers (Following Test 28)
Steps:
- Follow steps from test 28 to the search result frame
- User chooses from the store for contacting on the first dropdown box
- User chooses a customer that matches the search input
- User hits Next button
Expected Result:
The program opens the messaging interface between the user and the chosen customer
Test Result: PASS
Test 30: Seller searches for a customer name that doesn't exist
Steps:
- User launches the application
- User logs in as a seller
- User hits Search Customers button
- On the next frame, user enters a customer name that's not signed up to be searched
- User hits Next button
Expected Result:
The program opens a new frame with a dropdown box for stores and an empty dropdown box for search results, as
there's no matching name. If user hits Next button on this page, the application shows a panel with information
"There are no customers matching your search!" and return to the previous frame after user hits "OK" or "X".
Test Result: PASS
Steps:
- User launches application
- User logs in as a seller
- User hits the Modify Account button
Expected Result:
Program opens a new frame and shows the login information of the current account, including name, email and password.
It also provides four buttons at the bottom: back, edit, save, and delete account
Test Result: PASS
Steps:
- Go to modify account panel following steps in test 31
- User hits the Edit button
- User edits the account information on the next frame
- User hits the Save button
Expected Result:
Program checks for the changed account information. If there's no error, the program save the changes and shows an
information panel "Changes Saves". It then returns to modify account panel after user hits "OK" or "X".
Test Result: PASS
Steps:
- Go to modify account panel following steps in test 31
- User hits the Edit button
- User edits the account with invalid information
- User hits Save button
Expected Result:
An error message pops up indicating the error in input, then goes back to the editing account page after user hits
"OK" or "X"
Test Result: PASS
Test 34: Seller deleting account
Steps:
- Go to modify account panel following steps in test 31
- User hits the Delete Account button
Expected Result:
A farewell message pops up saying "We are sorry to see you go :(", then deletes all the account information, including
login information, all message histories, all the stores creates, etc. The program then returns to the login page.
Test Result: PASS
Test 35: Customer views new messages with sellers
Steps:
- User launch the application
- User logs in as a customer
- User hits View Stores button
- User selects the store to contact from the drop-down menu
- User hits Next button
Expected Result:
The program enters the message interface with the selected store with all buttons working properly
Test Result: PASS
Test 36: Customer searches for seller
Steps:
- User launch the application
- User logs in as a customer
- User hits Search Sellers button
- User enters the name of the seller to be searched
- User press the Next button
Expected Result:
Program checks for the information that matches the customer's input, then shows a dropdown box including all stores
of the seller that matches user's input. If customer choose from the results and hit Next Button, the application
enters the messaging interface with the chosen store.
Test Result: PASS
Steps:
- User launch the application
- User logs in as a customer
- User hits Search Sellers button
- User enters a seller's name that does not exist or has no stores
- User hits Next button
Expected Result:
There's no store matching the user's input, so the dropdown box will be empty. If the user hits Next button, the
program will show an error message "There ar no stores matching the sellers you search..." and goes back to the previous
page after user hits "OK" or "X"
Test Result: PASS
Test 38: Customer searches for seller with empty string
Steps:
- User launch the application
- User logs in as a customer
- User hits Search Sellers button
- User leaves an empty string in the text field
- User hits **Next button
Expected Result:
An error message "The search field cannot be empty" pops up and the program returns to the search seller page after user
hits "OK" or "X".
Test Result: PASS
Test 39: Customer modify account panel
Steps:
- User launch the application
- User logs in as a customer
- User hits Modify Account button
Expected Result:
Modify account panel will appear showing the account information of the user that's currently logged in (Name, email,
and password). Four buttons will appear at the bottom: Back, Edit, Save and Delete Account.
Test Result:PASS
Test 40: Customer modifying account
Steps:
- User enters the Modify account panel following steps in test 39
- User hits Edit button
- The information will turn into text field format
- User enters the account information they want to modify to
- User hits Save button
Expected Result:
The program checks for user's input to make sure everything works, then changes the user's account information and
shows a message "Changes Saved!"
Test Result: PASS
Test 41: Customer deleting account
Steps:
- User enters modify account panel following steps in test 39
- User hits Delete Account button
Expected Result:
A farewell message pops up saying "We are sorry to see you go :(", then deletes all the account information, including
login information, all message histories, block and invisible information, etc. The program then returns to the
login page.
Test Result: PASS
Test 42: Seller viewing new message
Steps:
- User launches the application
- User logs in as a seller
- User hits the New Message button
Expected Result:
Before hitting the New Message button, the button displays the number of new messages; after hitting the button,
the program displays every customer that has a new message, along with the number of new messages, in a dropdown menu.
After user chooses a specific store and hit Next, the program enters the message interface with that store.
Test Result: PASS
Test 43: Seller viewing new message when there's no new message
Steps:
- User launches the application
- User logs in as a seller
- User hits the New Message button when there's no new message (shown as "New Message(0)" on the button)
Expected Result:
The program enters a new frame with an empty dropdown menu because there's no new messages. If the user tries to hit
Next, the program shows an error message "there are no new messages!"
Test Result: PASS
Test 44: Customer viewing new message
Steps:
- User launches the application
- User logs in as a customer
- User hits the New Message button
Expected Result:
Before hitting the New Message button, the button displays the number of new messages; after hitting the button,
the program displays the every store that has a new message in a dropdown menu, along with the number of new messages.
After user chooses a specific store and hit Next, the program enters the message interface with that store.
Test Result: PASS
Test 45: Customer viewing new message when there's no new message
Steps:
- User launches the application
- User logs in as a customer
- User hits the New Message button when there's no new message (shown as "New Message(0)" on the button)
Expected Result:
The program enters a new frame with an empty dropdown menu because there's no new messages. If the user tries to hit
Next, the program shows an error message "there are no new messages!"
Test Result: PASS
Test 46: Seller viewing store statistics
Steps:
- User launches the application
- User logs in as a seller
- User hits the View Statistics button
- User chooses the store to view statistics from a dropdown menu and hits Next
Expected Result:
The program opens a new frame showing the statistics of the corresponding store, with the top 10 most common words
displayed at the left and number of messages from each customer at the right, sorted in default order (by each user's
registration time).
Test Result: PASS
Test 47: Seller sorting store statistics (Following test 46)
Steps:
- User enters the seller statistics panel following steps in test 46
- User hits the "Increasing statistics" or "Decreasing statistics" button
Expected Result:
The statistics of messages on the right side are sorted in an increasing order("Increasing statistics") or decreasing
order("Decreasing statistics") of messages received from top to bottom
Test Result: PASS
Test 48: Customer viewing message statistics
Steps:
- User launches the application
- User login in as a customer
- User hits the View Statistics button
Expected Result:
The program opens a new frame showing the statistics of all chats of the user, with counts for messages sent to stores
at the left and number of messages received from each customer at the right, sorted in default order (by each user's
registration time).
Test Result: PASS
Test 49: Customer sorting message statistics
Steps:
- User enters the customer statistics panel following steps in test 48
- User hits the "Increasing statistics" or "Decreasing statistics" button on the left
Expected Result:
The statistics of messages sent to stores on the left side are sorted in an increasing order("Increasing statistics")
or decreasing order("Decreasing statistics") of messages received from top to bottom
Test Result: PASS
Test 50: Customer sorting message statistics
Steps:
- User enters the customer statistics panel following steps in test 47
- User hits the "Increasing statistics" or "Decreasing statistics" button on the right
Expected Result:
The statistics of messages received from stores on the left side are sorted in an increasing order("Increasing statistics")
or decreasing order("Decreasing statistics") of messages received from top to bottom
Test Result: PASS
Test 51: Concurrency
Steps:
- User launches 2 instances of MessagingClient after starting MessagingServer.
- User logs in as a seller in one instance and as a customer in the other.
- For both instances of client, user navigates to the messaging interface to send a message.
Expected Result:
Both instances of client can proceed concurrently, and are independent of one another. The client instance that sends the message
first would have their message displayed earlier in the chat history.
Test Result: PASS
Test 52: File import
Steps:
- User (Seller/Customer) navigates to the message interface.
- User clicks on Send Message button
- User chooses "File Import" in the dropdown box on how the message will be received.
- User inputs the name of a valid .txt in their working directory.
Expected Result:
The messages in the file appear in the message history. Each line of text in the file
represents one message, i.e., if the file has 5 lines of text, there will be 5 new messages
sent.
Test Result: PASS
Test 53: Disappearing Messages
Steps:
- User (Seller/Customer) navigates to the message interface.
- User clicks on Send Message button
- User chooses "Disappearing Message" in the dropdown box on the type of message to send.
- User inputs the text in the JTextField.
Expected Result:
The disappearing message appears in the message history with a "(Disappearing)" mark.
Upon seeing the disappearing message and exiting the messaging interface,
the disappearing message will disappear. This applies for both sender and receiver.
Test Result: PASS