EiSimp / Book-Archive

BookPals
https://book-archive-production.up.railway.app/homepage
0 stars 0 forks source link

Design search page #41

Closed chingyan0930 closed 3 months ago

elllaPark commented 3 months ago

User Stories for Search Functionality

Searching for Books

Actors: Regular User Iteration: 2

As a user, I want to search for books using a search keyword, So that I can find books related to my interests.

Triggers/Preconditions:

The user is logged in and on any page. The system allows users to search for books.

Actions/Postconditions:

The user enters a search query in the search bar. The user submits the search query. The system fetches books matching the search query. The search results are displayed in a paginated format,

Acceptance Tests:

Test 1: Input: Search Query: "Harry Potter" Assertion: Books related to "Harry Potter" are displayed on the search result page Test 2: Input: Search Query "flower" Assertion: Books related to "flower" are displayed on the search result page

Viewing Search Results

Actors: Regular User Iteration: 2

As a user, I want to view a list of books that match my search keyword, So that I can browse the results and find books I am interested in.

Triggers/Preconditions: The user has performed a search. The system has fetched matching books.

Actions/Postconditions: The system displays a list of books matching the search query. Each book entry shows the title, cover image, and rating.

Acceptance Tests: Test 1: Input: Search results for "Science Fiction" Assertion: Books matching the "Science Fiction" query are displayed with title, cover image, and rating. Test 2: Input: Search results for "Dr. Seuss" Assertion: Books matching the "Dr. Seuss" query are displayed with title, cover image, and rating.

Pagination of Search Results

Actors: Regular User Iteration: 2

As a user, I want to navigate through multiple pages of search results, So that I can see more books if my search keyword returns many results.

Triggers/Preconditions: The user has performed a search with multiple pages of results. The system supports pagination for search results. 10 pages in a group

Actions/Postconditions: The user clicks the ">" button to view the next page. The user clicks the ">>" button to view the next page group. The user clicks the "<" button to view the previous page. The user clicks the "<<" button to view the previous page group. The user clicks the number to view that specific page.

Acceptance Tests: Test 1: Action: The user clicks ">" to go to the next. Assertion: The next page of the search results is displayed. Test 2: Action: The user clicks "<" to go to the previous page. Assertion: The previous page of the search results is displayed. Test 3: Action: The user clicks ">>" to go to the next page group. Assertion: The next page group of the search results is displayed. Test 4: Action: The user clicks "<<" to go to the previous page group. Assertion: The previous page group of the search results is displayed.

Maintaining Search State Across Pages

Actors: Regular User Iteration: 2

As a user, I want the search keyword to persist as I navigate through different pages of results, So that I don't have to re-enter my search query each time I change the page.

Triggers/Preconditions: The user has performed a search and is navigating through pages of results. The system should retain the search query.

Actions/Postconditions: The search query remains in the URL as the user navigates through pages. The displayed results correspond to the current page and search query.

Acceptance Tests: Test 1: Action: User navigates from page 1 to page 2. Assertion: The search query remains in the URL, and page 2 results are displayed. Test 2: Action: User navigates from page 2 back to page 1. Assertion: The search query remains in the URL, and page 1 results are displayed.

Handling Empty Search Queries

Actors: Regular User Iteration: 2

As a user, I want to receive feedback if my search query returns no results, So that I know that no books match my search and I can modify my query.

Triggers/Preconditions: The user performs a search that returns no results. The system should provide feedback for empty queries.

Actions/Postconditions: If no results are found, an appropriate message is displayed. The search bar remains accessible for entering a new query.

Acceptance Tests: Test 1: Input: Search Query: " " Assertion: Message "Please enter a valid search keyword" is displayed. Test 2: Input: Search Query: ""(empty) Assertion: An alert message pops up