[BB2-1596] Add selenium tests for node sample app#29
Conversation
dtisza1
left a comment
There was a problem hiding this comment.
@JFU-GIT I didn't test the selenium part yet, but the main application is broken for me using the PR branch.
I did the following:
- Tested using the "master" branch and http://localhost:3000 and auth flow. It works and brings in the data.
- Tested using this PR's branch. It gets the following errors in the logs and doesn't get the data in to the client side:
bluebutton-sample-client-nodejs-react-server-1 | GET /api/authorize/authurl?pkce=true&version=v2&env=sandbox 200 1.253 ms - 229
bluebutton-sample-client-nodejs-react-server-1 | GET /api/bluebutton/callback/?code=M9ZIncLGOe7xteirOdTuwL6PzHEA45&state=-AUZbmFqeQgfTpcsFrKm9mwqv9igpyAibLPthKpMPIM 200 790.164 ms - 249281
bluebutton-sample-client-nodejs-react-server-1 | Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
bluebutton-sample-client-nodejs-react-server-1 | at ServerResponse.setHeader (_http_outgoing.js:561:11)
bluebutton-sample-client-nodejs-react-server-1 | at ServerResponse.header (/server/node_modules/express/lib/response.js:794:10)
bluebutton-sample-client-nodejs-react-server-1 | at ServerResponse.location (/server/node_modules/express/lib/response.js:915:15)
bluebutton-sample-client-nodejs-react-server-1 | at ServerResponse.redirect (/server/node_modules/express/lib/response.js:953:18)
bluebutton-sample-client-nodejs-react-server-1 | at /server/src/routes/Authorize.ts:81:7
bluebutton-sample-client-nodejs-react-server-1 | at Generator.next (<anonymous>)
bluebutton-sample-client-nodejs-react-server-1 | at fulfilled (/server/src/routes/Authorize.ts:5:58)
bluebutton-sample-client-nodejs-react-server-1 | at processTicksAndRejections (internal/process/task_queues.js:95:5)
I just tried to run a dockerized sample app (not selenium tests) fresh off the PR, and it works as expected (bring back EOBs) Looking at the error I was wondering if it's from the inconsistency with the dependencies? How about remove the ./server/node_modules and start the docker compose ? |
oragame
left a comment
There was a problem hiding this comment.
This looks good James, thanks for walking through the config with me. All tests are passing on selenium. Nice Work!
ajshred
left a comment
There was a problem hiding this comment.
I finally got this to work for me. Good work James!
dtisza1
left a comment
There was a problem hiding this comment.
@JFU-GIT This looks good to me!
I was finally able to get the tests to work. I was mainly having an issue by using my old config.ts w/o your updates.
There's also an issue running the tests when not on VPN, but works when on VPN. So this is OK.
Good work on this!
JIRA Ticket:
BB2-1596
User Story or Bug Summary:
Context:
With BB2 Node SDK available, and BB2 Node React Sample re-factored to use BB2 Node SDK as the underlying interaction with the BB2 API, it is good to add selenium tests for the sample app, it has the following benefits:
AC:
Selenium tests added to test BB2 authorization and data flows from a node client.
What Does This PR Do?
What Should Reviewers Watch For?
If you're reviewing this PR, please check these things, in particular:
May be need to add AWS parameter store client side to fetch the app creds on target ENV.