modernweb-dev / web

Guides, tools and libraries for modern web development.
https://modern-web.dev
MIT License
2.16k stars 271 forks source link

[test-runner] select the hostname and port used for session URLs #1827

Open LynnKirby opened 2 years ago

LynnKirby commented 2 years ago

Right now the URL sent to browser launchers is based on the hostname and port that the local server is bound to. I'd like an option to change this so that browsers see a different hostname/port. This would allow easier testing against remote servers. Something like publicHostname/publicPort properties. It would be easiest to change this in the core since the URL creation is localized to a single function but the different URL would affect all configured browsers which isn't ideal. It can also be implemented in applicable launchers (Selenium and Webdriver).

My motivating use case is to run the Webdriver launcher against browsers in Docker containers (like the ones Selenium provides). This doesn't work currently since the URL is for localhost which is a different localhost than inside the container.

I'm willing to implement this if the feature will be accepted.

MWalid commented 2 years ago

Any updates on this? having the same issue here.

sijakret commented 2 years ago

yes, this is also causing us issues. in essence the hostname the server is bound to, and the launch url are NOT necessarily the same in multidevice setups.. so we would need a way to specify them separately..