Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
microbit-matt-hillsdon opened this issue Nov 2, 2022 · 0 comments
Open

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

microbit-matt-hillsdon opened this issue Nov 2, 2022 · 0 comments

Comments

@microbit-matt-hillsdon
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant