Skip to content

Commit

Permalink
Merge remote-tracking branch 'taxCourt/test' into 10426-test
Browse files Browse the repository at this point in the history
  • Loading branch information
John Cruz committed Jul 22, 2024
2 parents 19d1b0b + 0be8535 commit 0314bed
Show file tree
Hide file tree
Showing 474 changed files with 33,605 additions and 3,577 deletions.
5 changes: 4 additions & 1 deletion cypress-public.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from 'cypress';
import { setAllowedTerminalIpAddresses } from './cypress/local-only/support/database';
import { toggleFeatureFlag } from './cypress/helpers/cypressTasks/dynamo/dynamo-helpers';
import fs from 'fs';
import path from 'path';

Expand All @@ -22,9 +23,11 @@ export default defineConfig({
},
table(message) {
console.table(message);

return null;
},
toggleFeatureFlag(args) {
return toggleFeatureFlag(args);
},
});
},
specPattern: [
Expand Down
8 changes: 8 additions & 0 deletions cypress-smoketests.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import {
import {
expireUserConfirmationCode,
getEmailVerificationToken,
getFeatureFlagValue,
getNewAccountVerificationCode,
toggleFeatureFlag,
} from './cypress/helpers/cypressTasks/dynamo/dynamo-helpers';
import { unzipFile } from './cypress/helpers/file/unzip-file';
import { waitForNoce } from './cypress/helpers/cypressTasks/wait-for-noce';
Expand Down Expand Up @@ -69,6 +71,9 @@ export default defineConfig({
getEmailVerificationToken({ email }) {
return getEmailVerificationToken({ email });
},
getFeatureFlagValue({ flag }) {
return getFeatureFlagValue({ flag });
},
getIrsBearerToken({ password, userName }) {
return getIrsBearerToken({
password,
Expand All @@ -87,6 +92,9 @@ export default defineConfig({
}) {
return readAllItemsInBucket({ bucketName, retries });
},
toggleFeatureFlag(args) {
return toggleFeatureFlag(args);
},
unzipFile({ fileName }) {
return unzipFile({ fileName });
},
Expand Down
9 changes: 8 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
import {
expireUserConfirmationCode,
getEmailVerificationToken,
getFeatureFlagValue,
getNewAccountVerificationCode,
toggleFeatureFlag,
} from './cypress/helpers/cypressTasks/dynamo/dynamo-helpers';
import { unzipFile } from './cypress/helpers/file/unzip-file';
import { waitForNoce } from './cypress/helpers/cypressTasks/wait-for-noce';
Expand Down Expand Up @@ -43,14 +45,19 @@ export default defineConfig({
getEmailVerificationToken({ email }) {
return getEmailVerificationToken({ email });
},
getFeatureFlagValue({ flag }) {
return getFeatureFlagValue({ flag });
},
getNewAccountVerificationCode({ email }) {
return getNewAccountVerificationCode({ email });
},
table(message) {
console.table(message);

return null;
},
toggleFeatureFlag(args) {
return toggleFeatureFlag(args);
},
unzipFile({ fileName }) {
return unzipFile({ fileName });
},
Expand Down
43 changes: 43 additions & 0 deletions cypress/helpers/cypressTasks/dynamo/dynamo-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,49 @@ export const expireUserConfirmationCode = async (
return null;
};

export const toggleFeatureFlag = async ({
flag,
flagValue,
}: {
flag: string;
flagValue: any;
}): Promise<null> => {
const dynamoClient = await getDocumentClient();
await dynamoClient.update({
ExpressionAttributeNames: {
'#value': 'current',
},
ExpressionAttributeValues: {
':value': flagValue,
},
Key: {
pk: flag,
sk: flag,
},
TableName: getCypressEnv().dynamoDbTableName,
UpdateExpression: 'SET #value = :value',
});

return null;
};

export const getFeatureFlagValue = async ({
flag,
}: {
flag: string;
}): Promise<boolean> => {
const dynamoClient = await getDocumentClient();
const result = await dynamoClient.get({
Key: {
pk: flag,
sk: flag,
},
TableName: getCypressEnv().dynamoDbDeployTableName,
});

return !!result?.Item?.current;
};

export const getEmailVerificationToken = async ({
email,
}: {
Expand Down
4 changes: 4 additions & 0 deletions cypress/helpers/env/cypressEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export const getCypressEnv = () => {
cognitoEndpoint: env === 'local' ? 'http://localhost:9229/' : undefined,
defaultAccountPass: Cypress.env('DEFAULT_ACCOUNT_PASS') || 'Testing1234$',
deployingColor: Cypress.env('DEPLOYING_COLOR'),
dynamoDbDeployTableName:
Cypress.env('DYNAMODB_DEPLOY_TABLE_NAME') || 'efcms-local',
dynamoDbTableName: Cypress.env('DYNAMODB_TABLE_NAME') || 'efcms-local',
efcmsDomain: Cypress.env('EFCMS_DOMAIN'),
env,
Expand All @@ -26,6 +28,8 @@ export const getCypressEnv = () => {
defaultAccountPass:
process.env.CYPRESS_DEFAULT_ACCOUNT_PASS || 'Testing1234$',
deployingColor: process.env.CYPRESS_DEPLOYING_COLOR,
dynamoDbDeployTableName:
process.env.CYPRESS_DYNAMODB_DEPLOY_TABLE_NAME || 'efcms-local',
dynamoDbTableName: process.env.CYPRESS_DYNAMODB_TABLE_NAME || 'efcms-local',
efcmsDomain: process.env.CYPRESS_EFCMS_DOMAIN,
env,
Expand Down
2 changes: 1 addition & 1 deletion cypress/helpers/file/upload-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export function uploadFile(testId: string) {
cy.get(`[data-testid="${testId}"]`).attachFile(
'../../helpers/file/sample.pdf',
);
cy.get(`[data-testid="${testId}-label"]`).should('have.class', 'validated');
cy.get('[data-testid="upload-file-success"]').should('exist');
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { uploadFile } from '../file/upload-file';

export function petitionerCreatesElectronicCaseUpdated(
primaryFilerName = 'John',
) {
cy.get('[data-testid="file-a-petition"]').click();
cy.get('[data-testid="go-to-step-1"]').click();

cy.get('[data-testid="filing-type-0"]').click();
cy.get('[data-testid="contact-primary-name"]').type(primaryFilerName);
cy.get('[data-testid="contactPrimary.address1"]').type('111 South West St.');
cy.get('[data-testid="contactPrimary.city"]').type('Orlando');
cy.get('[data-testid="contactPrimary.state"]').select('AL');
cy.get('[data-testid="contactPrimary.postalCode"]').type('12345');
cy.get('[data-testid="contactPrimary.placeOfLegalResidence"]').select('AL');
cy.get('[data-testid="contact-primary-phone"]').type('1111111111');
cy.get('[data-testid="step-1-next-button"]').click();

cy.get('[data-testid="petition-reason--1"]').type('First reason goes here');
cy.get('[data-testid="petition-fact--1"]').type('First fact goes here');
cy.get('[data-testid="step-2-next-button"]').click();

cy.get('[data-testid="irs-notice-Yes"]').click();
cy.get('[data-testid="case-type-select"]').select('Notice of Deficiency');
uploadFile('irs-notice-upload-0');
cy.get('[data-testid="redaction-acknowledgement-label"]').click();
cy.get('[data-testid="step-3-next-button"]').click();

cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="step-4-next-button"]').click();

uploadFile('stin-file');
cy.get('[data-testid="step-5-next-button"]').click();

cy.get('[data-testid="atp-preview-button"]').should('exist');
cy.get('[data-testid="stin-preview-button"]').should('exist');

cy.get('[data-testid="step-6-next-button"]').click();

return cy
.get('[data-testid="case-link-docket-number"]')
.invoke('text')
.then(docketNumberWithSuffix => {
cy.get('[data-testid="case-link"]').click();
return cy.wrap<string>(docketNumberWithSuffix);
});
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { petitionerCreatesElectronicCaseUpdated } from './petitioner-creates-electronic-case-updated';
import { uploadFile } from '../file/upload-file';

export function petitionerCreatesElectronicCaseWithDeceasedSpouse(
Expand Down Expand Up @@ -38,7 +39,19 @@ export function petitionerCreatesElectronicCaseWithDeceasedSpouse(
});
}

export function petitionerCreatesElectronicCase(primaryFilerName = 'John') {
export function petitionerCreatesElectronicCase(primaryFilerName: string) {
return cy
.task('getFeatureFlagValue', { flag: 'updated-petition-flow' })
.then(updatedFlow => {
if (updatedFlow) {
return petitionerCreatesElectronicCaseUpdated(primaryFilerName);
} else {
return petitionerCreatesElectronicCaseOld(primaryFilerName);
}
});
}

function petitionerCreatesElectronicCaseOld(primaryFilerName = 'John') {
cy.get('[data-testid="file-a-petition"]').click();
cy.get('[data-testid="go-to-step-1"]').click();
uploadFile('stin-file');
Expand Down Expand Up @@ -79,6 +92,18 @@ export function petitionerCreatesElectronicCase(primaryFilerName = 'John') {
}

export function petitionerCreatesElectronicCaseForBusiness() {
return cy
.task('getFeatureFlagValue', { flag: 'updated-petition-flow' })
.then(updatedFlow => {
if (updatedFlow) {
return petitionerCreatesElectronicCaseForBusinessUpdated();
} else {
return petitionerCreatesElectronicCaseForBusinessOld();
}
});
}

export function petitionerCreatesElectronicCaseForBusinessOld() {
cy.get('[data-testid="file-a-petition"]').click();
cy.get('[data-testid="go-to-step-1"]').click();
uploadFile('stin-file');
Expand Down Expand Up @@ -122,6 +147,49 @@ export function petitionerCreatesElectronicCaseForBusiness() {
});
}

export function petitionerCreatesElectronicCaseForBusinessUpdated() {
cy.get('[data-testid="file-a-petition"]').click();
cy.get('[data-testid="go-to-step-1"]').click();
cy.get('[data-testid="filing-type-2"]').click();
cy.get('#is-business-type-0').click();
cy.get('[data-testid="contact-primary-name"]').type('awd');
cy.get('[data-testid="contactPrimary.address1"]').type('awd');
cy.get('[data-testid="contactPrimary.city"]').type('awd');
cy.get('[data-testid="contactPrimary.state"]').select('AK');
cy.get('[data-testid="contactPrimary.postalCode"]').type('12312');
cy.get('[data-testid="contact-primary-phone"]').type('awd');
uploadFile('corporate-disclosure-file');

cy.get('[data-testid="step-1-next-button"]').click();
cy.get('[data-testid="petition-reason--1"]').type('aws');
cy.get('[data-testid="petition-fact--1"]').type('aws');
cy.get('[data-testid="step-2-next-button"]').click();

cy.get('[data-testid="irs-notice-Yes"]').click();
cy.get('[data-testid="irs-notice-upload-0"]').click();
uploadFile('irs-notice-upload-0');
cy.get('[data-testid="case-type-select"]').select('Deficiency');
cy.get('[data-testid="redaction-acknowledgement-label"]').click();
cy.get('[data-testid="step-3-next-button"]').click();

cy.get('[data-testid="preferred-trial-city"]').select('Birmingham, Alabama');
cy.get('[data-testid="step-4-next-button"]').click();

cy.get('[data-testid="stin-file"]').click();
uploadFile('stin-file');
cy.get('[data-testid="step-5-next-button"]').click();

cy.get('[data-testid="step-6-next-button"]').click();

return cy
.get('[data-testid="case-link-docket-number"]')
.invoke('text')
.then(docketNumberWithSuffix => {
cy.get('[data-testid="case-link"]').click();
return cy.wrap<string>(docketNumberWithSuffix);
});
}

export function privatePractitionerCreatesElectronicCaseForBusiness() {
cy.get('[data-testid="file-a-petition"]').click();
uploadFile('stin-file');
Expand Down
3 changes: 0 additions & 3 deletions cypress/local-only/support/generalCommands/checkA11y.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ export function checkA11y(): void {
{
includedImpacts: impactLevel,
retries: 3,
rules: {
'nested-interactive': { enabled: false }, // https://github.com/flexion/ef-cms/issues/10396
},
},
terminalLog,
);
Expand Down
2 changes: 1 addition & 1 deletion cypress/local-only/support/pages/create-paper-petition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const createPaperPetition = () => {
navigateToDocumentQC('petitionsclerk');

getCreateACaseButton().click();
cy.get('#tab-parties').parent().should('have.attr', 'aria-selected');
cy.get('#tab-parties').should('have.attr', 'aria-selected');

fillInCreateCaseFromPaperForm();
return postPaperPetition();
Expand Down
42 changes: 42 additions & 0 deletions cypress/local-only/support/statusReportOrderResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import {
FORMATS,
formatNow,
} from '../../../shared/src/business/utilities/DateHandler';

export const docketNumber = '107-19';
export const leadCaseDocketNumber = '102-67';
export const statusReportDocketEntryId = '178af2d2-fab1-445a-a729-d3da63517a0a';
export const messages = {
statusReport: {
messageId: '73d4365b-8b3a-4b01-9ca3-7087f7a6d4b5',
name: 'Status Report',
},
testOrderResponseSigned: {
messageId: '32484c7f-4606-49fc-89f1-27ba1d5596be',
name: 'Test Order Response (Signed)',
},
testOrderResponseUnsigned: {
messageId: '34483b5b-29de-4ad4-8caa-59f71ad6d906',
name: 'Test Order Response (Unsigned)',
},
};
export const expectedPdfLines = [
'On June 28, 2024, a status report was filed in this case (Index no. 5). For cause, it is',
`ORDERED that the parties shall file a further status report by ${formatNow(FORMATS.MONTH_DAY_YEAR)}. It is further`,
'ORDERED that this case is stricken from the trial session. It is further',
'ORDERED that jurisdiction is retained by the undersigned. It is further',
'ORDERED that Here is my additional order text.',
];
export const selectAllOptionsInForm = ({
orderName,
}: {
orderName: string;
}) => {
cy.get('#order-type-status-report').check({ force: true });
cy.get('#status-report-due-date-picker').type(formatNow(FORMATS.MMDDYYYY));
cy.get('#stricken-from-trial-sessions').check({ force: true });
cy.get('#jurisdiction-retained').check({ force: true });
cy.get('#additional-order-text').type('Here is my additional order text.');
cy.get('#docket-entry-description').clear();
cy.get('#docket-entry-description').type(orderName);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { checkA11y } from '../../../support/generalCommands/checkA11y';
import { loginAsColvin } from '../../../../helpers/authentication/login-as-helpers';

describe('Status Report Order Response - Judge Accessibility', () => {
beforeEach(() => {
Cypress.session.clearCurrentSessionData();
});

it('should be free of a11y issues', () => {
loginAsColvin();
cy.visit(
'/case-detail/102-67/documents/7be2dea1-4428-4917-a66d-0d474e57ee02/order-response-create?statusReportFilingDate=2024-06-28&statusReportIndex=1',
);
cy.get('[data-testid="save-draft-button"]').should('exist');

checkA11y();
});
});
Loading

0 comments on commit 0314bed

Please sign in to comment.