Skip to content

Commit

Permalink
Merge pull request #5330 from ustaxcourt/staging
Browse files Browse the repository at this point in the history
merge staging into prod
  • Loading branch information
jtdevos authored Sep 8, 2024
2 parents 171593c + 62ebe70 commit 404623a
Show file tree
Hide file tree
Showing 1,220 changed files with 24,137 additions and 21,126 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1
orbs:
git-shallow-clone: guitarrapc/[email protected]

efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:4.3.7
efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:4.3.8

parameters:
run_build_and_deploy:
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Note: node-20.14.0-chrome-125.0.* is debian 12.5 (bookworm)

FROM cypress/browsers:node-20.16.0-chrome-127.0.6533.88-1-ff-128.0.3-edge-127.0.2651.74-1
FROM cypress/browsers:node-20.16.0-chrome-127.0.6533.119-1-ff-129.0.1-edge-127.0.2651.98-1

WORKDIR /home/app

Expand Down Expand Up @@ -37,12 +37,12 @@ RUN apt-get install -y build-essential
RUN apt-get install -y libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.17.30.zip" -o "awscliv2.zip" && \
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.17.36.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf awscliv2.zip

RUN wget -q -O terraform.zip https://releases.hashicorp.com/terraform/1.9.4/terraform_1.9.4_linux_amd64.zip && \
RUN wget -q -O terraform.zip https://releases.hashicorp.com/terraform/1.9.5/terraform_1.9.5_linux_amd64.zip && \
unzip -o terraform.zip terraform && \
rm terraform.zip && \
cp terraform /usr/local/bin/
Expand Down
18 changes: 14 additions & 4 deletions cypress-smoketests.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
deleteAllCypressTestAccounts,
deleteAllIrsCypressTestAccounts,
getIrsBearerToken,
getUserByEmail,
} from './cypress/helpers/cypressTasks/cognito/cognito-helpers';
import { defineConfig } from 'cypress';
import {
Expand Down Expand Up @@ -33,20 +34,26 @@ export default defineConfig({
return confirmUser({ email });
},
createAccount({
irsEnv,
isIrsEnv,
name,
password,
role,
userId,
userName,
}: {
irsEnv: boolean;
userName: string;
password: string;
role: string;
userName: string;
isIrsEnv: boolean;
name: string;
userId: string;
}) {
return createAccount({
isIrsEnv: irsEnv,
isIrsEnv,
name,
password,
role,
userId,
userName,
});
},
Expand Down Expand Up @@ -83,6 +90,9 @@ export default defineConfig({
getNewAccountVerificationCode({ email }) {
return getNewAccountVerificationCode({ email });
},
getUserByEmail(email: string) {
return getUserByEmail(email);
},
readAllItemsInBucket({
bucketName,
retries,
Expand Down
4 changes: 4 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
confirmUser,
deleteAllCypressTestAccounts,
getUserByEmail,
} from './cypress/helpers/cypressTasks/cognito/cognito-helpers';
import { defineConfig } from 'cypress';
import {
Expand Down Expand Up @@ -56,6 +57,9 @@ export default defineConfig({
getNewAccountVerificationCode({ email }) {
return getNewAccountVerificationCode({ email });
},
getUserByEmail(email: string) {
return getUserByEmail(email);
},
table(message) {
console.table(message);
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ import {
} from '../../../helpers/authentication/login-as-helpers';

describe('Advanced Search', () => {
beforeEach(() => {
Cypress.session.clearCurrentSessionData();
});

it('should find a served paper case when the user searches by party name or docket number', () => {
/** Arrange */
loginAsPetitionsClerk1();
createAndServePaperPetition().then(({ docketNumber, name }) => {
/** Act */
cy.get('[data-testid="search-link"]').click();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ROLES } from '../../../../shared/src/business/entities/EntityConstants';
/* eslint-disable promise/no-nesting */
import { assertExists, retry } from '../../../helpers/retry';
import { goToCase } from '../../../helpers/caseDetail/go-to-case';
import {
Expand All @@ -10,29 +10,10 @@ import { petitionsClerkServesPetition } from '../../../helpers/documentQC/petiti
import { uploadFile } from '../../../helpers/file/upload-file';

describe('Document QC Complete', () => {
let CASE_SERVICE_SUPERVISOR_INFO: { userId: string; name: string } =
undefined as unknown as { userId: string; name: string };
let DOCKET_CLERK_INFO: { userId: string; name: string } =
undefined as unknown as { userId: string; name: string };

const docketSectionMessage = 'To CSS under Docket Section';
const petitionsSectionMessage = 'To CSS under Petitions Section';

before(() => {
cy.intercept('GET', '**/users', req => {
req.on('before:response', res => {
if (res.body.role === ROLES.caseServicesSupervisor) {
CASE_SERVICE_SUPERVISOR_INFO = res.body;
}
if (res.body.role === ROLES.docketClerk) {
DOCKET_CLERK_INFO = res.body;
}
});
});

cy.login('caseServicesSupervisor1');
cy.login('docketclerk1');

loginAsPetitioner();
petitionerCreatesElectronicCase().then(docketNumber => {
cy.wrap(docketNumber).as('DOCKET_NUMBER');
Expand All @@ -54,18 +35,22 @@ describe('Document QC Complete', () => {
cy.get<string>('@DOCKET_NUMBER').then(docketNumber => {
loginAsAdmissionsClerk();
goToCase(docketNumber);
cy.task<{ userId: string; name: string; email: string; role: string }>(
'getUserByEmail',
'[email protected]',
).then(caseServiceSupervisorInfo => {
sendMessages(
caseServiceSupervisorInfo.userId,
docketSectionMessage,
'docket',
);

sendMessages(
CASE_SERVICE_SUPERVISOR_INFO.userId,
docketSectionMessage,
'docket',
);

sendMessages(
CASE_SERVICE_SUPERVISOR_INFO.userId,
petitionsSectionMessage,
'petitions',
);
sendMessages(
caseServiceSupervisorInfo.userId,
petitionsSectionMessage,
'petitions',
);
});

retry(() => {
cy.login('caseServicesSupervisor1', '/messages/my/inbox');
Expand Down Expand Up @@ -125,42 +110,49 @@ describe('Document QC Complete', () => {
cy.get(`[data-testid="work-item-${docketNumber}"]`)
.find('[data-testid="checkbox-assign-work-item"]')
.click();

cy.get('[data-testid="dropdown-select-assignee"]').select(
DOCKET_CLERK_INFO.name,
);

retry(() => {
cy.login(
'caseServicesSupervisor1',
'/document-qc/section/inbox/selectedSection?section=docket',
cy.task<{ userId: string; name: string; email: string; role: string }>(
'getUserByEmail',
'[email protected]',
).then(docketClerkInfo => {
cy.get('[data-testid="dropdown-select-assignee"]').select(
docketClerkInfo.name,
);
cy.get('table.usa-table');
return cy.get('body').then(body => {
const workItem = body.find(
`[data-testid="work-item-${docketNumber}"]`,
);
const assigneeName = workItem.find(
'[data-testid="table-column-work-item-assigned-to"]',

retry(() => {
cy.login(
'caseServicesSupervisor1',
'/document-qc/section/inbox/selectedSection?section=docket',
);
const text = assigneeName.text();
return cy.wrap(text.includes(DOCKET_CLERK_INFO.name));
cy.get('table.usa-table');
return cy.get('body').then(body => {
const workItem = body.find(
`[data-testid="work-item-${docketNumber}"]`,
);
const assigneeName = workItem.find(
'[data-testid="table-column-work-item-assigned-to"]',
);
const text = assigneeName.text();
return cy.wrap(text.includes(docketClerkInfo.name));
});
});
});

cy.get(`[data-testid="work-item-${docketNumber}"]`)
.find('.message-document-title')
.find('a')
.click();
cy.get(`[data-testid="work-item-${docketNumber}"]`)
.find('.message-document-title')
.find('a')
.click();

cy.get('#save-and-finish').click();
cy.get('#save-and-finish').click();

cy.get('[data-testid="success-alert"]').should('contain', 'QC Completed');
cy.get('[data-testid="success-alert"]').should(
'contain',
'QC Completed',
);

cy.visit('/document-qc/my/outbox');
cy.get(`[data-testid="section-work-item-outbox-${docketNumber}"]`).should(
'exist',
);
cy.visit('/document-qc/my/outbox');
cy.get(
`[data-testid="section-work-item-outbox-${docketNumber}"]`,
).should('exist');
});
});
});

Expand All @@ -181,9 +173,14 @@ describe('Document QC Complete', () => {
.find('[data-testid="checkbox-assign-work-item"]')
.click();

cy.get('[data-testid="dropdown-select-assignee"]').select(
CASE_SERVICE_SUPERVISOR_INFO.name,
);
cy.task<{ userId: string; name: string; email: string; role: string }>(
'getUserByEmail',
'[email protected]',
).then(caseServiceSupervisorInfo => {
cy.get('[data-testid="dropdown-select-assignee"]').select(
caseServiceSupervisorInfo.name,
);
});

cy.visit('/document-qc/my/inbox');
cy.get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { getCypressEnv } from '../../../helpers/env/cypressEnvironment';
import { loginAsPetitioner } from '../../../helpers/authentication/login-as-helpers';
import { petitionerCreatesElectronicCase } from '../../../helpers/fileAPetition/petitioner-creates-electronic-case';
import { petitionsClerkQcsAndServesElectronicCase } from '../../../helpers/documentQC/petitions-clerk-qcs-and-serves-electronic-case';
import { v4 } from 'uuid';

if (!Cypress.env('SMOKETESTS_LOCAL')) {
describe('irs superuser integration', () => {
Expand All @@ -20,9 +21,11 @@ if (!Cypress.env('SMOKETESTS_LOCAL')) {

it('should let an irs superuser view the reconciliation report and download a STIN', () => {
cy.task('createAccount', {
irsEnv: true,
isIrsEnv: true,
name: 'irsSuperUser CI/CD',
password,
role: ROLES.irsSuperuser,
userId: v4(),
userName,
});

Expand Down
34 changes: 30 additions & 4 deletions cypress/helpers/authentication/login-as-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { getCypressEnv } from '../env/cypressEnvironment';

export function loginAsTestAdmissionsClerk() {
cy.login('testAdmissionsClerk');
cy.get('#inbox-tab-content').should('exist');
Expand Down Expand Up @@ -35,8 +37,6 @@ export function loginAsPrivatePractitioner(
cy.login(practitionerUser);
cy.get('[data-testid="file-a-petition"]').should('exist');
cy.get('[data-testid="search-for-a-case-card"]').should('exist');
cy.get('[data-testid="open-cases-count"]').contains('Open Cases');
cy.get('[data-testid="closed-cases-count"]').contains('Closed Cases');
}

export function loginAsIrsPractitioner(
Expand All @@ -59,7 +59,11 @@ export function loginAsIrsPractitioner1() {
}

export function loginAsPetitioner(
petitionerUser: 'petitioner' | 'petitioner1' | 'petitioner7' = 'petitioner1',
petitionerUser:
| 'petitioner'
| 'petitioner1'
| 'petitioner2'
| 'petitioner7' = 'petitioner1',
) {
cy.login(petitionerUser);
cy.get('[data-testid="file-a-petition"]').should('exist');
Expand All @@ -76,7 +80,7 @@ export function loginAsPetitionsClerk() {
}

export function loginAsPetitionsClerk1() {
cy.login('petitionsclerk1');
login({ email: 'petitionsclerk1@example.com' });
cy.get('[data-testid="inbox-tab-content"]').should('exist');
}

Expand Down Expand Up @@ -119,3 +123,25 @@ export function loginAsIrsSuperUser() {
cy.login('irssuperuser');
cy.get('[data-testid="advanced-search-link"]').should('exist');
}

// We created this new login function because our current login function was too generically
// waiting for the account menu button, resulting in visiting a route before the page was fully loaded.
// We need to deprecate usage of cy.login and have all tests login through helper functions so we properly await
function login({ email }: { email: string }) {
cy.clearAllCookies();
cy.visit('/login');
cy.get('[data-testid="email-input"]').type(email);
cy.get('[data-testid="password-input"]').type(
getCypressEnv().defaultAccountPass,
);
cy.get('[data-testid="login-button"]').click();
cy.window().then(win =>
win.localStorage.setItem('__cypressOrderInSameTab', 'true'),
);
cy.intercept('GET', 'https://**/dynamsoft.webtwain.initiate.js', {
body: `window.Dynamsoft = {DWT: {
GetWebTwain() {}
}}`,
statusCode: 200,
});
}
Loading

0 comments on commit 404623a

Please sign in to comment.