Skip to content

Commit

Permalink
fix(test): add "0" if hours or minutes are just 1 character to meet t…
Browse files Browse the repository at this point in the history
…he file names correctly (#657)

Signed-off-by: Florian Steffens <[email protected]>
(cherry picked from commit 6c0034d)
  • Loading branch information
Florian committed Nov 9, 2023
1 parent 4f75d28 commit 48295bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cypress/e2e/tables-export-csv.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ describe('Import csv', () => {
it('Export csv', () => {
cy.loadTable('Tutorial')
cy.clickOnTableThreeDotMenu('Export as CSV')
const time = new Date()
const fileName = new Date().toISOString().slice(2, 10) + '_' + time.getHours() + '-' + time.getMinutes() + '_' + 'Tutorial.csv'
const hour = new Date().getHours().toString().length < 2 ? '0' + new Date().getHours() : new Date().getHours().toString()
const minutes = new Date().getMinutes().toString().length < 2 ? '0' + new Date().getMinutes() : new Date().getMinutes().toString()
const date = new Date().toISOString().slice(2, 10)
const fileName = date + '_' + hour + '-' + minutes + '_' + 'Tutorial.csv'
cy.log('filename: ' + fileName)
cy.readFile('cypress/downloads/' + fileName).should('contain', 'What,How to do,Ease of use,Done')
cy.readFile('cypress/downloads/' + fileName).should('contain', 'Open the tables app,Click on tables icon in the menu bar.,5,true')
Expand Down

0 comments on commit 48295bf

Please sign in to comment.