|
| 1 | +# WebUSB Tests |
| 2 | + |
| 3 | +## Test matrix |
| 4 | + |
| 5 | +WebUSB tests should be carried out with the following combination of |
| 6 | +micro:bit boards, DAPLink versions, and browsers/apps to ensure full coverage |
| 7 | +of the supported configurations. |
| 8 | + |
| 9 | +### Test boards and DAPLink versions |
| 10 | + |
| 11 | +Each WebUSB test should be carried out with these micro:bit boards and |
| 12 | +DAPLink versions. |
| 13 | +The goal is to test each DAPLink port with the first factory release, |
| 14 | +the latest official release, and the latest beta release. |
| 15 | + |
| 16 | +| Board | DAPLink | DAPLink MCU | Description | |
| 17 | +| ----- | --------- | ------------ | --------------------------------- | |
| 18 | +| V1.x | 0249 | KL26 | V1.5 factory release | |
| 19 | +| V1.x | 0253 | KL26 | Latest V1 official release | |
| 20 | +| V2.00 | 0255 | KL27 | Factory & latest official release | |
| 21 | +| V2.00 | 0258-beta | KL27 | Latest beta release | |
| 22 | +| V2.2x | 0257 | nRF52833/820 | Factory & latest official release | |
| 23 | +| V2.2x | 0258-beta | nRF52833/820 | Latest beta release | |
| 24 | + |
| 25 | +### Test browsers, apps & Operating Systems |
| 26 | + |
| 27 | +Each WebUSB test should be carried out with the latest version of these |
| 28 | +Chrome-based browsers and operating systems: |
| 29 | + |
| 30 | +- Chrome on Windows |
| 31 | +- Chrome on macOS |
| 32 | +- Chrome on ChromeOS |
| 33 | +- Chrome on Linux |
| 34 | +- Chrome on Android |
| 35 | +- Edge on Windows |
| 36 | +- Microsoft MakeCode for micro:bit Windows app |
| 37 | +- MakeCode Offline App for Windows |
| 38 | +- MakeCode Offline App for macOS |
| 39 | +- MakeCode Windows Store App |
| 40 | + |
| 41 | +## Tests to run on all matrix variations |
| 42 | + |
| 43 | +The following tests should be carried out with all combinations of the |
| 44 | +micro:bit boards, DAPLink versions, and browsers/apps listed in the |
| 45 | +"Test Matrix" section. |
| 46 | + |
| 47 | +### Test 1: WebUSB Download |
| 48 | + |
| 49 | +1. Connect the micro:bit to the computer via USB. |
| 50 | +2. Open the micro:bit MakeCode editor under test in a Chrome-based browser. |
| 51 | +3. Create a new project. |
| 52 | +4. Add a block to the project (e.g. something simple to display on the LED |
| 53 | + matrix). |
| 54 | +5. Click the "Download" button. |
| 55 | +6. Follow the connection instructions to connect the micro:bit via WebUSB and |
| 56 | + download the programme. |
| 57 | +7. Verify that the programme runs on the micro:bit. |
| 58 | + |
| 59 | +### Test 2: WebUSB Serial |
| 60 | + |
| 61 | +1. Connect the micro:bit to the computer via USB. |
| 62 | +2. Open the micro:bit MakeCode editor under test in a Chrome-based browser. |
| 63 | +3. Create a new project. |
| 64 | +4. Add this code |
| 65 | + ```javascript |
| 66 | + basic.forever(function () { |
| 67 | + serial.writeLine("hello") |
| 68 | + basic.pause(1000) |
| 69 | + }) |
| 70 | + ``` |
| 71 | +5. Click the "Download" button. |
| 72 | +6. Follow the connection instructions to connect the micro:bit via WebUSB and |
| 73 | + download the programme. |
| 74 | +7. Click on "Show Data Device" button to open the serial console. |
| 75 | +8. Verify that the serial console shows "hello" every second. |
| 76 | + |
| 77 | +## Tests on specific variations |
| 78 | + |
| 79 | +This test should only be carried out with the configuration listed at the |
| 80 | +beginning of each test. |
| 81 | + |
| 82 | +### Test 3: WebUSB with incompatible DAPLink |
| 83 | + |
| 84 | +The following DAPLink versions are not expected to work with WebUSB, and |
| 85 | +this test is to ensure an error message suggesting a firmware update is shown. |
| 86 | + |
| 87 | +This test should be carried out with the following DAPLink versions: |
| 88 | +- micro:bit V1.x with DAPLink 0234 |
| 89 | + - This is the V1.03 factory version from the original BBC school drop |
| 90 | +- micro:bit V1.x with DAPLink 0241 |
| 91 | + - This is the V1.3B factory version, from the first commercial release |
| 92 | + |
| 93 | +1. Connect the micro:bit to the computer via USB. |
| 94 | +2. Open the micro:bit MakeCode editor under test in a Chrome-based browser. |
| 95 | +3. Create a new project. |
| 96 | +4. Add a block to the project (e.g. something simple to display on the LED |
| 97 | + matrix). |
| 98 | +5. Click the "Download" button. |
| 99 | +6. Follow the connection instructions to connect the micro:bit via WebUSB. |
| 100 | +7. Verify that an error message is shown suggesting a firmware update is |
| 101 | + required. |
| 102 | + |
| 103 | +### Test 4: WebUSB within micro:bit classroom |
| 104 | + |
| 105 | +This test can be executed only once, using any micro:bit board with any |
| 106 | +DAPLink WebUSB compatible version, using Chrome on Windows. |
| 107 | +The goal of this test is to ensure that WebUSB feature is not broken due to |
| 108 | +the MakeCode editor being embedded in classroom. |
| 109 | + |
| 110 | +1. Connect the micro:bit to the computer via USB. |
| 111 | +2. Open the micro:bit Classroom with this URL: |
| 112 | + https://classroom.microbit.org/?editorVersion=beta |
| 113 | +3. Create and start a blank session. |
| 114 | +4. Click on "Edit Code", which should open the embedded MakeCode editor. |
| 115 | +5. Drag a block into the workspace (e.g. something simple to display on the LED |
| 116 | + matrix). |
| 117 | +6. Click the "Download" button. |
| 118 | +7. Follow the connection instructions to connect the micro:bit via WebUSB and |
| 119 | + download the programme. |
| 120 | +8. Verify that the programme runs on the micro:bit. |
| 121 | + |
| 122 | +### Test 5: WebUSB within micro:bit CreateAI |
| 123 | + |
| 124 | +This test can be executed only once, using any micro:bit board with any |
| 125 | +DAPLink WebUSB compatible version, using Chrome on Windows. |
| 126 | +The goal of this test is to ensure that WebUSB feature is not broken due to |
| 127 | +the MakeCode editor being embedded in CreateAI. |
| 128 | + |
| 129 | +1. Connect the micro:bit to the computer via USB. |
| 130 | +2. Open the micro:bit CreateAI with this URL, which includes a project: |
| 131 | + https://review-createai.microbit.org/makecode-lang-picker/import?id=simple-ai-exercise-timer&project=Project%3A%20Simple%20AI%20exercise%20timer&name=Simple%20AI%20exercise%20timer&editors=makecode&editorVersion=beta |
| 132 | +3. A "New session setup" screen should appear, click on "Start session". |
| 133 | +4. On the next screen, click on "Train Model". |
| 134 | +5. Wait for the model to be trained, which should take a few seconds. |
| 135 | +6. On the next screen, click on "Edit in MakeCode". |
| 136 | +7. The MakeCode editor should open with the project loaded. Click on the |
| 137 | + "Download" button. |
| 138 | +8. Follow the connection instructions to connect the micro:bit via WebUSB and |
| 139 | + download the programme. |
| 140 | +9. Verify that the programme runs on the micro:bit. |
0 commit comments