Test specification - filiplonnqvist/ToneTeam GitHub Wiki

Test Specification

Test Specification for ToneTeam

Objective

This document compiles all test specifications for the ToneTeam application. The tests ensure that the application's functionality meets the requirements from the product backlog.

Standard Prerequisites

  • Production Environment: All tests are performed against your deployed application instance
  • Web Browser: Firefox is recommended for testing
  • User Status: Specified per test (logged in/logged out)

Overall Test Matrix

Manual Tests

Test ID Functional Area Backlog Status
TC1.1 Piano - Display keys #1 ✅ Active
TC1.2 Piano - Play tones #1 ✅ Active
TC1.3 Piano - Real-time communication #1 ❌ Abandoned
TC1.4 Piano - Sound control #1 ✅ Active
TC1.5 Piano - Sound switch #1 ✅ Active
TC2.1 Auth - Form display #2 ✅ Active
TC2.2 Auth - Registration error messages #2 ✅ Active
TC2.3 Auth - Login after registration #2 ✅ Active
TC2.4 Auth - Login error messages #2 ✅ Active
TC.2.5 Auth - Session management (functional) #2 ❌ Abandoned
TC2.6 Auth - Logout #2 ✅ Active
TC5.1 Lyrics - Create #5 ✅ Active
TC5.2 Lyrics - Read #5 ✅ Active
TC5.3 Lyrics - Edit #5 ✅ Active
TC5.4 Lyrics - Delete #5 ✅ Active
TC5.5 Lyrics - Download #5 ✅ Active
TC6.1 UI - Visual feedback #6 ✅ Active
TC6.2 UI - Response time #6 ✅ Active
TC7.1 Security - Password info #7 ✅ Active
TC7.2 Security - Confirmations #7 ✅ Active
TC7.3 Security - Firebase Auth #7 ✅ Active
TC7.4 Security - Session handling (non-functional) #7 ❌ Abandoned
TC10.1 Database - Text storage #10 ✅ Active

Automated Tests

Test ID Function Framework
AT1.1-AT1.2 Email validation Jest
AT2.1-AT2.3 Login validation Jest

Manual Test Cases

Piano Functionality

TC1.1 - Piano displays correct number of keys

Scenario: User can see the piano keys
Precondition: User is logged in

Test steps:

  1. Navigate to your application and log in
  2. Observe the piano displayed on screen

Expected:

  • 10 white keys are displayed (C4-E5)
  • 7 black keys are displayed in correct positions
  • Keys have visible keyboard markings (Q, W, E... for white, 2, 3, 5... for black)

TC1.2 - Keys play correct tone when clicked

Scenario: User clicks piano keys
Precondition: User is logged in

