djipco / webmidi

Tame the Web MIDI API. Send and receive MIDI messages with ease. Control instruments with user-friendly functions (playNote, sendPitchBend, etc.). React to MIDI input with simple event listeners (noteon, pitchbend, controlchange, etc.).
Apache License 2.0
1.54k stars 116 forks source link

[TEST] Establish E2E Test #66

Closed TimSusa closed 5 years ago

TimSusa commented 5 years ago

In order to fulfil the test-pyramid, an e2e test could be established via cypress or puppeteer that simply runs existing index.html from test folder. Furthermore, all the selectors (testing midi stuff) could be checked for being ok and console output could be tracked. Circle CI could be used for free for test-automation and connecting the results to all github pull-requests.

This issue is connected to https://github.com/djipco/webmidi/issues/63

djipco commented 5 years ago

The problem with testing this lib is that we need to have MIDI devices plugged in to get relevant results. Without a device plugged in, there's only so much we can test.

Having said that, what you suggest is still valid.

jazz-soft commented 5 years ago

FYI, you can emulate MIDI devices using https://github.com/jazz-soft/midi-test

djipco commented 5 years ago

Yeah, that's a good tip. Maybe it could be used during testing.

TimSusa commented 5 years ago

Sounds and looks quite good. @jazz-soft: Thanks for that input. I will give it a shot

djipco commented 5 years ago

If we could use that to conduct tests with virtual MIDI devices (I/O), that would be a real step forward.

TimSusa commented 5 years ago

Hey, I have succeeded to convert all your tests. Furthermore a virtual midi driver test was created. Stuff runs on my mac without the need of a browser. All 94 Tests are passing. I would appreciate your feedback.

https://github.com/djipco/webmidi/pull/74/commits

djipco commented 5 years ago

Tests are passing on my side too (macOS also). I think that's a good base to start with. Thanks a lot!

TimSusa commented 5 years ago

@jazz-soft big big thanks for your input. I wonder, if you would pose this library for production purposes. I mean I would have the need to create virtual midi ports out of my private application