kantord/LibreLingo

Cypress: disable sounds effects

オープン

#753 opened on 2020/10/04

 (10 件のコメント) (2 件のリアクション) (1 人の担当者)Python (258 件のフォーク)github user discovery
feature_requestgood first issuewontfix

Repository metrics

Stars
 (2,630 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Cypress tests interact with parts of the application where sounds effects are made. This is distracting when working with the tests locally. (i. e. yarn web cy:open or yarn web cy:run)

howler is used project-wide to implement sound effects, here's one example:

https://github.com/kantord/LibreLingo/blob/c89466d7560eb3338b95d4c2cdb7fe02d1b51af4/workspaces/web/src/media/voice.js#L1-L9

The task is to make sure that the sound effects are not played when running from Cypress. The easiest way to detect that a code is running from Cypress is using window.isCypress.

Ideally, this solution would not involve having to check in each place where sound is played. Instead, this logic should be implemented in one place, and simply re-used in all the other places. This can be done, for example, by subclassing howler, or whatever solution that seems fit!

コントリビューターガイド