Skip to content

Commit c3d937b

Browse files
committed
Add test for xlsx table export verification
1 parent 8ac12ca commit c3d937b

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

cypress/e2e/cps-table.cy.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const path = require('path');
2+
3+
describe('cps-table page', () => {
4+
describe('export to xlsx', () => {
5+
beforeEach(() => {
6+
cy.visit('/table');
7+
});
8+
9+
it('should properly download valid xlsx', () => {
10+
cy.contains('Table 6').click({ force: true });
11+
cy.get('.cps-table-tbar-export-btn cps-icon').click();
12+
cy.contains('XLSX').click();
13+
14+
const downloadsFolder = Cypress.config('downloadsFolder');
15+
const downloadedFilePath = path.join(downloadsFolder, 'table_6.xlsx');
16+
cy.readFile(downloadedFilePath).should('exist');
17+
18+
cy.fixture('table_6_fixture.xlsx').then((fixtureContent) => {
19+
cy.readFile(downloadedFilePath).then((downloadedFileContent) => {
20+
expect(downloadedFileContent).equals(fixtureContent);
21+
});
22+
});
23+
});
24+
});
25+
});
21 KB
Binary file not shown.

0 commit comments

Comments
 (0)