Skip to content

Add end-to-end tests covering postMessage API #92

Open
@microbit-matt-hillsdon

Description

@microbit-matt-hillsdon

We should add some form of e2e with real browser automation that covers the postMessage API.

I think we should try to load just simulator.html (not demo.html) and run JavaScript in the page to interact with it directly. Or perhaps a very simple page that uses an iframe if that's more practical. That way we can read serial output which might be the most practical way to make assertions. We could also write code that can read the LED grid from the DOM but I think that's only worth it for a few display specific tests.

The aim isn't to really test MicroPython itself but it would be great to:

  1. Cover the postMessage API, catching issues like New program runs over the last one after reset #90
  2. Lower priority, cover the wiring of each sensor and similar

I'm mostly familiar with Puppeteer in this space but it might be worth looking at Playwright as it holds out the possibility of cross-browser tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions