Skip to content

Test Case List

Manuel edited this page Mar 7, 2024 · 142 revisions

Test Case List

✅ = Automated Test Case implemented

Functional Testing:

Authentication Section:

Login User:

Component tests

LoginPage

  • ✅ should display the login form.

(See test code)

LoginForm

  • ✅ should display a "You need to login to continue." text.
  • ✅ should display an email input.
  • ✅ should display an password input.
  • ✅ should display a "Remember Me" button.
  • ✅ should display a "LOGIN" button.
  • ✅ should display a "CREATE ACCOUNT" button.
  • ✅ should have focus set on then email field.
  • ✅ should display a password input field of type password.

(See test code)

Functional tests

Positive tests

  • ✅ should redirect to login page when user is not logged in.
  • ✅ should allow the user to login with valid credentials.
  • ✅ should display a success message on login success.
  • ✅ should allow the user to check a 'Remember Me' button and have his email pre-written on the email input on next visit.
  • ✅ should not display the user's email on the email field when "Remember Me" checkbox isn not checked.
  • ✅ should redirect to the 'Register User' form when CREATE ACCOUNT button is clicked.

Negative tests

  • ✅ should not allow the user to login with invalid credentials.
  • ✅ should display an alert message when either email or password are invalid.
  • should display error label 'Email address not registered.' when submitting an unregistered email.
  • should display error label 'An email address is required.' when submitting an empty email address.
  • should display error label 'A password is required.' when submitting an empty password.

(See test code)

Register User:

Component tests

RegisterPage

  • ✅ should display the register form.

(See test code)

RegisterForm

  • ✅ should display an username input.
  • ✅ should display an email input.
  • ✅ should display an password input.
  • ✅ should display an password confirmation input.
  • ✅ should display a 'REGISTER' button.
  • ✅ should have focus set on then username field.
  • ✅ should display a password input field of type password.
  • ✅ should display a password confirmation input field of type password.
  • ✅ should display a 'Already have an account? Login here!' link that redirects to login page.

(See test code)

Functional tests

Positive tests

  • ✅ should allow the user to register with valid credentials.
  • ✅ should display a success message on register success.

Negative tests

  • ✅ should not allow user to register with existing credentials.
  • should display an alert message when username, email, password or password confirmation are invalid.
  • should display error label 'A username is required.' when submitting empty username.
  • should display error label 'username must be at least 6 characters' when submitting an invalid username.
  • should display error label 'A email address is required.' when submitting empty email address.
  • should display error label 'Email address is invalid.' when submitting an invalid email address.
  • should display error label 'A password is required.' appears submitting empty password.
  • should display error label 'A password confirmation is required.' when submitting empty password confirmation.
  • should display error label 'Passwords do not match.' when submitting incorrect password confirmation.
  • should display error label 'password must be at least 8 characters' when submitting a password without at least 8 characters.
  • should display error label 'password must contain at least 1 uppercase character' when submitting a password without at least 1 uppercase character.
  • should display error label 'password must contain at least 1 lowercase character' when submitting a password without at least 1 lowercase character.
  • should display error label 'password must contain at least 1 number character' when submitting a password without at least 1 number character.
  • should display error label 'password must contain at least 1 special character' when submitting a password without at least 1 special character.

(See test code)

Todo Section:

Component tests

TodoPage

  • ✅ should display h1 heading with the text "To Dos".

(See test code)

TodoStatistics

  • ✅ should display first statistics block with the text "Completed today:".
  • ✅ should display second statistics block with the text "Avg daily completed:".
  • ✅ should display third statistics block with the text "Percentage difference:".

(See test code)

TodoList

  • ✅ should display input with placeholder text "Add new todos...".
  • ✅ should display button with the text "Add Todo".

(See test code)

Add Todo:

Positive tests

  • ✅ should add a todo by writing on input and clicking on a "Add todo" button.
  • ✅ should add a todo by writing on input and pressing enter key.
  • ✅ should display added todos correctly on the list.
  • ✅ should persist todos after page reload.

Negative tests

  • ✅ should not allow to add a todo with more than 40 characters.
  • ✅ should display an error label "Todos cannot be more than 40 characters" when exceeding that amount.
  • ✅ should not allow to add a todo when leaving input field empty.
  • ✅ should display an error label indicating "Todos cannot be less than 3 characters" when falling below that amount.

(See test code)

Edit Todo:

Positive tests

  • ✅ should edit a todo.
  • ✅ should persist edited todos after page reload.

Negative tests

  • ✅ should not allow to edit a todo so it has more than 40 characters.
  • ✅ should display an error label "Todo cannot contain more than 40 characters" when edited todo exceeds that amount.
  • ✅ should not allow to edit a todo so it has less than 3 characters.
  • ✅ should display an error label "Todo cannot contain less than 3 characters" when edited todo falls below that amount.

(See test code)

Delete Todo:

Positive tests

  • ✅ should delete a todo and remove it from the list.
  • ✅ should not show deleted todos after page reload.

(See test code)

Mark Todo as Complete:

Positive tests

  • ✅ should mark a todo as complete.
  • ✅ should move the completed todo to the completed todos list.

(See test code)

Reorder Todos:

Positive tests

  • ✅ should reorder todos by dragging them up and down.
  • ✅ should persist reordered todos order after page reload.
  • ✅ should edit reordered todos.

(See test code)

Todo Statistics Display:

Positive tests

  • ✅ should display the number of completed todos for the day.
  • ✅ should display the average number of completed todos per day.
  • ✅ should display the percentage increase/decrease indicator for completed todos.

