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

PRMDR-464 Remove hardcoded port numbers #201

Merged
merged 46 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
baa7d7a
boiler plate for smoketest GitHub action
Dec 4, 2023
2c511de
yml errors removed
Dec 4, 2023
8ee1ddb
cypress smoketesting configuration changes
Dec 4, 2023
23d6833
Merge branch 'main' into prmdr_485
RioKnightleyNHS Dec 6, 2023
a9522c5
Migrate Cypress baseUrl to cross-env
RioKnightleyNHS Dec 6, 2023
fb2d150
Update cypress smoke workflow to use cross-env
RioKnightleyNHS Dec 6, 2023
7096e55
Amend cypress cross-env
RioKnightleyNHS Dec 6, 2023
ace6e69
Add final adjustments to smoke test workflow
RioKnightleyNHS Dec 6, 2023
93cf719
Add sandbox input to smoke test workflow
RioKnightleyNHS Dec 6, 2023
e451f1e
Add checkout input for smoke test workflow
RioKnightleyNHS Dec 6, 2023
cf5ed06
Fix input typo in build branch
RioKnightleyNHS Dec 6, 2023
109dfda
Fix null on url
RioKnightleyNHS Dec 6, 2023
fec4c91
Update input verbiage
RioKnightleyNHS Dec 6, 2023
5f537af
Add cypress/grep package
RioKnightleyNHS Dec 6, 2023
1861a20
Fix missing env variables
RioKnightleyNHS Dec 6, 2023
7a3d896
Sandbox input change to url
RioKnightleyNHS Dec 6, 2023
4ca8d60
Update other input urls
RioKnightleyNHS Dec 6, 2023
e0494e1
Restore cypress env variable
RioKnightleyNHS Dec 6, 2023
278835a
Change cypress input env
RioKnightleyNHS Dec 6, 2023
59248be
Update URL test
RioKnightleyNHS Dec 6, 2023
0b24b4e
Remove cross-env test
RioKnightleyNHS Dec 6, 2023
6b1a0e6
Fix inconsistencies in trailing slashes
RioKnightleyNHS Dec 6, 2023
d38d8ec
Add new smoke test layout
RioKnightleyNHS Dec 6, 2023
42dbf80
Add first smoke test
RioKnightleyNHS Dec 6, 2023
47967ca
Add grepTags for regression and smoke cypress tests
RioKnightleyNHS Dec 6, 2023
96e90f5
Update grepTags workflow env
RioKnightleyNHS Dec 6, 2023
41520c9
Alter cy.visit with new config usage
RioKnightleyNHS Dec 6, 2023
a6fddd1
Fix grepTags on other workflows
RioKnightleyNHS Dec 6, 2023
8b87048
[PRMDR-464] (WIP) Remove hardcoded port number from nginx.conf and do…
joefong-nhs Dec 7, 2023
7c8a064
[PRMDR-464] Edit github actions to read env var CONTAINER_PORT before…
joefong-nhs Dec 11, 2023
5635abd
[PRMDR-464] Fix typo in yml
joefong-nhs Dec 11, 2023
1dc1740
[PRMDR-464] Edit github action
joefong-nhs Dec 11, 2023
7a929ff
[PRMDR-464] Add CONTAINER_PORT to sh script which build .env
joefong-nhs Dec 11, 2023
f510a67
[PRMDR-464] edit docker file to get CONTAINER_PORT from build_arg
joefong-nhs Dec 11, 2023
e75733b
[PRMDR-464] Revert change to react-environment-config.sh, add build_a…
joefong-nhs Dec 11, 2023
a50be6b
[PRMDR-464] Add build arg to docker-compose and github action files
joefong-nhs Dec 11, 2023
8788ac5
[PRMDR-464] Remove all occurence of port 3000 in code (except github …
joefong-nhs Dec 13, 2023
bdec147
[PRMDR-464] Fix inconsistency related to slash (/) after baseUrl in c…
joefong-nhs Dec 13, 2023
c0ce0a4
Merge branch 'prmdr_485' into PRMDR-464
joefong-nhs Dec 13, 2023
2a731ff
[PRMDR-464] Introduce newer ver of cypress tests from branch PRMDR-48…
joefong-nhs Dec 13, 2023
3917231
[PRMDR-464] Replace hardcoded CYPRESS_BASE_URL in github action yml w…
joefong-nhs Dec 13, 2023
b80d747
[PRMDR-464] Update README.md
joefong-nhs Dec 13, 2023
0c0f1ed
[PRMDR-464] fix typo in README.md
joefong-nhs Dec 13, 2023
738e7a2
[PRMDR-464] Fix cy.visit(baseUrl + '/endpoint') pattern
joefong-nhs Dec 15, 2023
98dbcd8
Merge branch 'main' into PRMDR-464
joefong-nhs Dec 15, 2023
bd1c177
Merge branch 'main' into PRMDR-464
joefong-nhs Dec 18, 2023
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
6 changes: 4 additions & 2 deletions .github/workflows/full-ui-dispatch-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ jobs:

- uses: dkershner6/aws-ssm-getparameters-action@v1
with:
parameterPairs: '/ndr/${{ github.event.client_payload.sandbox }}/api_endpoint = DOC_STORE_API_ENDPOINT'
parameterPairs: '/ndr/${{ github.event.client_payload.sandbox }}/api_endpoint = DOC_STORE_API_ENDPOINT,
/ndr/${{ github.event.client_payload.sandbox }}/container_port = CONTAINER_PORT'
withDecryption: 'true' # defaults to true

- name: Configure React environment vars
Expand All @@ -97,8 +98,9 @@ jobs:
ECR_REPOSITORY: ndr-${{ github.event.client_payload.sandbox }}-app
IMAGE_TAG: latest
IMAGE_TAG_SHA: ${{ github.sha }}
CONTAINER_PORT: ${{ env.CONTAINER_PORT }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA .
docker build --build-arg="CONTAINER_PORT=$CONTAINER_PORT" -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA" >> $GITHUB_OUTPUT
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/new-ui-deploy-feature-to-sandbox-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ jobs:

- uses: dkershner6/aws-ssm-getparameters-action@v1
with:
parameterPairs: '/ndr/${{ inputs.sandbox }}/api_endpoint = DOC_STORE_API_ENDPOINT'
parameterPairs: '/ndr/${{ inputs.sandbox }}/api_endpoint = DOC_STORE_API_ENDPOINT,
/ndr/${{ inputs.sandbox }}/container_port = CONTAINER_PORT'
withDecryption: 'true' # defaults to true

- name: Configure React environment vars
Expand All @@ -124,8 +125,9 @@ jobs:
ECR_REPOSITORY: ndr-${{ inputs.sandbox }}-app
IMAGE_TAG: latest
IMAGE_TAG_SHA: ${{ github.sha }}
CONTAINER_PORT: ${{ env.CONTAINER_PORT }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA .
docker build --build-arg="CONTAINER_PORT=$CONTAINER_PORT" -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA" >> $GITHUB_OUTPUT
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ui-deploy-to-perf-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ jobs:

- uses: dkershner6/aws-ssm-getparameters-action@v1
with:
parameterPairs: '/ndr/${{ vars.BUILD_ENV }}/api_endpoint = DOC_STORE_API_ENDPOINT'
parameterPairs: '/ndr/${{ vars.BUILD_ENV }}/api_endpoint = DOC_STORE_API_ENDPOINT,
/ndr/${{ vars.BUILD_ENV }}/container_port = CONTAINER_PORT'
withDecryption: 'true' # defaults to true

- name: Configure React environment vars
Expand All @@ -99,8 +100,9 @@ jobs:
ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPO_NAME }}
IMAGE_TAG: perf-${{ github.event.inputs.tagVersion}}
IMAGE_TAG_SHA: ${{ github.sha }}
CONTAINER_PORT: ${{ env.CONTAINER_PORT }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA .
docker build --build-arg="CONTAINER_PORT=$CONTAINER_PORT" -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA" >> $GITHUB_OUTPUT
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/ui-deploy-to-pre-prod-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ jobs:
name: build
path: ./app/build
env:
CYPRESS_BASE_URL: 'http://localhost:3000'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

# Npm run will run the app locally, we want to test the built application with env vars using serve
- name: Install serve globally
Expand Down Expand Up @@ -176,8 +176,8 @@ jobs:
browser: firefox
working-directory: ./app
env:
CYPRESS_BASE_URL: 'http://localhost:3000'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

cypress-run-edge:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -209,8 +209,8 @@ jobs:
browser: edge
working-directory: ./app
env:
CYPRESS_BASE_URL: 'http://localhost:3000'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

react_build_and_deploy_docker_image:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -245,7 +245,8 @@ jobs:

- uses: dkershner6/aws-ssm-getparameters-action@v1
with:
parameterPairs: '/ndr/${{ vars.BUILD_ENV }}/api_endpoint = DOC_STORE_API_ENDPOINT'
parameterPairs: '/ndr/${{ vars.BUILD_ENV }}/api_endpoint = DOC_STORE_API_ENDPOINT,
/ndr/${{ vars.BUILD_ENV }}/container_port = CONTAINER_PORT'
withDecryption: 'true' # defaults to true

- name: Configure React environment vars
Expand All @@ -264,8 +265,9 @@ jobs:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPO_NAME }}
IMAGE_TAG: ${{needs.tag_and_release.outputs.tag}}
CONTAINER_PORT: ${{ env.CONTAINER_PORT }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
docker build --build-arg="CONTAINER_PORT=$CONTAINER_PORT" -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/ui-deploy-to-prod-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ jobs:
browser: chrome
working-directory: ./app
env:
CYPRESS_BASE_URL: 'http://localhost:3000'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

cypress-run-firefox:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -152,8 +152,8 @@ jobs:
browser: firefox
working-directory: ./app
env:
CYPRESS_BASE_URL: 'http://localhost:3000'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

cypress-run-edge:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -185,8 +185,8 @@ jobs:
browser: edge
working-directory: ./app
env:
CYPRESS_BASE_URL: 'http://localhost:3000'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

react_build_and_deploy_docker_image:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -215,7 +215,8 @@ jobs:

- uses: dkershner6/aws-ssm-getparameters-action@v1
with:
parameterPairs: '/ndr/${{ vars.BUILD_ENV }}/api_endpoint = DOC_STORE_API_ENDPOINT'
parameterPairs: '/ndr/${{ vars.BUILD_ENV }}/api_endpoint = DOC_STORE_API_ENDPOINT,
/ndr/${{ vars.BUILD_ENV }}/container_port = CONTAINER_PORT'
withDecryption: 'true' # defaults to true

- name: Configure React environment vars
Expand All @@ -234,8 +235,9 @@ jobs:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPO_NAME }}
IMAGE_TAG: prod-${{ github.event.inputs.tagVersion}}
CONTAINER_PORT: ${{ env.CONTAINER_PORT }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
docker build --build-arg="CONTAINER_PORT=$CONTAINER_PORT" -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/ui-deploy-to-test-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ jobs:
browser: chrome
working-directory: ./app
env:
CYPRESS_BASE_URL: 'http://localhost:3000'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

cypress-run-firefox:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -150,8 +150,8 @@ jobs:
browser: firefox
working-directory: ./app
env:
CYPRESS_BASE_URL: 'http://localhost:3000'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

cypress-run-edge:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -183,8 +183,8 @@ jobs:
browser: edge
working-directory: ./app
env:
CYPRESS_BASE_URL: 'http://localhost:3000'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

react_build_and_deploy_docker_image:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -232,8 +232,9 @@ jobs:
ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPO_NAME }}
IMAGE_TAG: latest
IMAGE_TAG_SHA: ${{ github.sha }}
CONTAINER_PORT: ${{ env.CONTAINER_PORT }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA .
docker build --build-arg="CONTAINER_PORT=$CONTAINER_PORT" -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA" >> $GITHUB_OUTPUT
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/ui-dev-to-main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ jobs:
browser: chrome
working-directory: ./app
env:
CYPRESS_BASE_URL: 'http://localhost:3000/'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

cypress-run-firefox:
runs-on: ubuntu-22.04
needs: install-cypress-build
Expand Down Expand Up @@ -153,8 +153,8 @@ jobs:
browser: firefox
working-directory: ./app
env:
CYPRESS_BASE_URL: 'http://localhost:3000/'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

cypress-run-edge:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -190,8 +190,8 @@ jobs:
browser: edge
working-directory: ./app
env:
CYPRESS_BASE_URL: 'http://localhost:3000/'
CYPRESS_RUN_AS_SMOKETEST: false
CYPRESS_BASE_URL: ${{ vars.CYPRESS_BASE_URL }}
CYPRESS_grepTags: 'regression'

react_build_and_deploy_docker_image:
runs-on: ubuntu-latest
Expand All @@ -218,7 +218,8 @@ jobs:

- uses: dkershner6/aws-ssm-getparameters-action@v1
with:
parameterPairs: '/ndr/${{ vars.BUILD_ENV }}/api_endpoint = DOC_STORE_API_ENDPOINT'
parameterPairs: '/ndr/${{ vars.BUILD_ENV }}/api_endpoint = DOC_STORE_API_ENDPOINT,
/ndr/${{ vars.BUILD_ENV }}/container_port = CONTAINER_PORT'
withDecryption: 'true' # defaults to true

- name: Configure React environment vars
Expand All @@ -238,8 +239,9 @@ jobs:
ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPO_NAME }}
IMAGE_TAG: latest
IMAGE_TAG_SHA: ${{ github.sha }}
CONTAINER_PORT: ${{ env.CONTAINER_PORT }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA .
docker build --build-arg="CONTAINER_PORT=$CONTAINER_PORT" -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG_SHA" >> $GITHUB_OUTPUT
Expand Down
44 changes: 22 additions & 22 deletions .github/workflows/ui-smoketest.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
# .github/workflows/terraform-dev
name: 'SMOKETEST UI'
name: 'SANDBOX - Smoke Test'

on:
workflow_dispatch:
inputs:
buildBranch:
description: 'Feature branch to push to test?'
build_branch:
description: 'Branch with smoke tests.'
required: true
type: 'string'
smokeUrl:
description: 'What URL to run smoketest against'
default: 'main'
sandbox:
description: 'Sandbox to run the smoke tests on.'
required: true
default: 'https://ndr-dev.access-request-fulfilment.patient-deductions.nhs.uk/'
type: 'string'
default: 'ndr'

permissions:
pull-requests: write
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:

cypress-run-chrome:
runs-on: ubuntu-22.04
needs: install-cypress-build
steps:
- name: Checkout
uses: actions/checkout@v3

# Npm run will run the app locally, we want to test the built application with env vars using serve
- name: Install serve globally
run: npm install -g serve
with:
repository: 'nhsconnect/national-document-repository'
ref: ${{ github.event.inputs.build_branch}}

- name: Cypress install
run: |
Expand All @@ -44,18 +42,17 @@ jobs:
browser: chrome
working-directory: ./app
env:
CYPRESS_BASE_URL: '${{ github.event.inputs.smokeUrl}}'
CYPRESS_BASE_URL: 'https://${{ github.event.inputs.sandbox }}.access-request-fulfilment.patient-deductions.nhs.uk'
CYPRESS_grepTags: 'smoke'

cypress-run-firefox:
runs-on: ubuntu-22.04
needs: install-cypress-build
steps:
- name: Checkout
uses: actions/checkout@v3

# Npm run will run the app locally, we want to test the built application with env vars using serve
- name: Install serve globally
run: npm install -g serve
with:
repository: 'nhsconnect/national-document-repository'
ref: ${{ github.event.inputs.build_branch}}

- name: Cypress install
run: |
Expand All @@ -69,14 +66,17 @@ jobs:
browser: firefox
working-directory: ./app
env:
CYPRESS_BASE_URL: '${{ github.event.inputs.smokeUrl}}'
CYPRESS_BASE_URL: 'https://${{ github.event.inputs.sandbox }}.access-request-fulfilment.patient-deductions.nhs.uk'
CYPRESS_grepTags: 'smoke'

cypress-run-edge:
runs-on: ubuntu-22.04
needs: install-cypress-build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: 'nhsconnect/national-document-repository'
ref: ${{ github.event.inputs.build_branch}}

- name: Cypress install
run: |
Expand All @@ -90,5 +90,5 @@ jobs:
browser: edge
working-directory: ./app
env:
CYPRESS_BASE_URL: '${{ github.event.inputs.smokeUrl}}'

CYPRESS_BASE_URL: 'https://${{ github.event.inputs.sandbox }}.access-request-fulfilment.patient-deductions.nhs.uk'
CYPRESS_grepTags: 'smoke'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
app/mochawesome-report/
app/mochawesomemerged.json

# Translations
*.mo
Expand Down
3 changes: 2 additions & 1 deletion app/.dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/node_modules
/node_modules
Dockerfile
6 changes: 5 additions & 1 deletion app/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ REACT_APP_DOC_STORE_API_ENDPOINT=%DOC_STORE_API_ENDPOINT%
REACT_APP_AWS_REGION=%AWS_REGION%
REACT_APP_OIDC_PROVIDER_ID=%OIDC_PROVIDER_ID%
REACT_APP_ENVIRONMENT=%BUILD_ENV% # 'local'
REACT_APP_IMAGE_VERSION="%IMAGE_VERSION%"
REACT_APP_IMAGE_VERSION="%IMAGE_VERSION%"
CONTAINER_PORT=xx # Port number within the container. Needed for building the docker image
HOST_PORT=xxxx # Port number that the docker-compose localhost exposes. Only need this if we run docker-compose
PORT=xxxx # Port number of the localhost dev server when we run `make start`
CYPRESS_BASE_URL=http://localhost:xxxx # Use the port number same as above PORT
Loading
Loading