Open Utopiah opened 1 year ago
Clicking on button is nice but for testing not ideal. As mentioned in https://github.com/MozillaReality/WebXR-emulator-extension/issues/296 being able to make calls directly from the browser console allows for testing programmatically, that means tests could be provided with the WebXR page itself and make the development cycle more efficient.
Happy to expose these if people will find them useful, and it should be easy to do. Can you suggest a list of APIs and their signatures?
Hello @felixtrz ! +1 to this feature. I've been modifying the immersive-web emulator polyfill so it can be added to a page without extension, just like a library. It is useful when dealing with running tests in headless mode in CI. For now, I'm using the api that immersive-web polyfill is providing - just sending some CustomEvents, like "webxr-input-pose" or "webxr-pose" for example. But it would be more convenient, if I could just do something like this:
const polyfill = new WebXRPolyfill();
polyfill.setPose({position: new Vector3(), quaternion: new Quaternion()});
polyfill.controllers.right.setPose({position: new Vector3(), quaternion: new Quaternion()});
poyfill.controllers.right.click();
Please note it's just a pseudocode. Also I think this library should be usable without threejs in client app, just used threejs primitives for an example.
@felixtrz if it is ok for you, we can make a draft PR in like a week or two with our proposal. But we are glad to hear everybody's opinion!
I really really want to be able to do this for a) automated testing b) using ps5 controller to use joysticks/buttons/pose. Still looking at other workarounds with exisitng codebase.
+1 on being vital for automated testing
Clicking on button is nice but for testing not ideal. As mentioned in https://github.com/MozillaReality/WebXR-emulator-extension/issues/296 being able to make calls directly from the browser console allows for testing programmatically, that means tests could be provided with the WebXR page itself and make the development cycle more efficient.