Conversation
b104083 to
e12ebbd
Compare
sanason
left a comment
There was a problem hiding this comment.
I’m torn between this approach (where the running test site supports all different environments and the user of the test site chooses which one to use on a page-by-page basis at runtime with query params) vs an approach where the test site environment is set at execution-time (via something like npm run test-site-dev vs npm run test-site-staging).
I would guess that one is usually not switching environments during a single testing session (so the flexibility of approach 1 is less useful) and it’s probably simpler to execute a test if you don’t have to deal with setting the environment each time you load a page (so approach 2 would make it easier both to write automated tests and to perform manual tests against the test site).
| let dapCodeLocation; | ||
| dapScriptTag.id = "_fed_an_ua_tag"; | ||
| dapScriptTag.async = true; | ||
|
|
There was a problem hiding this comment.
There aren't any automated tests hitting it yet but I guess this would need to be replicated on the youtube.html page too.
There was a problem hiding this comment.
Can something like Server Side Includes be used to insert this script in the <head> of every page in the test site? I should have thought about that when I first committed this file.
There was a problem hiding this comment.
Updated the changeset here to use NGINX server side includes to populate the script tag for each page.
I agree that it would really odd to switch environments in the middle of a testing session, so we probably don't have to account for that case. The only advantage I can think of for keeping the env setting in the test runner is to be able to customize test expectations by environment. But this also seems to only be useful for a small set of tests currently that check for unexpected request hostnames and there are workarounds for it. |
I agree with your assessment. I think I prefer approach 2 (for ease of executing tests) however I don't feel strongly and I'm happy to approve this approach too. |
e12ebbd to
3f015ba
Compare
3f015ba to
4ce308e
Compare
Updated to use the suggestion above. Now in order to run the tests against different environments, you specify the environment when starting up the test-site container. Example: # Uses the staging environment version of the DAP code
npm run test-site-stg
npm run cucumber |
No description provided.