|
| 1 | +const minimumCff = '# This CITATION.cff file was generated with cffinit.\n# Visit https://bit.ly/cffinit to generate yours today!\n\ncff-version: 1.2.0\ntitle: My Title\nmessage: >-\n If you use this software, please cite it using the\n metadata from this file.\ntype: software\nauthors:\n - {}\n' |
| 2 | + |
| 3 | +describe('Minimum usage', () => { |
| 4 | + it('Visit site, fill minimum information and download', () => { |
| 5 | + // Main screen |
| 6 | + cy.visit('/') |
| 7 | + cy.contains('Generate your citation metadata files with ease') |
| 8 | + cy.get('[data-cy="btn-create"]') |
| 9 | + .click() |
| 10 | + |
| 11 | + // Start screen |
| 12 | + cy.url().should('include', '/start') |
| 13 | + cy.get('[data-cy="input-title"]') |
| 14 | + .type('My Title') |
| 15 | + .should('have.value', 'My Title') |
| 16 | + cy.get('[data-cy="input-message"]') |
| 17 | + .should('have.value', 'If you use this software, please cite it using the metadata from this file.') |
| 18 | + cy.get('[data-cy="btn-next"]') |
| 19 | + .click() |
| 20 | + |
| 21 | + // Author screen |
| 22 | + cy.url().should('include', '/authors') |
| 23 | + cy.get('[data-cy="btn-add-author"]') |
| 24 | + .click() |
| 25 | + cy.get('[data-cy="btn-done"]') |
| 26 | + .click() |
| 27 | + cy.get('[data-cy="btn-next"]') |
| 28 | + .click() |
| 29 | + |
| 30 | + // Finish Minimum screen |
| 31 | + cy.url().should('include', '/finish-minimum') |
| 32 | + cy.get('[data-cy="btn-download"]') |
| 33 | + .click() |
| 34 | + const downloadsFolder = Cypress.config('downloadsFolder') |
| 35 | + const cfffile = `${downloadsFolder}/CITATION.cff` |
| 36 | + |
| 37 | + cy.readFile(cfffile, 'binary', { timeout: 400 }) |
| 38 | + .should(buffer => expect(buffer).to.be.equal(minimumCff)) |
| 39 | + }) |
| 40 | +}) |
0 commit comments