Skip to content

Commit

Permalink
Merge pull request #1291 from fecgov/release/sprint-28
Browse files Browse the repository at this point in the history
Release/sprint 28
  • Loading branch information
mjtravers authored Aug 4, 2023
2 parents 84fea50 + b15e0b3 commit 7393805
Show file tree
Hide file tree
Showing 446 changed files with 4,449 additions and 6,655 deletions.
9 changes: 5 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ jobs:
steps:
- checkout

- browser-tools/install-chrome
- browser-tools/install-chrome:
chrome-version: "114.0.5735.90"
- browser-tools/install-chromedriver
- run:
command: |
Expand Down Expand Up @@ -284,17 +285,17 @@ parameters:
default: false

workflows:
test:
primary:
when:
not: << pipeline.parameters.is-nightly-run >>
jobs:
- lint
- test
# - dependency-check
- dependency-check
- deploy:
requires:
- test
# - dependency-check
- dependency-check

nightly-run:
when: << pipeline.parameters.is-nightly-run >>
Expand Down
1 change: 1 addition & 0 deletions deploy-config/fecfile-web-app-dev-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ applications:
instances: 2
memory: 128M
buildpack: https://github.com/cloudfoundry/nginx-buildpack.git
stack: cflinuxfs4

routes:
- route: fecfile-web-app-dev.app.cloud.gov
Expand Down
1 change: 1 addition & 0 deletions deploy-config/fecfile-web-app-prod-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ applications:
instances: 2
memory: 128M
buildpack: https://github.com/cloudfoundry/nginx-buildpack.git
stack: cflinuxfs4

routes:
- route: fecfile-web-app-prod.app.cloud.gov
Expand Down
1 change: 1 addition & 0 deletions deploy-config/fecfile-web-app-stage-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ applications:
instances: 2
memory: 128M
buildpack: https://github.com/cloudfoundry/nginx-buildpack.git
stack: cflinuxfs4

