echobind/bisonapp

Clearly document APP_SECRET for e2e testing to run on GitHub

code-jenn-or opened this issue · 1 comments

When initializing a bison app the e2e Logout test is failing on CI due to missing APP_SECRET in the workflow yml.

Should document and determine how to best use this for request tests as well.

Error:
`Setting up DB ***localhost/myapp_test
Logout
1) properly logs out a user

0 passing (2s)
1 failing

  1. Logout
    properly logs out a user:
    CypressError: cy.task('login') failed with the following error:

Cannot destructure property 'token' of '(intermediate value)(intermediate value)(intermediate value)' as it is null.
at http://localhost:3001/__cypress/runner/cypress_runner.js:160995:19
at tryCatcher (http://localhost:3001/__cypress/runner/cypress_runner.js:10765:23)
at Promise._settlePromiseFromHandler (http://localhost:3001/__cypress/runner/cypress_runner.js:8700:31)
at Promise._settlePromise (http://localhost:3001/__cypress/runner/cypress_runner.js:8757:18)
at Promise._settlePromise0 (http://localhost:3001/__cypress/runner/cypress_runner.js:8802:10)
at Promise._settlePromises (http://localhost:3001/__cypress/runner/cypress_runner.js:8878:18)
at _drainQueueStep (http://localhost:3001/__cypress/runner/cypress_runner.js:5472:12)
at _drainQueue (http://localhost:3001/__cypress/runner/cypress_runner.js:5465:9)
at Async.../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:3001/__cypress/runner/cypress_runner.js:5481:5)
at Async.drainQueues (http://localhost:3001/__cypress/runner/cypress_runner.js:5351:14)
From Your Spec Code:
at login (http://localhost:3001/__cypress/tests?p=cypress/support/index.ts:708:10)
at Context.eval (http://localhost:3001/__cypress/tests?p=cypress/support/index.ts:719:16)

From Node.js Internals:
TypeError: Cannot destructure property 'token' of '(intermediate value)(intermediate value)(intermediate value)' as it is null.
at /home/runner/work/alc-design-system/alc-design-system/cypress/plugins/index.ts:82:17`

   Resolved by adding APP_SECRET: foo to the main.js.yml file

image

I ran into this issue while implementing #185. I think this might not be a documentation issue, but instead we should find a way to load an .env file when running the cypress tests.

I think in real usages of bison, you will most likely need to add additional environment variables. Updating the main.js.yml file doesn't seem like the ideal way to handle that.