Skip to content

Commit

Permalink
Merge pull request #553 from yixiann/final-dg
Browse files Browse the repository at this point in the history
Fix manual testing
  • Loading branch information
bryanljx authored Nov 7, 2022
2 parents 8296826 + 64073f0 commit c1595af
Show file tree
Hide file tree
Showing 2 changed files with 222 additions and 43 deletions.
264 changes: 221 additions & 43 deletions docs/_dg/InstructionsForManualTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,131 +10,309 @@ These instructions only provide a starting point for testers to work on; testers
#### Initial launch

1. Download the jar file and copy it into an empty folder
1. Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimal.
1. Double-click the jar file.
* Expected output: Shows the GUI with a set of sample items.

### Items

#### Create a new Item

1. Test case: `new n/Potato qty/2 u/kg bgt/10-10-2022 exp/11-11-2022 p/4 r/favourite` <br> Expected Output in [[ item-list-box:Item List Box ]]: New item added into the list. <br> Expected Output in [[ command-output-box:Command Output Box ]]: New item added message and its details.
1. Test case: `new qty/2` <br> Expected Output in Command Output Box: Error message for invalid command format.
`new n/Potato qty/2 u/kg bgt/10-10-2022`

Expected Output in the [[ item-list-box:Item List Box ]]:
New item added into the list.

Expected Output in the [[ command-output-box:Command Output Box ]]:
New item added message is displayed with the item details.

`new qty/2`

Expected Output in the [[ command-output-box:Command Output Box ]]:
Error message for invalid command format.

#### List all items

Prerequisite: There is at least 1 item stored in FoodRem.
Prerequisite:
There is at least 1 item stored in FoodRem.

1. Test case: `list`<br> Expected Output in Item List Box: All items stored in FoodRem displayed. <br>Expected Output in Command Output Box: Listed all items message.
`list`

Expected Output in the [[ item-list-box:Item List Box ]]:
All items stored in FoodRem is displayed.

Expected Output in the [[ command-output-box:Command Output Box ]]:
Listed all items message.

#### Search for an Item

Prerequisite: Suppose there is only one item named `Potato` stored in FoodRem.
Prerequisite:
There is only one item named `Potato` stored in FoodRem.

`find Potato`

Expected Output in the [[ item-list-box:Item List Box ]]:
`Potato` item is displayed.

1. Test case: `find Potato`<br> Expected Output in Item List Box: `Potato` item displayed. <br>Expected Output in Command Output Box: 1 item listed message.
1. Test case: `find strawberry` <br>Expected Output in Item List Box: No items displayed. <br>Expected Output in Command Output Box: 0 item listed message.
Expected Output in the [[ command-output-box:Command Output Box ]]:
1 item listed message.

`find strawberry`

Expected Output in the [[ item-list-box:Item List Box ]]:
No items display

Expected Output in the [[ command-output-box:Command Output Box ]]:
0 items listed message.

#### Sort all items by an attribute

Prerequisite: Suppose there are a few items stored in FoodRem and shown in Item List Box with different names.
Prerequisite:
There are a few items stored in FoodRem and shown in the [[ item-list-box:Item List Box ]] with different names.

`sort n/`

1. Test case: `sort n/` <br> Expected Output in Item List Box: Items sorted in ascending alphabetical order based on name. <br>Expected Output in Command Output Box: Items sorted message.
Expected Output in the [[ item-list-box:Item List Box ]]:
Items are sorted in ascending alphabetical order based on name.

Expected Output [[ command-output-box:Command Output Box ]]:
Items sorted message.

#### View the information of an Item

Prerequisite: Suppose there is at least 1 item shown in the Item List Box.
Prerequisite:
There is at least 1 item shown in the [[ item-list-box:Item List Box ]].

`view 1`

1. Test case: `view 1` <br> Expected Output in Item List Box: Still showing the same list as before. <br>Expected Output in Command Output Box: Details of first item in Item List Box shown. Displayed information includes the name, quantity, unit, bought date, expiry date, price, remarks and tags of items.
Expected Output in the [[ item-list-box:Item List Box ]]:
Still showing the same list as before.

Expected Output [[ command-output-box:Command Output Box ]]:
Details of first item in Item List Box shown.
Displayed information includes the name, quantity, unit, bought date, expiry date, price, remarks and tags of items.

#### Increment the quantity of an item

Prerequisite: Suppose the first item in the Item List Box has a quantity of 1.
Prerequisite:
The first item in the Item List Box has a quantity of 1.

`inc 1 qty/20`

1. Test case: `inc 1 qty/2` <br> Expected Output in Item List Box: Still showing the same list as before but with first item quantity increased by 2 <br>Expected Output in Command Output Box: Incremented item quantity message with details of first item in Item List shown.
Expected Output in the [[ item-list-box:Item List Box ]]:
Still showing the same list as before but with first item quantity increased by 20.