routes:
- route: fecfile-web-app-stage.app.cloud.gov
Expand Down
4 changes: 2 additions & 2 deletions front-end/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as fs from 'fs';
export default defineConfig({
defaultCommandTimeout: 10000,
projectId: 'x5egpz',
video: false,
videosFolder: 'cypress/videos',
screenshotsFolder: 'cypress/screenshots',
screenshotOnRunFailure: true,
Expand Down Expand Up @@ -45,7 +46,6 @@ export default defineConfig({
});
return require('./cypress/plugins/index.ts')(on, config);
},
baseUrl: 'http://localhost:4200',
experimentalSessionAndOrigin: true,
baseUrl: 'http://localhost:4200'
},
});
10 changes: 3 additions & 7 deletions front-end/cypress/e2e/pages/contactListPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,13 @@ export class ContactListPage {
if (formData['contact_type'] == 'Candidate') {
cy.get(alias).find('#candidate_id').safeType(formData['candidate_id']);

PageUtils.dropdownSetValue("p-dropdown[formcontrolname='candidate_office']", formData['candidate_office'], alias);
PageUtils.dropdownSetValue("p-dropdown[inputid='candidate_office']", formData['candidate_office'], alias);

if (formData['candidate_office'] != 'Presidential') {
PageUtils.dropdownSetValue("p-dropdown[formcontrolname='candidate_state']", formData['candidate_state'], alias);
PageUtils.dropdownSetValue("p-dropdown[inputid='candidate_state']", formData['candidate_state'], alias);

if (formData['candidate_office'] == 'House') {
PageUtils.dropdownSetValue(
"p-dropdown[formcontrolname='candidate_district']",
formData['candidate_district'],
alias
);
PageUtils.dropdownSetValue("p-dropdown[inputid='candidate_district']", formData['candidate_district'], alias);
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions front-end/cypress/e2e/pages/f3xTransactionListPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,16 @@ export class TransactionListPage {
cy.contains('button', menuItem).click();
}
}

export enum TransactionTableColumns {
line_number = 0,
transaction_type = 1,
name = 2,
date = 3,
memo_code = 4,
amount = 5,
aggregate = 6,
transaction_id = 7,
parent_id = 8,
actions = 9,
}
4 changes: 3 additions & 1 deletion front-end/cypress/e2e/pages/profileAccountPage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export class ProfileAccountPage {
static goToPage() {
cy.intercept('/profile').as('account');
cy.visit('/dashboard');
cy.get('.p-menubar').find('.p-menuitem-link').contains('Profile').click();
cy.get('.p-menubar').find('.p-menuitem-link > span > .header-navbar-icon[alt="Profile"]').click();
cy.get('[href="/profile/account"]').click();
cy.location('pathname').should('include', '/account');
}
}
3 changes: 2 additions & 1 deletion front-end/cypress/e2e/pages/profileUserListPage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export class ProfileUserListPage {
static goToPage() {
cy.visit('/dashboard');
cy.get('.p-menubar').find('.p-menuitem-link').contains('Profile').click();
cy.get('.p-menubar').find('.p-menuitem-link > span > .header-navbar-icon[alt="Profile"]').click();
cy.get('[href="/committee/users"]').click();
cy.location('pathname').should('include', '/users');
}
}
2 changes: 1 addition & 1 deletion front-end/cypress/e2e/profile.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Manage profile', () => {
LoginPage.login();
});

xit('Can view the Account Info page', () => {
it('Can view the Account Info page', () => {
ProfileAccountPage.goToPage();
cy.runLighthouse('profile', 'account-info');

Expand Down
128 changes: 68 additions & 60 deletions front-end/cypress/e2e/reports-f3x-transactions.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ContactListPage, defaultFormData as defaultContactFormData } from './pages/contactListPage';
import { defaultFormData as defaultReportFormData, F3xCreateReportPage } from './pages/f3xCreateReportPage';
import { TransactionTableColumns } from './pages/f3xTransactionListPage';
import { LoginPage } from './pages/loginPage';
import { PageUtils } from './pages/pageUtils';
import { ReportListPage } from './pages/reportListPage';
Expand Down Expand Up @@ -152,7 +153,7 @@ describe('Transactions', () => {
...{ purpose_description: '' },
};
TransactionDetailPage.enterFormData(formTransactionData);
PageUtils.dropdownSetValue('[data-test="navigation-control-dropdown"]', 'Partnership Memo');
PageUtils.dropdownSetValue('[data-test="navigation-control-dropdown"]', 'Partnership Attribution');
cy.contains('Confirm').should('exist');
PageUtils.clickButton('Continue');

Expand All @@ -172,8 +173,8 @@ describe('Transactions', () => {

// Create a second memo transaction so we can check the aggregate value
PageUtils.clickLink('Partnership Receipt');
PageUtils.dropdownSetValue('[data-test="navigation-control-dropdown"]', 'Partnership Memo');
cy.contains('Partnership Memo').wait(500);
PageUtils.dropdownSetValue('[data-test="navigation-control-dropdown"]', 'Partnership Attribution');
cy.contains('Partnership Attribution').wait(500);
cy.get('[role="searchbox"]').type(defaultContactFormData['last_name'].slice(0, 1));
cy.contains(defaultContactFormData['last_name']).should('exist');
cy.contains(defaultContactFormData['last_name']).click();
Expand All @@ -182,22 +183,28 @@ describe('Transactions', () => {

// Assert transaction list table is correct
cy.get('tbody tr').eq(0).as('row-1');
cy.get('@row-1').find('td').eq(0).should('contain', 'Partnership Memo');
cy.get('@row-1').find('td').eq(0).should('not.contain', 'Unitemized');
cy.get('@row-1').find('td').eq(3).should('contain', 'Y');
cy.get('@row-1').find('td').eq(5).should('contain', '$201.10');
cy.get('@row-1')
.find('td')
.eq(TransactionTableColumns.transaction_type)
.should('contain', 'Partnership Attribution');
cy.get('@row-1').find('td').eq(TransactionTableColumns.transaction_type).should('not.contain', 'Unitemized');
cy.get('@row-1').find('td').eq(TransactionTableColumns.memo_code).should('contain', 'Y');
cy.get('@row-1').find('td').eq(TransactionTableColumns.aggregate).should('contain', '$201.10');

cy.get('tbody tr').eq(1).as('row-2');
cy.get('@row-2').find('td').eq(0).should('contain', 'Partnership Memo');
cy.get('@row-2').find('td').eq(0).should('contain', 'Unitemized');
cy.get('@row-2').find('td').eq(3).should('contain', 'Y');
cy.get('@row-2').find('td').eq(5).should('contain', '$100.55');
cy.get('@row-2').find('td').eq(TransactionTableColumns.transaction_type).should('contain', 'Partnership Receipt');
cy.get('@row-2').find('td').eq(TransactionTableColumns.transaction_type).should('contain', 'Unitemized');
cy.get('@row-2').find('td').eq(TransactionTableColumns.memo_code).should('not.contain', 'Y');
cy.get('@row-2').find('td').eq(TransactionTableColumns.aggregate).should('contain', '$100.55');

cy.get('tbody tr').eq(2).as('row-3');
cy.get('@row-3').find('td').eq(0).should('contain', 'Partnership Receipt');
cy.get('@row-3').find('td').eq(0).should('contain', 'Unitemized');
cy.get('@row-3').find('td').eq(3).should('not.contain', 'Y');
cy.get('@row-3').find('td').eq(5).should('contain', '$100.55');
cy.get('@row-3')
.find('td')
.eq(TransactionTableColumns.transaction_type)
.should('contain', 'Partnership Attribution');
cy.get('@row-3').find('td').eq(TransactionTableColumns.transaction_type).should('contain', 'Unitemized');
cy.get('@row-3').find('td').eq(TransactionTableColumns.memo_code).should('contain', 'Y');
cy.get('@row-3').find('td').eq(TransactionTableColumns.aggregate).should('contain', '$100.55');

// Check form values of receipt form
PageUtils.clickLink('Partnership Receipt');
Expand All @@ -211,7 +218,7 @@ describe('Transactions', () => {
PageUtils.clickButton('Cancel');

// Check form values of memo form
cy.get('tbody tr').first().contains('a', 'Partnership Memo').click();
cy.get('tbody tr').first().contains('a', 'Partnership Attribution').click();
cy.get('#entity_type_dropdown > div.p-disabled').should('exist');
cy.get('#entity_type_dropdown').should('contain', 'Individual');
ContactListPage.assertFormData(defaultContactFormData, true);
Expand Down Expand Up @@ -276,11 +283,6 @@ describe('Transactions', () => {

const transactionFormData = {
...defaultTransactionFormData,
...{
electionType: 'General',
electionYear: 2024,
election_other_description: PageUtils.randomString(10),
},
};
TransactionDetailPage.enterFormData(transactionFormData);
PageUtils.clickButton('Save');
Expand Down Expand Up @@ -356,7 +358,6 @@ describe('Transactions', () => {
PageUtils.clickLink('Earmark Receipt');

// Enter STEP ONE transaction
PageUtils.clickLink('STEP ONE');
cy.get('p-accordiontab').first().as('stepOneAccordion');
PageUtils.clickLink('Create a new contact', '@stepOneAccordion');
ContactListPage.enterFormData(defaultContactFormData, true, '@stepOneAccordion');
Expand Down Expand Up @@ -386,23 +387,22 @@ describe('Transactions', () => {

// Assert transaction list table is correct
cy.get('tbody tr').eq(0).as('row-1');
cy.get('@row-1').find('td').eq(0).should('contain', 'Earmark Memo');
cy.get('@row-1').find('td').eq(1).should('contain', defaultContactFormData['name']);
cy.get('@row-1').find('td').eq(3).should('contain', 'Y');
cy.get('@row-1').find('td').eq(5).should('contain', '$100.55');

cy.get('tbody tr').eq(1).as('row-2');
cy.get('@row-2').find('td').eq(0).should('contain', 'Earmark Receipt');
cy.get('@row-2')
cy.get('@row-1').find('td').eq(TransactionTableColumns.transaction_type).should('contain', 'Earmark Receipt');
cy.get('@row-1')
.find('td')
.eq(1)
.eq(TransactionTableColumns.name)
.should('contain', `${defaultContactFormData['last_name']}, ${defaultContactFormData['first_name']}`);
cy.get('@row-2').find('td').eq(3).should('not.contain', 'Y');
cy.get('@row-2').find('td').eq(5).should('contain', '$100.55');
cy.get('@row-1').find('td').eq(TransactionTableColumns.memo_code).should('not.contain', 'Y');
cy.get('@row-1').find('td').eq(TransactionTableColumns.aggregate).should('contain', '$100.55');

cy.get('tbody tr').eq(1).as('row-2');
cy.get('@row-2').find('td').eq(TransactionTableColumns.transaction_type).should('contain', 'Earmark Memo');
cy.get('@row-2').find('td').eq(TransactionTableColumns.name).should('contain', defaultContactFormData['name']);
cy.get('@row-2').find('td').eq(TransactionTableColumns.memo_code).should('contain', 'Y');
cy.get('@row-2').find('td').eq(TransactionTableColumns.aggregate).should('contain', '$100.55');

// Check form values of receipt edit form
PageUtils.clickLink('Earmark Receipt');
PageUtils.clickLink('STEP ONE');
cy.get('@stepOneAccordion').find('#entity_type_dropdown > div.p-disabled').should('exist');
cy.get('@stepOneAccordion').find('#entity_type_dropdown').should('contain', 'Individual');
ContactListPage.assertFormData(defaultContactFormData, true, '@stepOneAccordion');
Expand Down Expand Up @@ -438,7 +438,6 @@ describe('Transactions', () => {
PageUtils.clickLink('PAC Earmark Receipt');

// Enter STEP ONE transaction
PageUtils.clickLink('STEP ONE');
cy.get('p-accordiontab').first().as('stepOneAccordion');
PageUtils.clickLink('Create a new contact', '@stepOneAccordion');
const stepOneContactFormData = { ...defaultContactFormData, ...{ contact_type: 'Committee' } };
Expand Down Expand Up @@ -470,19 +469,19 @@ describe('Transactions', () => {

// Assert transaction list table is correct
cy.get('tbody tr').eq(0).as('row-1');
cy.get('@row-1').find('td').eq(0).should('contain', 'PAC Earmark Memo');
cy.get('@row-1')
.find('td')
.eq(1)
.should('contain', `${stepOneContactFormData['last_name']}, ${stepOneContactFormData['first_name']}`);
cy.get('@row-1').find('td').eq(3).should('contain', 'Y');
cy.get('@row-1').find('td').eq(5).should('contain', '$100.55');
cy.get('@row-1').find('td').eq(TransactionTableColumns.transaction_type).should('contain', 'PAC Earmark Receipt');
cy.get('@row-1').find('td').eq(TransactionTableColumns.name).should('contain', defaultContactFormData['name']);
cy.get('@row-1').find('td').eq(TransactionTableColumns.memo_code).should('not.contain', 'Y');
cy.get('@row-1').find('td').eq(TransactionTableColumns.aggregate).should('contain', '$100.55');

cy.get('tbody tr').eq(1).as('row-2');
cy.get('@row-2').find('td').eq(0).should('contain', 'PAC Earmark Receipt');
cy.get('@row-2').find('td').eq(1).should('contain', defaultContactFormData['name']);
cy.get('@row-2').find('td').eq(3).should('not.contain', 'Y');
cy.get('@row-2').find('td').eq(5).should('contain', '$100.55');
cy.get('@row-2').find('td').eq(TransactionTableColumns.transaction_type).should('contain', 'PAC Earmark Memo');
cy.get('@row-2')
.find('td')
.eq(TransactionTableColumns.name)
.should('contain', `${stepOneContactFormData['last_name']}, ${stepOneContactFormData['first_name']}`);
cy.get('@row-2').find('td').eq(TransactionTableColumns.memo_code).should('contain', 'Y');
cy.get('@row-2').find('td').eq(TransactionTableColumns.aggregate).should('contain', '$100.55');

// Check form values of receipt edit form
PageUtils.clickLink('PAC Earmark Receipt');
Expand Down Expand Up @@ -555,7 +554,7 @@ describe('Transactions', () => {
...{ purpose_description: '' },
};
TransactionDetailPage.enterFormData(tier2TransactionData);
PageUtils.dropdownSetValue('[data-test="navigation-control-dropdown"]', 'Partnership Individual');
PageUtils.dropdownSetValue('[data-test="navigation-control-dropdown"]', 'Individual');
cy.contains('Confirm').should('exist');
PageUtils.clickButton('Continue');

Expand All @@ -579,23 +578,32 @@ describe('Transactions', () => {

// Assert transaction list table is correct
cy.get('tbody tr').eq(0).as('row-1');
cy.get('@row-1').find('td').eq(0).should('contain', 'Partnership Individual Joint Fundraising Transfer Memo');
cy.get('@row-1').find('td').eq(0).should('contain', 'Unitemized');
cy.get('@row-1').find('td').eq(3).should('contain', 'Y');
cy.get('@row-1').find('td').eq(5).should('contain', '$100.55');
cy.get('@row-1')
.find('td')
.as('joint_fundraising_transfer_link')
.eq(TransactionTableColumns.transaction_type)
.should('contain', 'Joint Fundraising Transfer');
cy.get('@row-1').find('td').eq(TransactionTableColumns.transaction_type).should('not.contain', 'Unitemized');
cy.get('@row-1').find('td').eq(TransactionTableColumns.memo_code).should('not.contain', 'Y');
cy.get('@row-1').find('td').eq(TransactionTableColumns.aggregate).should('contain', '$100.55');

cy.get('tbody tr').eq(1).as('row-2');
cy.get('@row-2').find('td').eq(0).should('contain', 'Partnership Receipt Joint Fundraising Transfer Memo');
cy.get('@row-2').find('td').eq(0).should('contain', 'Unitemized');
cy.get('@row-2').find('td').eq(3).should('contain', 'Y');
cy.get('@row-2').find('td').eq(5).should('contain', '$100.55');
cy.get('@row-2')
.find('td')
.eq(TransactionTableColumns.transaction_type)
.should('contain', 'Partnership Receipt Joint Fundraising Transfer Memo');
cy.get('@row-2').find('td').eq(TransactionTableColumns.transaction_type).should('contain', 'Unitemized');
cy.get('@row-2').find('td').eq(TransactionTableColumns.memo_code).should('contain', 'Y');
cy.get('@row-2').find('td').eq(TransactionTableColumns.aggregate).should('contain', '$100.55');

cy.get('tbody tr').eq(2).as('row-3');
cy.get('@row-3').find('td').as('joint_fundraising_transfer_link').eq(
0).should('contain', 'Joint Fundraising Transfer');
cy.get('@row-3').find('td').eq(0).should('not.contain', 'Unitemized');
cy.get('@row-3').find('td').eq(3).should('not.contain', 'Y');
cy.get('@row-3').find('td').eq(5).should('contain', '$100.55');
cy.get('@row-3')
.find('td')
.eq(TransactionTableColumns.transaction_type)
.should('contain', 'Individual Joint Fundraising Transfer Memo');
cy.get('@row-3').find('td').eq(TransactionTableColumns.transaction_type).should('not.contain', 'Unitemized');
cy.get('@row-3').find('td').eq(TransactionTableColumns.memo_code).should('contain', 'Y');
cy.get('@row-3').find('td').eq(TransactionTableColumns.aggregate).should('contain', '$100.55');

// Check form values of receipt form
PageUtils.clickLink('Joint Fundraising Transfer', '@joint_fundraising_transfer_link');
Expand Down
2 changes: 1 addition & 1 deletion front-end/cypress/e2e/reports-f3x.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('Manage reports', () => {
cy.get('app-error-messages[fieldname="coverage_through_date"]').should('contain', errorMessage);
});

it('Create report with previous existing report types disabled', () => {
xit('Create report with previous existing report types disabled', () => {
// Create report #1
ReportListPage.clickCreateButton();
const formData = { ...defaultFormData };
Expand Down
3 changes: 2 additions & 1 deletion front-end/cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"include": ["**/*.ts"],
"compilerOptions": {
"sourceMap": false,
"types": ["cypress"]
"types": ["cypress"],
"target": "ES6"
}
}
Loading

0 comments on commit 7393805

Please sign in to comment.