|
| 1 | +import { testA11y } from 'cypress/support/utils'; |
| 2 | + |
| 3 | +const COLLECTION_EDIT_PAGE = '/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('/edit'); |
| 4 | + |
| 5 | +beforeEach(() => { |
| 6 | + // All tests start with visiting the Edit Collection Page |
| 7 | + cy.visit(COLLECTION_EDIT_PAGE); |
| 8 | + |
| 9 | + // This page is restricted, so we will be shown the login form. Fill it out & submit. |
| 10 | + cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); |
| 11 | +}); |
| 12 | + |
| 13 | +describe('Edit Collection > Edit Metadata tab', () => { |
| 14 | + it('should pass accessibility tests', () => { |
| 15 | + // <ds-edit-collection> tag must be loaded |
| 16 | + cy.get('ds-edit-collection').should('be.visible'); |
| 17 | + |
| 18 | + // Analyze <ds-edit-collection> for accessibility issues |
| 19 | + testA11y('ds-edit-collection'); |
| 20 | + }); |
| 21 | +}); |
| 22 | + |
| 23 | +describe('Edit Collection > Assign Roles tab', () => { |
| 24 | + |
| 25 | + it('should pass accessibility tests', () => { |
| 26 | + cy.get('a[data-test="roles"]').click(); |
| 27 | + |
| 28 | + // <ds-collection-roles> tag must be loaded |
| 29 | + cy.get('ds-collection-roles').should('be.visible'); |
| 30 | + |
| 31 | + // Analyze for accessibility issues |
| 32 | + testA11y('ds-collection-roles'); |
| 33 | + }); |
| 34 | +}); |
| 35 | + |
| 36 | +describe('Edit Collection > Curate tab', () => { |
| 37 | + |
| 38 | + it('should pass accessibility tests', () => { |
| 39 | + cy.get('a[data-test="curate"]').click(); |
| 40 | + |
| 41 | + // <ds-collection-curate> tag must be loaded |
| 42 | + cy.get('ds-collection-curate').should('be.visible'); |
| 43 | + |
| 44 | + // Analyze for accessibility issues |
| 45 | + testA11y('ds-collection-curate'); |
| 46 | + }); |
| 47 | +}); |
| 48 | + |
| 49 | +describe('Edit Collection > Access Control tab', () => { |
| 50 | + |
| 51 | + it('should pass accessibility tests', () => { |
| 52 | + cy.get('a[data-test="access-control"]').click(); |
| 53 | + |
| 54 | + // <ds-collection-access-control> tag must be loaded |
| 55 | + cy.get('ds-collection-access-control').should('be.visible'); |
| 56 | + |
| 57 | + // Analyze for accessibility issues |
| 58 | + testA11y('ds-collection-access-control'); |
| 59 | + }); |
| 60 | +}); |
| 61 | + |
| 62 | +describe('Edit Collection > Authorizations tab', () => { |
| 63 | + |
| 64 | + it('should pass accessibility tests', () => { |
| 65 | + cy.get('a[data-test="authorizations"]').click(); |
| 66 | + |
| 67 | + // <ds-collection-authorizations> tag must be loaded |
| 68 | + cy.get('ds-collection-authorizations').should('be.visible'); |
| 69 | + |
| 70 | + // Analyze for accessibility issues |
| 71 | + testA11y('ds-collection-authorizations'); |
| 72 | + }); |
| 73 | +}); |
| 74 | + |
| 75 | +describe('Edit Collection > Delete page', () => { |
| 76 | + |
| 77 | + it('should pass accessibility tests', () => { |
| 78 | + cy.get('a[data-test="delete-button"]').click(); |
| 79 | + |
| 80 | + // <ds-delete-collection> tag must be loaded |
| 81 | + cy.get('ds-delete-collection').should('be.visible'); |
| 82 | + |
| 83 | + // Analyze for accessibility issues |
| 84 | + testA11y('ds-delete-collection'); |
| 85 | + }); |
| 86 | +}); |
0 commit comments