altinn-studio
altinn-studio copied to clipboard
Changed the nginx config so that our local test projects will work
Description
Changed the nginx config so that our local test projects will work with different versions without editing their respective index.cshtml files. This is a quicker fix than to replace all the refs to http://localhost:8080 in our test-projects... Doing so will also require us to update Cypress tests accordingly.
Related Issue(s)
- #9032
Verification
- [ ] Your code builds clean without any errors or warnings
- [ ] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and we'll help out)
- [ ] All tests run green
@ivarne think this might solve what we discussed, for our Cypress-test apps?
I don't really like the increased complexity and the added risk of side effects from replacing http://localhost:8080/
from anywhere inn all app responses. Otherwise this looks good to me. If it solves a problem, go ahead.
Could we do the opposite instead? Cypress can also intercept requests and rewrite them - could we simply fix this in app-frontend-react
so that Cypress always loads from localhost:8080
no matter what the app tells it to? That way frontend-test
and the other testing apps become normal apps again, and we won't have to rely on this feature to include a niche case for 3 of our apps.
@olemartinorg this is the url to load app-front end-react, so too late to try to change urls there.
Rewriting urls in cypress seems promising.
Could we do the opposite instead? Cypress can also intercept requests and rewrite them - could we simply fix this in
app-frontend-react
so that Cypress always loads fromlocalhost:8080
no matter what the app tells it to? That wayfrontend-test
and the other testing apps become normal apps again, and we won't have to rely on this feature to include a niche case for 3 of our apps.
Maybe, I'm not sure if we ever run Cypress towards other environments though...
@mjulstein See the linked PR - I think this could solve the issue as well, but in app-frontend-react
. As far as I know we're not running Cypress against anything other than localhost:8080
(if we were, we wouldn't be hardcoding that URL in these apps). But if we want to, I also made that configurable (so that one could run the Cypress tests against the copy on altinncdn.no if we wanted to).
- Altinn/app-frontend-react/pull/525
Closing this as the need is now covered by the aforementioned PR in app-frontend-react
. I'll update our test apps soon.