Test steps:

  1. Click on different keys with mouse
  2. Test keyboard shortcuts (Q for C4, 2 for C#4, etc.)

Expected:

  • Each key produces correct tone
  • Both mouse and keyboard work

TC1.4 - Turn sound on and off

Scenario: User controls piano sound
Precondition: User is logged in

Test steps:

  1. Play the piano and verify sound is audible
  2. Click the speaker icon to the left of the piano
  3. Play the piano again

Expected:

  • Sound turns on/off when icon is clicked
  • Visual indication of sound status

TC1.5 - Switch between piano and synth sound

Scenario: User controls piano sound
Precondition: User is logged in

Test steps:

  1. Play the piano and verify sound is audible
  2. Click the piano icon to the left of the piano
  3. Play the piano again

Expected:

  • Sound switches from piano to synth when clicking the icon
  • Visual indication of sound status

Authentication & Sessions

TC2.1 - Login/registration form displays on visit

Scenario: User visits the website
Precondition: User is logged out

Test steps:

  1. Navigate to your application
  2. Observe the landing page

Expected:

  • Login form displays automatically
  • Tabs to switch between login/registration exist
  • All necessary fields are visible

TC2.2 - Error messages during registration

Scenario: User attempts to register with invalid data
Precondition: Registration form is open

Test table:

Input Expected error message
Email without @ "Invalid email format"
Password < 6 characters "Password must be at least 6 characters"
Passwords don't match "Passwords do not match"

TC2.3 - Login after registration

Scenario: User registers and logs in
Precondition: Registration form is open

Test steps:

  1. Register with valid email and password (minimum 6 characters)
  2. Log in with same credentials

Expected:

  • Registration succeeds with confirmation
  • Login redirects to piano page

TC2.4 - Error messages during login

Scenario: User attempts to log in with incorrect credentials
Precondition: Login form is open

Test steps:

  1. Attempt login with unregistered email
  2. Attempt login with wrong password

Expected:

  • Clear error message displays
  • No login occurs

TC2.6 - Logout from page

Scenario: User logs out
Precondition: User is logged in

Test steps:

  1. Click the "Sign Out" button (bottom left)

Expected:

  • Redirect to landing page
  • User is logged out

TC7.1 - Password management information

Scenario: Firebase validation during registration
Precondition: Registration form is open

Test steps:

  1. Attempt registration with password < 6 characters

Expected:

  • Clear error message about minimum length
  • Firebase validation works

TC7.2 - Confirmation on registration

Scenario: User feedback during authentication
Precondition: Use registration form

Test steps:

  1. Complete successful registration

Expected:

  • Visual confirmation on successful action
  • Clear feedback to user

TC7.3 - Secure authentication via Firebase

Scenario: Verify secure implementation
Precondition: Developer tools open

Test steps:

  1. Open Network tab in developer tools
  2. Perform login
  3. Analyze network traffic

Expected:

  • Firebase Authentication is used
  • No passwords sent in plain text

Lyrics Management

TC5.1 - Create text

Scenario: User creates new lyrics
Precondition: User is logged in

Test steps:

  1. Click "NEW LYRICS" button
  2. Enter title and content
  3. Click "CREATE"

Expected:

  • Editor opens automatically
  • Text saves and appears in list

TC5.2 - Read text

Scenario: User opens saved text
Precondition: At least one text exists

Test steps:

  1. Click on a text in the list on the left

Expected:

  • Text opens in editor
  • Title and content display correctly

TC5.3 - Edit text

Scenario: User modifies existing text
Precondition: A text is open in editor

Test steps:

  1. Change title or content
  2. Click "SAVE"
  3. Switch to another text and back

Expected:

  • Changes are saved
  • Updated title appears in list

TC5.4 - Delete text

Scenario: User removes text
Precondition: At least one text exists

Test steps:

  1. Hover over text in list
  2. Click trash can icon
  3. Confirm deletion

Expected:

  • Confirmation dialog: "Are you sure you want to delete this lyrics?"
  • Text disappears from list

TC5.5 - Download text

Scenario: User exports text
Precondition: A text is open in editor

Test steps:

  1. Click "DOWNLOAD" button

Expected:

  • Text downloads as .txt file
  • Filename based on text title

TC10.1 - Save texts between sessions

Scenario: Check database storage
Precondition: User has created texts

Test steps:

  1. Create new text
  2. Log out and in again

Expected:

  • All texts remain after logout

Visual Feedback & Performance

TC6.1 - Visual feedback on key press

Scenario: Piano keys provide visual response
Precondition: User is logged in

Test steps:

  1. Press piano keys (mouse or keyboard)

Expected:

  • Keys change color/shadow when pressed
  • Consistent feedback for all keys

TC6.2 - Piano response time

Scenario: Check performance
Precondition: User is logged in

Test steps:

  1. Play rapidly on multiple keys
  2. Note any delay

Expected:

  • No noticeable delay
  • Consistent performance over time

Automated Test Cases

Unit Tests (Jest)

AT1.1-AT1.2 - Email validation

Tests: isValidEmail function

npm run test

Test cases:

AT2.1-AT2.3 - Login validation

Tests: validateLogin function

Test cases:

  • Accepts valid email + password
  • Rejects invalid email with correct error message
  • Rejects empty password with correct error message

Appendix

❌ Abandoned Tests

TC1.3 - Real-time communication for piano

Status: Abandoned - feature not implemented
Original purpose: Test that multiple users can play piano together in real-time

TC2.5 - Session management

Status: Abandoned - feature now listed as non-functional
Original purpose: Test that user remains logged in

TC7.4 - Session management between sessions

Status: Abandoned - feature no longer relevant in production
Original purpose: Test that the user's username and UID are displayed in the console