Skip to content

Commit

Permalink
Merge pull request #3482 from GSA-TTS/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm authored Mar 5, 2024
2 parents 0bbc05a + 79f56d7 commit 9ee4a66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ jobs:
environment: ${{ inputs.environment }}
env:
CYPRESS_API_GOV_KEY: ${{ secrets.CYPRESS_API_GOV_KEY }}
CYPRESS_API_GOV_USER_ID: ${{ secrets.CYPRESS_API_GOV_USER_ID }}
CYPRESS_API_GOV_KEY_ADMIN: ${{ secrets.CYPRESS_API_GOV_KEY_ADMIN }}
CYPRESS_API_GOV_USER_ID_ADMIN: ${{ secrets.CYPRESS_API_GOV_USER_ID_ADMIN }}
CYPRESS_API_GOV_URL: ${{ secrets.CYPRESS_API_GOV_URL }}
CYPRESS_API_VERSION: ${{ secrets.CYPRESS_API_VERSION }}
CYPRESS_ADMIN_API_VERSION: ${{ secrets.CYPRESS_ADMIN_API_VERSION }}
CYPRESS_BASE_URL: ${{ inputs.url }}
CYPRESS_LOGIN_TEST_EMAIL: ${{ secrets.CYPRESS_LOGIN_TEST_EMAIL }}
CYPRESS_LOGIN_TEST_PASSWORD: ${{ secrets.CYPRESS_LOGIN_TEST_PASSWORD }}
Expand Down
10 changes: 6 additions & 4 deletions backend/cypress/support/dissemination-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

const API_GOV_JWT = Cypress.env('API_GOV_JWT') || '';
const API_GOV_KEY = Cypress.env('API_GOV_KEY') || '';
const API_GOV_USER_ID = Cypress.env('API_GOV_USER_ID');
const API_GOV_KEY_ADMIN = Cypress.env('API_GOV_KEY_ADMIN');
const API_GOV_USER_ID_ADMIN = Cypress.env('API_GOV_USER_ID_ADMIN');
const API_GOV_URL = Cypress.env('API_GOV_URL');
const API_VERSION = Cypress.env('API_VERSION');
Expand All @@ -25,7 +27,7 @@ function grantTribalAccess(email, user_id) {
url: `${API_GOV_URL}/rpc/add_tribal_api_key_access`,
headers: {
Authorization: `Bearer ${API_GOV_JWT}`,
'X-Api-Key': API_GOV_KEY,
'X-Api-Key': API_GOV_KEY_ADMIN,
'X-Api-User-Id': API_GOV_USER_ID_ADMIN,
'Content-Profile': ADMIN_API_VERSION,
'Content-Type': 'application/json',
Expand All @@ -47,7 +49,7 @@ function revokeTribalAccess(email, user_id) {
url: `${API_GOV_URL}/rpc/remove_tribal_api_key_access`,
headers: {
Authorization: `Bearer ${API_GOV_JWT}`,
'X-Api-Key': API_GOV_KEY,
'X-Api-Key': API_GOV_KEY_ADMIN,
'X-Api-User-Id': API_GOV_USER_ID_ADMIN,
'Content-Profile': ADMIN_API_VERSION,
'Content-Type': 'application/json',
Expand Down Expand Up @@ -84,7 +86,7 @@ export function testReportIdFoundWithoutTribalAccess(reportId) {

export function testReportIdFoundWithTribalAccess(reportId) {
const tribal_access_email = `${crypto.randomUUID()}@example.com`;
const tribal_access_user_id = crypto.randomUUID();
const tribal_access_user_id = API_GOV_USER_ID;

grantTribalAccess(tribal_access_email, tribal_access_user_id);

Expand All @@ -110,7 +112,7 @@ export function testReportIdFoundWithTribalAccess(reportId) {

export function testReportIdNotFoundWithTribalAccess(reportId) {
const tribal_access_email = `${crypto.randomUUID()}@example.com`;
const tribal_access_user_id = crypto.randomUUID();
const tribal_access_user_id = API_GOV_USER_ID;

grantTribalAccess(tribal_access_email, tribal_access_user_id);

Expand Down

0 comments on commit 9ee4a66

Please sign in to comment.