Skip to content

Commit

Permalink
[e2e] Make tests runnable against dev (#1043)
Browse files Browse the repository at this point in the history
Made e2e test suite runnable against the dev deployment when running
locally.

## Changes

- Added calls to cleanup logic after tests
- Added code to change the way auth works when running against dev
- Added additional environment variables that were missed before
- Fixed certificate issue causing the tests to run against dev

## How to test this PR

1. Read the notes
2. Make sure all other repos are up to date
3. Pull the branch for the sbl-frontend repo
4. Update your local .env file to reflect what is in the .env.example
file
5. Comment out and override the following values in your local .env with
what is listed below replacing the placeholder values with their
appropriate ones:
    - SBL_PLAYWRIGHT_TEST_TARGET="<FRONTEND_URL>"
    - SBL_PLAYWRIGHT_TEST_REGTECH_TARGET="<USER_FI_URL>"
    - SBL_PLAYWRIGHT_TEST_FILING_TARGET="<FILING_URL>"
    - SBL_PLAYWRIGHT_TEST_MAIL_TARGET="<MAIL_URL>"
    - SBL_PLAYWRIGHT_TEST_CLEANUP_TARGET="<CLEANUP_URL>"
    - SBL_PLAYWRIGHT_TEST_KC_TARGET="<KEYCLOAK_URL>"
    - SBL_PLAYWRIGHT_TEST_KC_CLI_CLIENT_SECRET="<KEYCLOAK_SECRET>"

## Notes

- As long as dev is out of date and the tests have been updated then it
is to be expected that you will see failures when running against dev.
- As it stands at the time of this writing, there are test failures
related to dev being out of date.
  • Loading branch information
tanner-ricks authored Nov 8, 2024
1 parent e0a550a commit 4195baf
Show file tree
Hide file tree
Showing 23 changed files with 356 additions and 61 deletions.
23 changes: 0 additions & 23 deletions .env.example

This file was deleted.

22 changes: 22 additions & 0 deletions .env.example.private
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
###############################################################
# ONLY ADD ENVIRONMENT VARIABLES THAT ARE NOT MEANT TO BE
# PACKAGED WITH AND VISIBLE TO THE CLIENT
###############################################################

NODE_EXTRA_CA_CERTS="./e2e/certs/entrust_chain.crt.pem"

SBL_PLAYWRIGHT_TEST_TARGET="http://localhost:8899"
SBL_PLAYWRIGHT_TEST_REGTECH_TARGET="http://localhost:8881"
SBL_PLAYWRIGHT_TEST_FILING_TARGET="http://localhost:8882"
SBL_PLAYWRIGHT_TEST_CLEANUP_TARGET="http://localhost:8883"
SBL_PLAYWRIGHT_TEST_MAIL_TARGET="http://localhost:8765"
SBL_PLAYWRIGHT_TEST_KC_TARGET="http://localhost:8880/"
SBL_PLAYWRIGHT_TEST_KC_REALM="regtech"
SBL_PLAYWRIGHT_TEST_KC_CLI_USERNAME="admin"
SBL_PLAYWRIGHT_TEST_KC_CLI_CLIENT_ID="admin-cli"
SBL_PLAYWRIGHT_TEST_KC_CLI_CLIENT_SECRET="local_test_only"
SBL_PLAYWRIGHT_TEST_KC_CLI_GRANT_TYPE="client_credentials"
SBL_PLAYWRIGHT_TEST_KC_ADMIN_USERNAME="admin1"
SBL_PLAYWRIGHT_TEST_KC_ADMIN_PASSWORD="admin"
SBL_PLAYWRIGHT_TEST_KC_ADMIN_CLIENT_ID="regtech-client"
SBL_PLAYWRIGHT_TEST_KC_ADMIN_GRANT_TYPE="password"
19 changes: 19 additions & 0 deletions .env.example.public
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
###############################################################
# ONLY ADD ENVIRONMENT VARIABLES THAT ARE MEANT TO BE PACKAGED
# WITH AND VISIBLE TO THE CLIENT
###############################################################

SBL_DEV_PORT="8899"
SBL_OIDC_AUTHORITY="http://localhost:8880/realms/regtech"
SBL_OIDC_CLIENT_ID="regtech-client"
SBL_OIDC_REDIRECT_URI="http://localhost:${SBL_DEV_PORT}/filing"
SBL_REGTECH_BASE_URL="http://localhost:8881"
SBL_FILING_BASE_URL="http://localhost:8882"
SBL_CLEANUP_BASE_URL="http://localhost:8883"
SBL_MAIL_BASE_URL="http://localhost:8765"
SBL_LOGOUT_REDIRECT_URL=""
SBL_VALIDATION_TIMEOUT_SECONDS="1200"
SBL_LONGPOLLING_DELAY_SECONDS="backoff"
SBL_UPLOAD_FILE_SIZE_LIMIT_BYTES="50000000"

SBL_ENABLE_PLAYWRIGHT_TEST_SETTINGS=false
2 changes: 1 addition & 1 deletion .github/actions/setvars/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ runs:
using: "composite"
steps:
- run: |
sed "" ${{ inputs.varFilePath }} >> $GITHUB_ENV
sed -r "/^#/Id" ${{ inputs.varFilePath }} | sed -r "/^\s*$/Id" >> $GITHUB_ENV
shell: bash
24 changes: 21 additions & 3 deletions .github/variables/.env
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
###############################################################
# ONLY ADD ENVIRONMENT VARIABLES THAT ARE MEANT TO BE PACKAGED
# WITH AND VISIBLE TO THE CLIENT BELOW
###############################################################

SBL_DEV_PORT="8899"
SBL_OIDC_AUTHORITY="http://localhost:8880/realms/regtech"
SBL_OIDC_CLIENT_ID="regtech-client"
SBL_OIDC_REDIRECT_URI="http://localhost:${SBL_DEV_PORT}/filing"
SBL_REGTECH_BASE_URL="http://localhost:8881"
SBL_MAIL_BASE_URL="http://localhost:8765"
SBL_FILING_BASE_URL="http://localhost:8882"
SBL_CLEANUP_BASE_URL="http://localhost:8883"
SBL_MAIL_BASE_URL="http://localhost:8765"
SBL_LOGOUT_REDIRECT_URL=""
SBL_VALIDATION_TIMEOUT_SECONDS="1200"
SBL_LONGPOLLING_DELAY_SECONDS="backoff"
SBL_UPLOAD_FILE_SIZE_LIMIT_BYTES="50000000"
SBL_ENABLE_PLAYWRIGHT_TEST_SETTINGS="false"
SBL_PLAYWRIGHT_TEST_TARGET="http://localhost:8899"

SBL_ENABLE_PLAYWRIGHT_TEST_SETTINGS=false

###############################################################
# ONLY ADD ENVIRONMENT VARIABLES THAT ARE NOT MEANT TO BE
# PACKAGED WITH AND VISIBLE TO THE CLIENT BELOW
###############################################################
NODE_EXTRA_CA_CERTS="./e2e/certs/entrust_chain.crt.pem"

SBL_PLAYWRIGHT_TEST_TARGET="http://localhost:${SBL_DEV_PORT}"
SBL_PLAYWRIGHT_TEST_REGTECH_TARGET="${SBL_REGTECH_BASE_URL}"
SBL_PLAYWRIGHT_TEST_FILING_TARGET="${SBL_FILING_BASE_URL}"
SBL_PLAYWRIGHT_TEST_CLEANUP_TARGET="${SBL_CLEANUP_BASE_URL}"
SBL_PLAYWRIGHT_TEST_MAIL_TARGET="${SBL_MAIL_BASE_URL}"
SBL_PLAYWRIGHT_TEST_KC_TARGET="http://localhost:8880/"
SBL_PLAYWRIGHT_TEST_KC_REALM="regtech"
SBL_PLAYWRIGHT_TEST_KC_CLI_USERNAME="admin"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.env*
!.env.example
!.env.example.public
!.env.example.private
node_modules
.DS_Store
dist
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ COPY --from=build-stage /usr/src/app/dist /usr/share/nginx/html
COPY --from=build-stage \
/usr/src/app/import-meta-env-alpine \
/usr/src/app/nginx-entrypoint.sh \
/usr/src/app/.env.example \
/usr/src/app/.env.example.public \
/usr/share/nginx/html/

# copy nginx configuration into template folder for env var injection
Expand Down
55 changes: 46 additions & 9 deletions ENV-GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# To start

Make a copy of `.env.example`, rename to `.env`, and place it into the root of the project's folder.
Make a copy of `.env.example.public`, rename to `.env`, and place it into the root of the project's folder.
Copy the content of `.env.example.private` into the `.env` file that was just copied.

# Required Environment Variables
### Required Runtime Environment Variables

```env
SBL_DEV_PORT="8899"
Expand All @@ -11,13 +12,24 @@ SBL_OIDC_CLIENT_ID="regtech-client"
SBL_OIDC_REDIRECT_URI="http://localhost:${SBL_DEV_PORT}/filing"
SBL_REGTECH_BASE_URL="http://localhost:8881"
SBL_FILING_BASE_URL="http://localhost:8882"
SBL_CLEANUP_BASE_URL="http://localhost:8883"
SBL_MAIL_BASE_URL="http://localhost:8765"
SBL_LOGOUT_REDIRECT_URL=""
SBL_VALIDATION_TIMEOUT_SECONDS="1200"
SBL_LONGPOLLING_DELAY_SECONDS="backoff"
SBL_UPLOAD_FILE_SIZE_LIMIT_BYTES="50000000"
SBL_ENABLE_PLAYWRIGHT_TEST_SETTINGS="false"
SBL_PLAYWRIGHT_TEST_TARGET="http://localhost:8899"
SBL_ENABLE_PLAYWRIGHT_TEST_SETTINGS=false
```

### Required Test Environment Variables

```env
NODE_EXTRA_CA_CERTS="./e2e/certs/entrust_chain.crt.pem"
SBL_PLAYWRIGHT_TEST_TARGET="http://localhost:${SBL_DEV_PORT}"
SBL_PLAYWRIGHT_TEST_REGTECH_TARGET="${SBL_REGTECH_BASE_URL}"
SBL_PLAYWRIGHT_TEST_FILING_TARGET="${SBL_FILING_BASE_URL}"
SBL_PLAYWRIGHT_TEST_CLEANUP_TARGET="${SBL_CLEANUP_BASE_URL}"
SBL_PLAYWRIGHT_TEST_MAIL_TARGET="${SBL_MAIL_BASE_URL}"
SBL_PLAYWRIGHT_TEST_KC_TARGET="http://localhost:8880/"
SBL_PLAYWRIGHT_TEST_KC_REALM="regtech"
SBL_PLAYWRIGHT_TEST_KC_CLI_USERNAME="admin"
Expand All @@ -30,19 +42,44 @@ SBL_PLAYWRIGHT_TEST_KC_ADMIN_CLIENT_ID="regtech-client"
SBL_PLAYWRIGHT_TEST_KC_ADMIN_GRANT_TYPE="password"
```

### To add a new environment variable
## How to add new environment variables

Both private and public variables will need to be added to the places listed below and in accordance with their applicable instructions

When adding a new env variable that needs to be used on production, there are a few places that need to be updated:
### To add a new public environment variable

- "Required Environment Variables" section in this guide (`ENV-GUIDE.md`)
- `.env.example` in the root of this repo
This is where environment vairables that are meant to be visible to the client go

When adding a new public env variable that needs to be used on production, there are a few places that need to be updated:

- "Required Runtime Environment Variables" section in this guide (`ENV-GUIDE.md`)
- `.env.example.public` in the root of this repo
- `.github/workflows/test.yml` in this repo in the `env` section
- Run `yarn start` at least once to generate types for the new env variables
- `sbl-project/dev_setup/frontend.local.env` file in the `sbl-project` repo
- ask a devops/backend engineer to help you update the `values.yaml` overrides

### To use an environment variable
### To use a public environment variable

```js
import.meta.env.SOME_KEY;
```

### To add a new private environment variable

This is where environment vairables that are not meant to be visible to the client go

When adding a new private env variable that needs to be used on production, there are a few places that need to be updated:

- "Required Test Environment Variables" section in this guide (`ENV-GUIDE.md`)
- `.env.example.private` in the root of this repo
- `.github/workflows/test.yml` in this repo in the `env` section
- Run `yarn start` at least once to generate types for the new env variables
- `sbl-project/dev_setup/frontend.local.env` file in the `sbl-project` repo
- ask a devops/backend engineer to help you update the `values.yaml` overrides

### To use a private environment variable

```js
process.env.SOME_KEY;
```
7 changes: 7 additions & 0 deletions e2e/certs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Purpose

The purpose of this directory and the files held within is to hold certificates from the certificate chain of the cert that will be presented by the dev deployment. The purpose of each file can be found below:

- entrust_g2_ca.crt.pem: Root certificate for the chain in PEM format
- entrust_l1k.crt.pem: Intermediary certificate for the chain in PEM format
- entrust_chain.crt.pem: Both the root and the intermediary certificates in the same file so that they can both easily be passed as Node Extra Certs
55 changes: 55 additions & 0 deletions e2e/certs/entrust_chain.crt.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
-----BEGIN CERTIFICATE-----
MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMC
VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50
cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3Qs
IEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVz
dCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwHhcNMDkwNzA3MTcy
NTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVu
dHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3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EwEB/wQIMAYBAf8CAQAwMwYIKwYBBQUHAQEEJzAlMCMGCCsG
AQUFBzABhhdodHRwOi8vb2NzcC5lbnRydXN0Lm5ldDAwBgNVHR8EKTAnMCWgI6Ah
hh9odHRwOi8vY3JsLmVudHJ1c3QubmV0L2cyY2EuY3JsMDsGA1UdIAQ0MDIwMAYE
VR0gADAoMCYGCCsGAQUFBwIBFhpodHRwOi8vd3d3LmVudHJ1c3QubmV0L3JwYTAd
BgNVHQ4EFgQUgqJwdN28Uz/Pe9T3zX+nYMYKTL8wHwYDVR0jBBgwFoAUanImetAe
733nO2lR1GyNn5ASZqswDQYJKoZIhvcNAQELBQADggEBADnVjpiDYcgsY9NwHRkw
y/YJrMxp1cncN0HyMg/vdMNY9ngnCTQIlZIv19+4o/0OgemknNM/TWgrFTEKFcxS
BJPok1DD2bHi4Wi3Ogl08TRYCj93mEC45mj/XeTIRsXsgdfJghhcg85x2Ly/rJkC
k9uUmITSnKa1/ly78EqvIazCP0kkZ9Yujs+szGQVGHLlbHfTUqi53Y2sAEo1GdRv
c6N172tkw+CNgxKhiucOhk3YtCAbvmqljEtoZuMrx1gL+1YQ1JH7HdMxWBCMRON1
exCdtTix9qrKgWRs6PLigVWXUX/hwidQosk8WwBD9lu51aX8/wdQQGcHsFXwt35u
Lcw=
-----END CERTIFICATE-----
25 changes: 25 additions & 0 deletions e2e/certs/entrust_g2_ca.crt.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-----BEGIN CERTIFICATE-----
MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMC
VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50
cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3Qs
IEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVz
d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Fcq1rca8PdCE6OoGcrBNOTJ4vz4R
nAuknZoh8/CbCzB428Hch0P+vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmH
VHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xOe4pIb4tF9g==
-----END CERTIFICATE-----
30 changes: 30 additions & 0 deletions e2e/certs/entrust_l1k.crt.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN CERTIFICATE-----
MIIFDjCCA/agAwIBAgIMDulMwwAAAABR03eFMA0GCSqGSIb3DQEBCwUAMIG+MQsw
CQYDVQQGEwJVUzEWMBQGA1UEChMNRW50cnVzdCwgSW5jLjEoMCYGA1UECxMfU2Vl
IHd3dy5lbnRydXN0Lm5ldC9sZWdhbC10ZXJtczE5MDcGA1UECxMwKGMpIDIwMDkg
RW50cnVzdCwgSW5jLiAtIGZvciBhdXRob3JpemVkIHVzZSBvbmx5MTIwMAYDVQQD
EylFbnRydXN0IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjAeFw0x
NTEwMDUxOTEzNTZaFw0zMDEyMDUxOTQzNTZaMIG6MQswCQYDVQQGEwJVUzEWMBQG
A1UEChMNRW50cnVzdCwgSW5jLjEoMCYGA1UECxMfU2VlIHd3dy5lbnRydXN0Lm5l
dC9sZWdhbC10ZXJtczE5MDcGA1UECxMwKGMpIDIwMTIgRW50cnVzdCwgSW5jLiAt
IGZvciBhdXRob3JpemVkIHVzZSBvbmx5MS4wLAYDVQQDEyVFbnRydXN0IENlcnRp
ZmljYXRpb24gQXV0aG9yaXR5IC0gTDFLMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
MIIBCgKCAQEA2j+W0E25L0Tn2zlem1DuXKVh2kFnUwmqAJqOV38pa9vH4SEkqjrQ
jUcj0u1yFvCRIdJdt7hLqIOPt5EyaM/OJZMssn2XyP7BtBe6CZ4DkJN7fEmDImiK
m95HwzGYei59QAvS7z7Tsoyqj0ip/wDoKVgG97aTWpRzJiatWA7lQrjV6nN5ZGhT
JbiEz5R6rgZFDKNrTdDGvuoYpDbwkrK6HIiPOlJ/915tgxyd8B/lw9bdpXiSPbBt
LOrJz5RBGXFEaLpHPATpXbo+8DX3Fbae8i4VHj9HyMg4p3NFXU2wO7GOFyk36t0F
ASK7lDYqjVs1/lMZLwhGwSqzGmIdTivZGwIDAQABo4IBDDCCAQgwDgYDVR0PAQH/
BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwMwYIKwYBBQUHAQEEJzAlMCMGCCsG
AQUFBzABhhdodHRwOi8vb2NzcC5lbnRydXN0Lm5ldDAwBgNVHR8EKTAnMCWgI6Ah
hh9odHRwOi8vY3JsLmVudHJ1c3QubmV0L2cyY2EuY3JsMDsGA1UdIAQ0MDIwMAYE
VR0gADAoMCYGCCsGAQUFBwIBFhpodHRwOi8vd3d3LmVudHJ1c3QubmV0L3JwYTAd
BgNVHQ4EFgQUgqJwdN28Uz/Pe9T3zX+nYMYKTL8wHwYDVR0jBBgwFoAUanImetAe
733nO2lR1GyNn5ASZqswDQYJKoZIhvcNAQELBQADggEBADnVjpiDYcgsY9NwHRkw
y/YJrMxp1cncN0HyMg/vdMNY9ngnCTQIlZIv19+4o/0OgemknNM/TWgrFTEKFcxS
BJPok1DD2bHi4Wi3Ogl08TRYCj93mEC45mj/XeTIRsXsgdfJghhcg85x2Ly/rJkC
k9uUmITSnKa1/ly78EqvIazCP0kkZ9Yujs+szGQVGHLlbHfTUqi53Y2sAEo1GdRv
c6N172tkw+CNgxKhiucOhk3YtCAbvmqljEtoZuMrx1gL+1YQ1JH7HdMxWBCMRON1
exCdtTix9qrKgWRs6PLigVWXUX/hwidQosk8WwBD9lu51aX8/wdQQGcHsFXwt35u
Lcw=
-----END CERTIFICATE-----
22 changes: 20 additions & 2 deletions e2e/fixtures/testFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import pointOfContactJson from '../test-data/point-of-contact/point-of-contact-d
import createDomainAssociation from '../utils/createDomainAssociation';
import createInstitution from '../utils/createInstitution';
import createKeycloakUser from '../utils/createKeycloakUser';
import deleteKeycloakUser from '../utils/deleteKeycloakUser';
import getAdminKeycloakToken from '../utils/getKeycloakToken';
import type { Account } from '../utils/testFixture.utils';
import {
expectedNoAssociationsUrl,
expectedWithAssociationsUrl,
getTestDataObject,
} from '../utils/testFixture.utils';
import cleanup, { cleanupHealthcheck } from '../utils/testFixture.cleanup';
import { ResultUploadMessage, uploadFile } from '../utils/uploadFile';
import { clickContinue, clickContinueNext } from '../utils/navigation.utils';

Expand Down Expand Up @@ -78,8 +80,7 @@ export const test = baseTest.extend<{
testRssdId,
} = account;
// eslint-enable @typescript-eslint/no-magic-numbers

await createKeycloakUser({
const testUserId = await createKeycloakUser({
testUserEmail,
testUsername,
testFirstName,
Expand Down Expand Up @@ -112,6 +113,17 @@ export const test = baseTest.extend<{
await page
.getByRole('button', { name: 'Sign in with Login.gov' })
.click();

if (
!(process.env.SBL_PLAYWRIGHT_TEST_TARGET ?? '').includes('localhost:')
) {
await expect(
page.getByRole('link', { name: '‹ Back to Small business' }),
).toBeVisible();
await page
.getByRole('link', { name: '‹ Back to Small business' })
.click();
}
await expect(page.locator('#kc-page-title')).toContainText(
'Sign in to your account',
);
Expand Down Expand Up @@ -142,6 +154,12 @@ export const test = baseTest.extend<{
});

await use();

const healthy = await cleanupHealthcheck({ adminToken });
if (healthy) {
await cleanup({ adminToken, testLei });
}
await deleteKeycloakUser({ id: testUserId });
},
{ auto: true },
],
Expand Down
Loading

0 comments on commit 4195baf

Please sign in to comment.