Skip to content

Commit

Permalink
AT: district ell downloadable reports
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmcdermid committed Aug 19, 2024
1 parent 6427e16 commit 407e5dc
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
52 changes: 52 additions & 0 deletions tests-e2e/cypress/e2e/sdc-district-collection/summaryReports.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,58 @@ describe('SDC District Collection View', () => {
});
beforeEach(() => cy.login());

it('can download Eligible English Language Learning Program Headcount', () => {
cy.intercept('/api/sdc/sdcSchoolCollectionStudent/getDistrictHeadcounts/*?type=ell&compare=false').as('tableLoaded');
cy.visit('/open-district-collection-details/' + Cypress.env('sdcDistrictCollectionID'));
cy.get(selectors.studentLevelData.stepThree).should('exist').should('have.class', 'v-stepper-item--selected');
cy.get(selectors.stepThreeTabSlider.englishLanguageLearningButton).should('exist').click();
cy.get(selectors.ellComponent.summaryButton).should('exist').click();

cy.get('#reports').parent().click();
cy.get(selectors.dropdown.listItem).contains('Eligible English Language Learners Headcount for District').click();
cy.wait('@tableLoaded');
cy.get(selectors.ellComponent.headcountReportDis).should('be.visible');

cy.get(selectors.studentLevelData.pdfDownloadLink).then(($link) => {
const href = $link.prop('href');
const downloadPath = 'path/to/download/directory/ellDis.pdf';

cy.downloadFile(href, 'path/to/download/directory', 'ellDis.pdf').then(() => {
cy.readFile(downloadPath, 'binary').should((data) => {
expect(data).to.not.be.empty;
const expectedSizeBytes = 244045;
expect(data.length).to.be.closeTo(expectedSizeBytes, 10240);
});
});
});
});

it('can download Eligible English Language Learning Program Headcount per School', () => {
cy.intercept('/api/sdc/sdcSchoolCollectionStudent/getDistrictHeadcounts/*?type=ell-per-school&compare=false').as('tableLoaded');
cy.visit('/open-district-collection-details/' + Cypress.env('sdcDistrictCollectionID'));
cy.get(selectors.studentLevelData.stepThree).should('exist').should('have.class', 'v-stepper-item--selected');
cy.get(selectors.stepThreeTabSlider.englishLanguageLearningButton).should('exist').click();
cy.get(selectors.ellComponent.summaryButton).should('exist').click();

cy.get('#reports').parent().click();
cy.get(selectors.dropdown.listItem).contains('Eligible English Language Learners Headcount per school').click();
cy.wait('@tableLoaded');
cy.get(selectors.ellComponent.headcountReportPerSchool).should('be.visible');

cy.get(selectors.studentLevelData.pdfDownloadLink).then(($link) => {
const href = $link.prop('href');
const downloadPath = 'path/to/download/directory/ellDisPerSchool.pdf';

cy.downloadFile(href, 'path/to/download/directory', 'ellDisPerSchool.pdf').then(() => {
cy.readFile(downloadPath, 'binary').should((data) => {
expect(data).to.not.be.empty;
const expectedSizeBytes = 244045;
expect(data.length).to.be.closeTo(expectedSizeBytes, 10240);
});
});
});
});

it('can view Eligible Enrolment & Eligible FTE report', () => {
cy.visit('/open-district-collection-details/' + Cypress.env('sdcDistrictCollectionID'));
cy.get(selectors.studentLevelData.stepThree).should('exist').should('have.class', 'v-stepper-item--selected');
Expand Down
4 changes: 3 additions & 1 deletion tests-e2e/cypress/support/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ export default {
summaryButton: '#engLangSummaryButton',
headcountCard: '.ell-headcount-card',
headcountHeader: '.ell-headcount-header',
headcountColumnData: '.ell-headcount-column-data'
headcountColumnData: '.ell-headcount-column-data',
headcountReportDis: '#eligELLHeadcountForDistrict',
headcountReportPerSchool: '#eligELLHeadcountPerSchool',
},
frenchComponent: {
tab: '#frenchTab',
Expand Down

0 comments on commit 407e5dc

Please sign in to comment.