Pytorch-NLU
Pytorch-NLU copied to clipboard
Multiple browsers and viewports
Hey,
In a call with @auchenberg (thanks again by the way 🙇♂️ hopefully we meet in a conference when it's possible) he raised several interesting issues with one of the biggest ones being the ability to run multiple browsers/viewports automatically and making it easier to do mobile-first with Emulation.setDeviceMetricsOverride.
One thing we can consider doing is instrumenting the page (which we already do) and opening several pages in different viewports and then adding UI to support viewing in different viewports for example:
- The user adds
root-cause - In their .root-causerc.json.json they have a
viewportsfield containing multiple viewports/devices (probably ones that puppeteer supports) - Root cause sees that array and opens multiple pages instead of one and calls
Emulation.setDeviceMetricsOverrideon them - When an action is run (like page.click) it is sent to all pages.
- When a non action is performed (like extract text) it happens on one page?
- Alternatively can we convert a jest/mocha test to a "data driven" test (like jest.each) in the background?
Issues:
- What's the UI like?
- I imagine just a drop-down of all the devices that ran
- Running the test multiple times impacts state, this is challenging without mock network, would it be helpful to run it once, mock the network and then run it other times with mocked network?
I think that it's out of scope for root cause to set these things for the user, and spawning pages for him. But we do want to support showing data for same test id with different invocation settings.
Worth noting that jest-playwright have "test matrix" setting:
https://github.com/playwright-community/jest-playwright#configuration
We can change our data model and few more things to support these parts