Client Tests from outside the browser #13014
Torgen
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently both unit and app tests on the client are run from inside the browser on the client side. This is a problem for certain features because of the browser's permission and security models. One, if you try to create an event without user interaction, you get an otherwise empty Event with
isTrusted: false
. For some event types you can fake them via jQuery, but since there are some fields jQuery doesn't copy from the original event, you normally have to useevent.originalEvent
to access them, and that doesn't work when you can't create events that have those properties. (Storage, non-click Mouse, and Touch events have this problem that I've seen.) Second, some features like Geolocation and Notifications require user permission, so without access to the headless browser, those can't be enabled. I think we need a third test mode where debugOnly packages still run on the client (so we can use coverage), but otherwise the app behaves normally, and I can use puppeteer or playwright or whatever to interact with the app via the headless browser. If I didn't already have app tests I could maybe do this with the existing app-test mode since I guess the app behaves normally once the tests are done, so if there were no test cases I could make my own browser connection in the server tests, but that doesn't work for existing apps that would want to migrate from or keep existing in-client tests and just add tests via the browser, since every connection would run the full test suite. Also, I would probably want the tests to be located with the client code, even though they would run on the server, which would require special handling in the meteor tool.Beta Was this translation helpful? Give feedback.
All reactions