Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UI Tests for Advisor View #15

Open
xavjones8 opened this issue Sep 24, 2024 · 0 comments
Open

Add UI Tests for Advisor View #15

xavjones8 opened this issue Sep 24, 2024 · 0 comments
Assignees

Comments

@xavjones8
Copy link
Member

Acceptance Criteria: Add UI Tests for Advisor View

1. Test Setup

  • Set up UI tests using Jetpack Compose Testing framework for the Advisor View.
  • Ensure all key functionalities (sending messages, loading state, error handling, etc.) are covered.

Technologies:

2. Verify Initial UI Elements

  • Verify that the text input field, send button, and chat area are visible when the Advisor View is first opened.
  • Ensure the send button is disabled when the input field is empty.

3. Test Sending a Message

  • Simulate entering text in the input field and verify that the send button is enabled.
  • Simulate clicking the send button and ensure:
    • The user message is displayed in the chat area.
    • The loading indicator is shown while waiting for the ChatGPT response.

4. Test Displaying ChatGPT Response

  • Mock a successful ChatGPT API response and verify:
    • The loading indicator disappears.
    • The ChatGPT response is displayed in the chat area below the user’s message.
    • The chat area automatically scrolls to the most recent message.

5. Test Error Handling

  • Mock a failed ChatGPT API call and verify:
    • An error message (e.g., "Unable to get a response. Please try again.") is displayed in the chat area.
    • The loading indicator disappears after the error occurs.

6. Test Conversation History Persistence

  • Simulate sending multiple messages and responses.
  • Navigate away from the Advisor View and return to it, verifying that the conversation history is still displayed correctly.

7. Test Input Field Behavior

  • Ensure that after sending a message, the input field is cleared.
  • Test that the keyboard appears when the input field is focused and dismisses after sending a message.

8. Scroll Behavior Test

  • Verify that the chat area scrolls automatically to the latest message when a new message is added, either by the user or ChatGPT.

9. Edge Case: Empty Input

  • Simulate attempting to send an empty message and verify that the send button remains disabled.

10. Performance Test

  • Test the view with a large number of messages in the chat history to ensure smooth scrolling and UI performance.

Technologies:

@xavjones8 xavjones8 self-assigned this Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant