amosproj/amos2022ws03-software-oscilloscope

Front end tests

dev3225 opened this issue · 1 comments

User story

  1. As a team member
  2. I need the front end to be tested under various test cases
  3. So that UI acts as desired

Acceptance criteria

  • All UI elements are working as desired.
  • Code coverage of 70+%

Definition of done (DoD)

  • Feature/Bug/Change has been implemented

  • Application compiles successfully

  • Code is documented

  • Feature/Bug/Change is tested by at least one unit or e2e test

  • Tests have been passed without warnings (except "deprecated" warnings)

  • Changes have been reviewed

  • PR has been merged to dev branch

  • New dependencies have been added to bill of materials

  • Software architecture diagram has been updated

  • All acceptance criteria are fulfilled

  • Screenshot is attached to issue

DoD general criteria

  • Feature has been fully implemented
  • Feature has been merged into the mainline
  • All acceptance criteria were met
  • Product owner approved features
  • All tests are passing
  • Developers agreed to release

Current test coverage:

Bildschirm­foto 2023-01-30 um 16 25 59

When running cypress tests, the coverage report gets saved into coveragefolder, we could include this in the CI output.

I added more tests for frontend-only stuff like tooltips, but I'm really struggling with tests that involve signals from the backend. See file cypress/e2e/2-indicators/line-indicators.cy.js: I tried mocking the websocket connection to send a test sample array. And the message is received at the frontend. Problems are:

  • The message data is received as a string like 1, 0, 0, ... instead of an array buffer.
  • Despite turning on the oscillator by clicking the start button, $osciEnabled is still false and the onmessage handler doesn't get to updating the other components.