Run e2e tests across more hostname conditions: http/https and localhost/ip/domain
Re-ticketed from https://github.com/compdemocracy/polis/pull/1228
Currently, we are running the e2e tests in CI using the default polis.config.template.js:
https://github.com/compdemocracy/polis/blob/af475d7c7a54b1bd516721a5417db211c2ec6318/client-participation/polis.config.template.js#L21
I've just realized that while running local e2e tests using variations on this, things fail without some tweaking that I wasn't expecting:
- bare
http://localhostfails (because an assumption ofhttpsprotocol is hardcoded in embed.js) https://github.com/compdemocracy/polis/blob/af475d7c7a54b1bd516721a5417db211c2ec6318/client-participation/api/embed.js#L6 https://127.0.0.1.sslip.ioorhttps://123.45.67.89.sslip.iofails (becauseSERVICE_HOSTNAMEneeds to be set in order for embed.js to work) https://github.com/compdemocracy/polis/blob/af475d7c7a54b1bd516721a5417db211c2ec6318/client-participation/polis.config.template.js#L19-L21
These are some important variants in the real world, so we should figure out a way to test them in the e2e test suite. Right now, this requires 3 different docker builds, so it might be worth thinking on how to set these values more dynamics, so they can all be tested from a single build artifact.
I could imagine this could be very frustrating for someone getting things running locally for the first time, or on a remote server.