datopian / ckan-integration-tests

Cypress toolkit to run integration tests against a CKAN instance
https://tech.datopian.com/ckan/
MIT License
4 stars 3 forks source link

Remove test for PDF preview #6

Closed higorspinto closed 3 years ago

higorspinto commented 3 years ago

PDF previews require ckanext-pdfview to render the pdf on the browser. To keep the set of tests compatible with CKAN enterprise without any extension, these tests should be removed.

Ex.:

it('Upload PDF and check its preview', () => {
    cy.createDatasetWithoutFile().then((datasetName) => {
      cy.get('#field-image-upload').attachFile({ filePath: 'sample-pdf-with-images.pdf', fileName: 'sample-pdf-with-images.pdf' })
      cy.get('.btn-primary').click()
      cy.location('pathname').should('eq', '/dataset/' + datasetName)
      cy.get('.resource-item > .heading').click()
      // Check if PDF preview exists
      cy.get('.module-content > .nav > .active > a').contains('PDF')
      cy.get('iframe').should('exist')
      cy.deleteDataset(datasetName)
      cy.purgeDataset(datasetName)
    })
})

Acceptance