Skip to content

Commit 8c35152

Browse files
Add initial test procedures for WebUSB & BLE flashing.
1 parent 326a6cc commit 8c35152

File tree

2 files changed

+230
-0
lines changed

2 files changed

+230
-0
lines changed

docs/release-tests/ble-flashing.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Bluetooth Tests
2+
3+
## Test preparations
4+
5+
Three hex files needed:
6+
- "Meet the micro:bit": This is the program that runs on the micro:bit when
7+
it is first powered on from factory.
8+
- Downloadable from the micro:bit website:
9+
https://microbit.org/get-started/user-guide/meet-the-microbit-program/
10+
- "Out of Box": The previous factory program before the
11+
"Meet the micro:bit" was released.
12+
- Downloadable from the micro:bit website:
13+
https://microbit.org/get-started/user-guide/meet-the-microbit-program/
14+
- MakeCode Live Editor hex file: To ensure micro:bits with a recent MakeCode
15+
project can be flashed via Bluetooth with the MakeCode editor under test.
16+
- Create a hex file from the latest MakeCode live editor:
17+
https://makecode.microbit.org/
18+
- Python Editor hex file: To ensure MakeCode editor under test can BLE flash
19+
micro:bits after using the Python Editor.
20+
- Go to https://python.microbit.org and download the hex file
21+
from the default project.
22+
23+
Two mobile/tablet devices needed:
24+
- Android device with the micro:bit app installed.
25+
- iOS device with the micro:bit app installed.
26+
27+
## Test 1: Full flashing with Bluetooth from "Out of Box" and "Meet the micro:bit"
28+
29+
This test should be carried out with:
30+
- Android app
31+
- iOS app
32+
33+
A test run for each of these hex files is required:
34+
- "Out of Box" hex file
35+
- "Meet the micro:bit" hex file
36+
- MakeCode Live Editor hex file
37+
- Python Editor hex file
38+
39+
Steps:
40+
1. Connect the micro:bit to the computer via USB.
41+
2. Copy the hex file under test to the `MICROBIT` USB drive.
42+
3. Disconnect the micro:bit from the computer and connect a battery pack.
43+
4. Open the app and load the MakeCode editor under tests.
44+
- Instructions will be added soon.
45+
5. Create a new MakeCode project with a simple program (e.g. display
46+
something on the LED matrix).
47+
6. Click the "Download" button.
48+
7. Follow the connection instructions to connect the micro:bit via Bluetooth
49+
and download the program.
50+
8. Verify that the program runs on the micro:bit.
51+
52+
## Test 2: Partial flashing
53+
54+
Test 1 has to be performed inmediately before this test to ensure the micro:bit
55+
is in a known state.
56+
57+
This test should be carried out with:
58+
- Android app
59+
- iOS app
60+
61+
Steps:
62+
1. Follow steps from Test 1.
63+
2. Change the blocks in the MakeCode editor to something different
64+
(e.g. display a different icon/message on the LED matrix).
65+
3. Click the "Download" button.
66+
4. Follow the connection instructions to connect the micro:bit via Bluetooth
67+
and download the program.
68+
5. Verify the BLE flashing process was shorter than on Test 1.
69+
6. Verify that the program runs on the micro:bit.
70+
71+
## Test 3: Utility Service
72+
73+
This test checks that the Utility Service is available and working on
74+
the builds of the MakeCode editor under test.
75+
76+
This test should be carried out in the iOS app only,
77+
as this feature is not available on the Android app.
78+
79+
Steps:
80+
1. Flash the micro:bit with this MakeCode programme, using any method:
81+
```javascript
82+
basic.forever(function () {
83+
datalogger.log(
84+
datalogger.createCV("y", input.acceleration(Dimension.Y)),
85+
datalogger.createCV("x", input.acceleration(Dimension.X))
86+
)
87+
})
88+
```
89+
2. Open the micro:bit app and connect to the micro:bit.
90+
3. TODO: Rest of the instructions will be added soon.

docs/release-tests/webusb.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
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

Comments
 (0)