Expected Output [[ command-output-box:Command Output Box ]]:
Incremented item quantity message with details of first item in Item List shown.

`inc 1`

Expected Output in the [[ item-list-box:Item List Box ]]:
Still showing the same list as before but with first item quantity increased by 1.

Expected Output [[ command-output-box:Command Output Box ]]:
Incremented item quantity message with details of first item in Item List shown.

#### Decrement the quantity of an item

Prerequisite: Suppose the first item in the Item List Box has a quantity of 3.
Prerequisite:
The first item in the Item List Box has a quantity of 3.

`dec 1 qty/2`

Expected Output in the [[ item-list-box:Item List Box ]]:
Still showing the same list as before but with first item quantity decreased by 2.

Expected Output [[ command-output-box:Command Output Box ]]:
Decremented item quantity message with details of first item in Item List shown.

`dec 1`

1. Test case: `dec 1 qty/2` <br> Expected Output in Item List Box: Still showing the same list as before but with first item quantity decreased by 2 <br>Expected Output in Command Output Box: Decremented item quantity message with details of first item in Item List shown.
`
Expected Output in the [[ item-list-box:Item List Box ]]:
Still showing the same list as before but with first item quantity decreased by 1.

Expected Output [[ command-output-box:Command Output Box ]]:
Decremented item quantity message with details of first item in Item List shown.

#### Edit the information of an item

Prerequisite: Suppose the first item in the Item List Box has a name of `Potato`.
Prerequisite:
The first item in the [[ item-list-box:Item List Box ]] has a name of `Potato`.

`edit 1 n/Tomato`

1. Test case: `edit 1 n/Tomato` <br> Expected Output in Item List Box: The `Potato`item has been renamed to `Tomato` and this is now reflected in Item List Box<br> Expected Output in Command Output Box: Item edited message with details of the edited item shown.
Expected Output [[ item-list-box:Item List Box ]]:
The `Potato` item has been renamed to `Tomato` and this is now reflected in the [[ item-list-box:Item List Box ]].

Expected Output [[ command-output-box:Command Output Box ]]:
Item edited message with details of the edited item shown.

#### Add a remark to an item

Prerequisite: Suppose the first item in the Item List Box has no remarks.
Prerequisite:
The first item in the [[ item-list-box:Item List Box ]] has no remarks.

`rmk 1 r/For Party`

1. Test case: `rmk 1 r/For Party` <br> Expected Output in Item List Box: Same list as shown before<br> Expected Output in Command Output Box: Remark updated message with details of the item that has remark updated shown.
Expected Output in the [[ item-list-box:Item List Box ]]:
Same list as shown before.

Expected Output [[ command-output-box:Command Output Box ]]:
Remark updated message with the details of the item that has remark updated shown.

#### Deleting an Item

Prerequisite: There is at least 1 item in the Item List Box.
Prerequisite:
There is at least 1 item in the [[ item-list-box:Item List Box ]].

`del 1`

Expected Output in the [[ item-list-box:Item List Box ]]:
First item in the list is deleted.

1. Test Case: `del 1`<br> Expected Output in Item List Box: First item in list is deleted <br> Expected Output in Command Output Box: Deleted item message and its details.
1. Test Case: `del 0`<br> Expected Output in Command Output Box: Error message for invalid command format.
Expected Output [[ command-output-box:Command Output Box ]]:
Deleted item message and its details.

`del 0`

Expected Output [[ command-output-box:Command Output Box ]]:
Error message for invalid command format.

### Tags

#### Create a new tag

1. Test Case: `newtag n/Fruits`<br> Expected Output in Command Output Box: New tag added and its details.
1. Test Case: `newtag n/!`<br> Expected Output in Command Output Box: Error message for invalid name format.
`newtag n/Fruits`

Expected Output [[ command-output-box:Command Output Box ]]:
New tag added and its details.

`newtag n/\`

Expected Output [[ command-output-box:Command Output Box ]]:
Error message for invalid name format.

#### List all tags

1. Test Case: `listtag` <br> Expected Output in Command Output Box: All current exisiting tags of FoodRem are listed.
`listtag`

Expected Output [[ command-output-box:Command Output Box ]]:
All current exisiting tags of FoodRem are listed.

#### Tag an Item

Prerequisite: Tag and Item to be tagged exists.

1. Test Case: `tag 1 n/Food`<br> Expected Output in Item List Box: The specified item is tagged. <br> Expected Output in Command Output Box: Message indicating item has been successfully tagged.
1. Test Case: `tag n/Food`<br> Expected Output in Command Output Box: Error message for invalid command format.
`tag 1 n/Food`

Expected Output in the [[ item-list-box:Item List Box ]]:
The specified item is tagged.

Expected Output [[ command-output-box:Command Output Box ]]:
Message indicating item has been successfully tagged.

`tag n/Food`

Expected Output [[ command-output-box:Command Output Box ]]:
Error message for invalid command format.

#### Untag an Item

Prerequisite: Tag and Item to be tagged exists. Tag is also currently tagged to the specified item.

1. Test Case: `untag 1 n/Food`<br> Expected Output in Item List Box: The specified item is untagged from the tag. <br> Expected Output in Command Output Box: Message indicating item has been successfully untagged.
1. Test Case: `untag n/Food`<br> Expected Output in Command Output Box: Error message for invalid command format.
`untag 1 n/Food`

Expected Output in the [[ item-list-box:Item List Box ]]:
The specified item is untagged from the tag.

Expected Output [[ command-output-box:Command Output Box ]]:
Message indicating item has been successfully untagged.

`untag n/Food`

Expected Output [[ command-output-box:Command Output Box ]]:
Error message for invalid command format.

#### Rename a Tag

Prerequisite: Original tag to be renamed exists.
Prerequisite:
A tag with a tag name `Fruits` exist and a tag with a tag name `Food` does not exist.

`renametag n/Fruits n/Food`

1. Test Case: `renametag n/Fruits n/Food`<br> Expected Output in Item List Box: The specified tags are renamed. <br> Expected Output in Command Output Box: Details of original and renamed tags.
1. Test case: `renametag n/Food n/Food` <br>Expected Output in Command Output Box: Error message for renaming to duplicate name.
Expected Output in the [[ item-list-box:Item List Box ]]:
The `Fruits` tag is renamed to `Food`.

Expected Output [[ command-output-box:Command Output Box ]]:
Details of original and renamed tags.

`renametag n/Fruits n/Fruits`

Expected Output [[ command-output-box:Command Output Box ]]:
Error message for renaming to duplicate name.

#### Delete a Tag

Prerequisite: Tag currently exists in FoodRem
Prerequisite:
A tag with a tag name `Food` currently exists in FoodRem.

`deletetag n/Food`

1. Test case: `deletetag n/Food`<br> Expected Output in Item List Box: Specified tag if shown, is deleted. <br> Expected Output in Command Output Box: Tag deleted details.
Expected Output in the [[ item-list-box:Item List Box ]]:
`Food` tags if shown, are deleted.

Expected Output [[ command-output-box:Command Output Box ]]:
Tag deleted details.

#### Filter by a Tag

Prerequisite: Suppose a tag with name of `fruits` currently exists in FoodRem and is tagged to a few items.
Prerequisite:
A tag with a tag name of `fruits` currently exists in FoodRem and is tagged to a few items.

`filtertag n/fruits`

1. Test case: `filtertag n/fruits`<br> Expected Output in Item List Box: Items with specified tags shown. <br> Expected Output in Command Output Box: Details of tag and number of items filtered.
Expected Output in the [[ item-list-box:Item List Box ]]:
Items with the `fruits` tag are shown.

Expected Output [[ command-output-box:Command Output Box ]]:
Details of the tag and number of items filtered.

### Statistics

#### Display statistics

1. Test case: `stats`<br> Expected Output in Item List Box: No change in displayed items <br> Expected Output in Command Output Box: Statistics which include total cost incurred due to food wastage, top 3 common tags and top 3 items with the highest value.
`stats`

Expected Output in the [[ item-list-box:Item List Box ]]:
No changes in the displayed items.

Expected Output [[ command-output-box:Command Output Box ]]:
Statistics which include total cost incurred due to food wastage, top 3 common tags and top 3 items with the highest value.

### Help

1. Test Case: `help`<br> Expected Output: A pop-up window, the [[ help-window:Help Window ]] shows up with the help information.
1. Test Case: `help new`<br> Expected Output: The [[ help-window:Help Window ]] shows up with the help information for `new` command.
`help`

Expected Output:
The [[ help-window:Help Window ]] pops up and shows a general help message.

`help new`

Expected Output:
The [[ help-window:Help Window ]] pops up and shows a general help message with the help information for the `new` command.

### Reset

1. Test Case: `reset`<br> Expected Output in Item List Box: All items in Item List Box are cleared <br> Expected Output in Command Output Box: FoodRem reset success message.
`reset`

Expected Output in the [[ item-list-box:Item List Box ]]:
All items in the [[ item-list-box:Item List Box ]] are cleared.

Expected Output in the [[ command-output-box:Command Output Box ]]:
FoodRem reset success message.

### Exit

1. Test Case: `exit`<br> Expected Output: FoodRem application closes.
`exit`

Expected Output:
FoodRem application closes.
1 change: 1 addition & 0 deletions docs/_ug/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The JAR file not launching even after double-clicking the file.
* Mac:
* Use <kbd>Cmd</kbd>+<kbd>Space</kbd> to open Spotlight Search
* Search for "terminal" and click it to launch.
1. Navigate to the location where "foodrem.jar" is stored within your terminal.
1. On your terminal, run `java -jar "foodrem.jar"`


Expand Down

0 comments on commit c1595af

Please sign in to comment.