Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[e2e] Make tests runnable against dev #1043

Merged
merged 10 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
tanner-ricks marked this conversation as resolved.
Show resolved Hide resolved

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;
tanner-ricks marked this conversation as resolved.
Show resolved Hide resolved
```
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
dHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwt
dGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0
aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmlj
YXRpb24gQXV0aG9yaXR5IC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP/vaCeb9zYQYKpSfYs1/T
RU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXzHHfV1IWN
cCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hW
wcKUs/Ja5CeanyTXxuzQmyWC48zC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
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
dCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwHhcNMDkwNzA3MTcy
NTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVu
dHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwt
dGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0
aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmlj
YXRpb24gQXV0aG9yaXR5IC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP/vaCeb9zYQYKpSfYs1/T
RU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXzHHfV1IWN
cCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hW
wcKUs/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1
U1+cPvQXLOZprE4yTGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0
jaWvYkxN4FisZDQSA/i2jZRjJKRxAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAP
BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ60B7vfec7aVHUbI2fkBJmqzAN
BgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5ZiXMRrEPR9RP/
jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ
Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v
1fN2D807iDginWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4R
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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AQUFBwIBFhpodHRwOi8vd3d3LmVudHJ1c3QubmV0L3JwYTAd
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
Loading