Negative tests

  • ✅ should display 0 as the number of completed todos today when user sets todos as complete and then sets them as uncomplete.
  • ✅ should display 0 as the number of average daily completed todos today when user sets todos as complete and then sets them as uncomplete.
  • ✅ should display 0% as the number of percentage difference when user sets todos as complete and then sets them as uncomplete.

(See test code)

Tabs:

Positive tests

  • ✅ should display 3 tabs above the todos list: "All", "Completed", "Uncompleted".
  • ✅ should by default have All tab active.
  • ✅ should by default display all existing todos.
  • ✅ should display all todos when user clicks on the "All" tab.
  • ✅ should display only completed todos when user clicks on the "Completed" tab.
  • ✅ should display only uncomplete todos when user clicks on the "Uncompleted" tab.
  • ✅ should only have 1 active tab at any moment.
  • ✅ should have as active tab the last tab clicked.

(See test code)

Dailies Section:

Add Daily Todo:

Positive tests

  • ✅ should add a daily by writing on input and clicking the "Add daily" button.
  • ✅ should add a daily by writing on input and pressing enter key.
  • ✅ should display the daily correctly on the list.
  • should persist added dailies after page reload.

Negative tests

  • ✅ should not add dailies with more than 40 characters.
  • ✅ should not add dailies when leaving the input empty.

(See test code)

Edit Daily Todo:

Positive tests

  • ✅ should edit an existing daily.
  • should persist edited dailies after page reload.

(See test code)

Delete Daily Todo:

Positive tests

  • ✅ should delete a daily and remove it from the daily list.
  • should persist deleted dailies after page reload.

(See test code)

Complete Daily Todo:

Positive tests

  • ✅ should mark a daily as complete.
  • ✅ should add a line-through to daily text when marked as completed.

(See test code)

Reorder Daily Todos:

Positive tests

  • should reorder dailies by dragging them up and down.
  • should persist reordered dailies after a page reload.
  • should edit reordered dailies.

(See test code)

Next Day Activation:

Positive tests

  • ✅ should reactivate completed dailies at the start of the next day.

(See test code)

Streak Counter:

Positive tests

  • ✅ should update streak counter correctly when a daily is completed consecutively.
  • ✅ should reset the streak counter to 0 when a daily is not completed for more than 1 day.

(See test code)

Learnings Section:

Add Learning:

  • Verify a new learning can be added.
  • Verify the learning appears in the learnings table.

Ordering of Learnings:

  • Verify learnings are ordered based on the number of occurrences.
  • Verify most repeated learnings appear first.

Blog Section:

Write a Blog Post:

  • Verify a user can create and save a new blog post.
  • Verify the post appears in the drafts section.

Publish a Blog Post:

  • Verify a draft blog post can be published.
  • Verify the post is visible publicly.

API Testing:

Authentication Section:

Login User API:

Positive tests

  • ✅ should allow a user to log in with valid (existing) data.
  • ✅ should include a success message in its response.
  • ✅ should include the correct user properties in its response.

Negative tests

  • ✅ should not allow a user to log in with invalid (unexisting) data.
  • ✅ should not allow a user to log in with empty data.
  • ✅ should respond with a message indicating any missing credentials.

(See test code)

Register User API:

Positive tests

  • ✅ should allow a user to register with valid data.
  • ✅ should respond with a success message when registering user.
  • ✅ should respond with the correct properties for the registered user.

Negative tests

  • ✅ should not allow a user to register with invalid (existing) data.
  • ✅ should not allow a user to register with empty data.
  • ✅ should respond with a message indicating any missing credentials.

(See test code)

Todo Section:

Create Todo:

Positive tests

  • ✅ should create a todo with valid data.
  • ✅ should have correct success message on response.
  • ✅ should have properties of correct type.
  • ✅ should have last id on response.
  • ✅ should add +1 to the current number of todos.

Negative tests

  • ✅ should not create a todo with invalid data.
  • ✅ should not allow a user to create todo with empty data.
  • ✅ should respond with a message indicating any missing data.
  • ✅ should not create a todo with invalid token.

(See test code)

Read Todo:

Positive tests

  • ✅ should retrieve all existing todos.
  • ✅ should retrieve a specific todo.
  • ✅ should have completed and description properties on returned todos.
  • ✅ should have the correct type on returned todos.

Negative tests

  • ✅ should not retrieve a todo with invalid token.

(See test code)

Update Todo:

Positive tests

  • ✅ should update a specific todo with valid data.

Negative tests

  • ✅ should not update a todo with invalid data.
  • ✅ should not update a todo with invalid id.
  • ✅ should not update todo with empty data.
  • ✅ should respond with a message indicating any missing data.
  • ✅ should not update a todo with invalid token.

(See test code)

Delete Todo:

Positive tests

  • ✅ should delete a specific todo with valid id.
  • ✅ should subtract -1 to the current number of todos when deleting one.

Negative tests

  • ✅ should not delete a todo with invalid id.
  • ✅ should not delete a todo with invalid token.

(See test code)

Component Testing:

Todo Section:

  • ✅ should display h1 heading with the text "To Dos".
  • ✅ should display first statistics block with the text "Completed todos:".
  • ✅ should display second statistics block with the text "Avg daily completed todos:".
  • ✅ should display third statistics block with the text "Percentage difference:".
  • ✅ should display input with placeholder text "Add new todos...".
  • ✅ should display button with the text "Add Todo".

(See test code)

Clone this wiki locally