Test Case 1 : Login test
The test case verifies the login functionality of a locally hosted website (http://localhost:3000). It inputs valid credentials (ss@e.com and 1234), submits the login form, and checks if the user is redirected to the home page (/home).
The user should be redirected to http://localhost:3000/home upon successful login with valid credentials. No error messages should appear.
The test passed as expected; the user was successfully redirected to /home. No error messages were encountered during the test.
This test ensures that the login functionality works correctly with valid credentials. It confirms that the authentication process and redirection mechanisms are implemented correctly, improving the reliability of the website.
Description:
This test case checks the signup functionality by entering a username, email, password, and confirming the password. After clicking the submit button, it verifies if the signup process is successful or if there are any error messages displayed.
Expected Output:
The expected output is either a "Signup successful!" message or an error message if the signup fails. If the signup is successful, the test passes.
Actual Output:
The actual output will either be a "Signup successful!" message or an error message, as seen in the test result. If the success message is found, the test prints "Test Passed," and if the error message is displayed, the test prints "Test Failed."
Importance:
This test case is crucial for validating that users can successfully register by providing valid input. It ensures that the signup page properly handles both successful and failed signup attempts, providing feedback to users.
Description:
This test case verifies the functionality of adding an expense to the expense tracker. It simulates logging in with valid credentials, entering expense details such as name, amount, category, and date, and then clicking the "Add Expense" button. It also checks if the expense has been successfully added to the table.
Expected Output:
The expected output is the successful addition of the expense, with the entry displayed in the expense tracker table. If the test passes, a "Test passed: expense added!" message is displayed. If the expense is not added, an assertion failure or an error message will indicate the failure.
Actual Output:
The actual output is "Test passed: expense added!" as displayed in the console. This confirms that the expense was successfully added and that the test passed.
Importance:
This test case is critical for ensuring the core functionality of the expense tracker works as expected. It validates the ability to add and display new expenses, a primary feature of the application, and ensures user inputs are handled correctly.
Description:
This test case verifies the functionality of fetching and displaying expenses in the expense tracker. It simulates logging in with valid credentials, clicking the "Get Expenses" button, and checking if the expenses are successfully fetched and displayed in the table.
Expected Output:
The expected output is the successful retrieval and display of expenses in the expense list table. If the test passes, a "Test passed: expense fetched" message is displayed. If the expenses are not fetched or displayed, an assertion failure or an error message will indicate the failure.
Actual Output:
The actual output is "Test passed: expense fetched!" as displayed in the console. This confirms that the expenses were successfully fetched and displayed, and the test passed.
Importance:
This test case is essential for verifying that users can view their recorded expenses. It ensures the backend fetch operation and frontend rendering work seamlessly, providing a functional and reliable user experience.