mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[DURACOM-191] fix wrong imports
This commit is contained in:
@@ -1,28 +1,28 @@
|
|||||||
import { Options } from 'cypress-axe';
|
|
||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
import { Options } from 'cypress-axe';
|
||||||
|
|
||||||
describe('Admin Sidebar', () => {
|
describe('Admin Sidebar', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// Must login as an Admin for sidebar to appear
|
// Must login as an Admin for sidebar to appear
|
||||||
cy.visit('/login');
|
cy.visit('/login');
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be pinnable and pass accessibility tests', () => {
|
it('should be pinnable and pass accessibility tests', () => {
|
||||||
// Pin the sidebar open
|
// Pin the sidebar open
|
||||||
cy.get('#sidebar-collapse-toggle').click();
|
cy.get('#sidebar-collapse-toggle').click();
|
||||||
|
|
||||||
// Click on every expandable section to open all menus
|
// Click on every expandable section to open all menus
|
||||||
cy.get('ds-expandable-admin-sidebar-section').click({multiple: true});
|
cy.get('ds-expandable-admin-sidebar-section').click({ multiple: true });
|
||||||
|
|
||||||
// Analyze <ds-admin-sidebar> for accessibility
|
// Analyze <ds-admin-sidebar> for accessibility
|
||||||
testA11y('ds-admin-sidebar',
|
testA11y('ds-admin-sidebar',
|
||||||
{
|
{
|
||||||
rules: {
|
rules: {
|
||||||
// Currently all expandable sections have nested interactive elements
|
// Currently all expandable sections have nested interactive elements
|
||||||
// See https://github.com/DSpace/dspace-angular/issues/2178
|
// See https://github.com/DSpace/dspace-angular/issues/2178
|
||||||
'nested-interactive': { enabled: false },
|
'nested-interactive': { enabled: false },
|
||||||
}
|
},
|
||||||
} as Options);
|
} as Options);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Breadcrumbs', () => {
|
describe('Breadcrumbs', () => {
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
// Visit an Item, as those have more breadcrumbs
|
// Visit an Item, as those have more breadcrumbs
|
||||||
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
|
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
|
||||||
|
|
||||||
// Wait for breadcrumbs to be visible
|
// Wait for breadcrumbs to be visible
|
||||||
cy.get('ds-breadcrumbs').should('be.visible');
|
cy.get('ds-breadcrumbs').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-breadcrumbs> for accessibility
|
// Analyze <ds-breadcrumbs> for accessibility
|
||||||
testA11y('ds-breadcrumbs');
|
testA11y('ds-breadcrumbs');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Browse By Author', () => {
|
describe('Browse By Author', () => {
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit('/browse/author');
|
cy.visit('/browse/author');
|
||||||
|
|
||||||
// Wait for <ds-browse-by-metadata-page> to be visible
|
// Wait for <ds-browse-by-metadata-page> to be visible
|
||||||
cy.get('ds-browse-by-metadata').should('be.visible');
|
cy.get('ds-browse-by-metadata').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-browse-by-metadata-page> for accessibility
|
// Analyze <ds-browse-by-metadata-page> for accessibility
|
||||||
testA11y('ds-browse-by-metadata');
|
testA11y('ds-browse-by-metadata');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Browse By Date Issued', () => {
|
describe('Browse By Date Issued', () => {
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit('/browse/dateissued');
|
cy.visit('/browse/dateissued');
|
||||||
|
|
||||||
// Wait for <ds-browse-by-date-page> to be visible
|
// Wait for <ds-browse-by-date-page> to be visible
|
||||||
cy.get('ds-browse-by-date').should('be.visible');
|
cy.get('ds-browse-by-date').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-browse-by-date-page> for accessibility
|
// Analyze <ds-browse-by-date-page> for accessibility
|
||||||
testA11y('ds-browse-by-date');
|
testA11y('ds-browse-by-date');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Browse By Subject', () => {
|
describe('Browse By Subject', () => {
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit('/browse/subject');
|
cy.visit('/browse/subject');
|
||||||
|
|
||||||
// Wait for <ds-browse-by-metadata-page> to be visible
|
// Wait for <ds-browse-by-metadata-page> to be visible
|
||||||
cy.get('ds-browse-by-metadata').should('be.visible');
|
cy.get('ds-browse-by-metadata').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-browse-by-metadata-page> for accessibility
|
// Analyze <ds-browse-by-metadata-page> for accessibility
|
||||||
testA11y('ds-browse-by-metadata');
|
testA11y('ds-browse-by-metadata');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Browse By Title', () => {
|
describe('Browse By Title', () => {
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit('/browse/title');
|
cy.visit('/browse/title');
|
||||||
|
|
||||||
// Wait for <ds-browse-by-title-page> to be visible
|
// Wait for <ds-browse-by-title-page> to be visible
|
||||||
cy.get('ds-browse-by-title').should('be.visible');
|
cy.get('ds-browse-by-title').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-browse-by-title-page> for accessibility
|
// Analyze <ds-browse-by-title-page> for accessibility
|
||||||
testA11y('ds-browse-by-title');
|
testA11y('ds-browse-by-title');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -3,126 +3,126 @@ import { testA11y } from 'cypress/support/utils';
|
|||||||
const COLLECTION_EDIT_PAGE = '/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('/edit');
|
const COLLECTION_EDIT_PAGE = '/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('/edit');
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// All tests start with visiting the Edit Collection Page
|
// All tests start with visiting the Edit Collection Page
|
||||||
cy.visit(COLLECTION_EDIT_PAGE);
|
cy.visit(COLLECTION_EDIT_PAGE);
|
||||||
|
|
||||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Collection > Edit Metadata tab', () => {
|
describe('Edit Collection > Edit Metadata tab', () => {
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
// <ds-edit-collection> tag must be loaded
|
// <ds-edit-collection> tag must be loaded
|
||||||
cy.get('ds-edit-collection').should('be.visible');
|
cy.get('ds-edit-collection').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-edit-collection> for accessibility issues
|
// Analyze <ds-edit-collection> for accessibility issues
|
||||||
testA11y('ds-edit-collection');
|
testA11y('ds-edit-collection');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Collection > Assign Roles tab', () => {
|
describe('Edit Collection > Assign Roles tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="roles"]').click();
|
cy.get('a[data-test="roles"]').click();
|
||||||
|
|
||||||
// <ds-collection-roles> tag must be loaded
|
// <ds-collection-roles> tag must be loaded
|
||||||
cy.get('ds-collection-roles').should('be.visible');
|
cy.get('ds-collection-roles').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-collection-roles');
|
testA11y('ds-collection-roles');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Collection > Content Source tab', () => {
|
describe('Edit Collection > Content Source tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="source"]').click();
|
cy.get('a[data-test="source"]').click();
|
||||||
|
|
||||||
// <ds-collection-source> tag must be loaded
|
// <ds-collection-source> tag must be loaded
|
||||||
cy.get('ds-collection-source').should('be.visible');
|
cy.get('ds-collection-source').should('be.visible');
|
||||||
|
|
||||||
// Check the external source checkbox (to display all fields on the page)
|
// Check the external source checkbox (to display all fields on the page)
|
||||||
cy.get('#externalSourceCheck').check();
|
cy.get('#externalSourceCheck').check();
|
||||||
|
|
||||||
// Wait for the source controls to appear
|
// Wait for the source controls to appear
|
||||||
// cy.get('ds-collection-source-controls').should('be.visible');
|
// cy.get('ds-collection-source-controls').should('be.visible');
|
||||||
|
|
||||||
// Analyze entire page for accessibility issues
|
// Analyze entire page for accessibility issues
|
||||||
testA11y('ds-collection-source');
|
testA11y('ds-collection-source');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Collection > Curate tab', () => {
|
describe('Edit Collection > Curate tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="curate"]').click();
|
cy.get('a[data-test="curate"]').click();
|
||||||
|
|
||||||
// <ds-collection-curate> tag must be loaded
|
// <ds-collection-curate> tag must be loaded
|
||||||
cy.get('ds-collection-curate').should('be.visible');
|
cy.get('ds-collection-curate').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-collection-curate');
|
testA11y('ds-collection-curate');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Collection > Access Control tab', () => {
|
describe('Edit Collection > Access Control tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="access-control"]').click();
|
cy.get('a[data-test="access-control"]').click();
|
||||||
|
|
||||||
// <ds-collection-access-control> tag must be loaded
|
// <ds-collection-access-control> tag must be loaded
|
||||||
cy.get('ds-collection-access-control').should('be.visible');
|
cy.get('ds-collection-access-control').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-collection-access-control');
|
testA11y('ds-collection-access-control');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Collection > Authorizations tab', () => {
|
describe('Edit Collection > Authorizations tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="authorizations"]').click();
|
cy.get('a[data-test="authorizations"]').click();
|
||||||
|
|
||||||
// <ds-collection-authorizations> tag must be loaded
|
// <ds-collection-authorizations> tag must be loaded
|
||||||
cy.get('ds-collection-authorizations').should('be.visible');
|
cy.get('ds-collection-authorizations').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-collection-authorizations');
|
testA11y('ds-collection-authorizations');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Collection > Item Mapper tab', () => {
|
describe('Edit Collection > Item Mapper tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="mapper"]').click();
|
cy.get('a[data-test="mapper"]').click();
|
||||||
|
|
||||||
// <ds-collection-item-mapper> tag must be loaded
|
// <ds-collection-item-mapper> tag must be loaded
|
||||||
cy.get('ds-collection-item-mapper').should('be.visible');
|
cy.get('ds-collection-item-mapper').should('be.visible');
|
||||||
|
|
||||||
// Analyze entire page for accessibility issues
|
// Analyze entire page for accessibility issues
|
||||||
testA11y('ds-collection-item-mapper');
|
testA11y('ds-collection-item-mapper');
|
||||||
|
|
||||||
// Click on the "Map new Items" tab
|
// Click on the "Map new Items" tab
|
||||||
cy.get('li[data-test="mapTab"] a').click();
|
cy.get('li[data-test="mapTab"] a').click();
|
||||||
|
|
||||||
// Make sure search form is now visible
|
// Make sure search form is now visible
|
||||||
cy.get('ds-search-form').should('be.visible');
|
cy.get('ds-search-form').should('be.visible');
|
||||||
|
|
||||||
// Analyze entire page (again) for accessibility issues
|
// Analyze entire page (again) for accessibility issues
|
||||||
testA11y('ds-collection-item-mapper');
|
testA11y('ds-collection-item-mapper');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe('Edit Collection > Delete page', () => {
|
describe('Edit Collection > Delete page', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="delete-button"]').click();
|
cy.get('a[data-test="delete-button"]').click();
|
||||||
|
|
||||||
// <ds-delete-collection> tag must be loaded
|
// <ds-delete-collection> tag must be loaded
|
||||||
cy.get('ds-delete-collection').should('be.visible');
|
cy.get('ds-delete-collection').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-delete-collection');
|
testA11y('ds-delete-collection');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -2,13 +2,13 @@ import { testA11y } from 'cypress/support/utils';
|
|||||||
|
|
||||||
describe('Collection Page', () => {
|
describe('Collection Page', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit('/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')));
|
cy.visit('/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')));
|
||||||
|
|
||||||
// <ds-collection-page> tag must be loaded
|
// <ds-collection-page> tag must be loaded
|
||||||
cy.get('ds-collection-page').should('be.visible');
|
cy.get('ds-collection-page').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-collection-page> for accessibility issues
|
// Analyze <ds-collection-page> for accessibility issues
|
||||||
testA11y('ds-collection-page');
|
testA11y('ds-collection-page');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -2,36 +2,36 @@ import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Collection Statistics Page', () => {
|
describe('Collection Statistics Page', () => {
|
||||||
const COLLECTIONSTATISTICSPAGE = '/statistics/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION'));
|
const COLLECTIONSTATISTICSPAGE = '/statistics/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION'));
|
||||||
|
|
||||||
it('should load if you click on "Statistics" from a Collection page', () => {
|
it('should load if you click on "Statistics" from a Collection page', () => {
|
||||||
cy.visit('/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')));
|
cy.visit('/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')));
|
||||||
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
||||||
cy.location('pathname').should('eq', COLLECTIONSTATISTICSPAGE);
|
cy.location('pathname').should('eq', COLLECTIONSTATISTICSPAGE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain a "Total visits" section', () => {
|
it('should contain a "Total visits" section', () => {
|
||||||
cy.visit(COLLECTIONSTATISTICSPAGE);
|
cy.visit(COLLECTIONSTATISTICSPAGE);
|
||||||
cy.get('table[data-test="TotalVisits"]').should('be.visible');
|
cy.get('table[data-test="TotalVisits"]').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain a "Total visits per month" section', () => {
|
it('should contain a "Total visits per month" section', () => {
|
||||||
cy.visit(COLLECTIONSTATISTICSPAGE);
|
cy.visit(COLLECTIONSTATISTICSPAGE);
|
||||||
// Check just for existence because this table is empty in CI environment as it's historical data
|
// Check just for existence because this table is empty in CI environment as it's historical data
|
||||||
cy.get('.'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('_TotalVisitsPerMonth')).should('exist');
|
cy.get('.'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('_TotalVisitsPerMonth')).should('exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit(COLLECTIONSTATISTICSPAGE);
|
cy.visit(COLLECTIONSTATISTICSPAGE);
|
||||||
|
|
||||||
// <ds-collection-statistics-page> tag must be loaded
|
// <ds-collection-statistics-page> tag must be loaded
|
||||||
cy.get('ds-collection-statistics-page').should('be.visible');
|
cy.get('ds-collection-statistics-page').should('be.visible');
|
||||||
|
|
||||||
// Verify / wait until "Total Visits" table's label is non-empty
|
// Verify / wait until "Total Visits" table's label is non-empty
|
||||||
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
||||||
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
||||||
|
|
||||||
// Analyze <ds-collection-statistics-page> for accessibility issues
|
// Analyze <ds-collection-statistics-page> for accessibility issues
|
||||||
testA11y('ds-collection-statistics-page');
|
testA11y('ds-collection-statistics-page');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -3,84 +3,84 @@ import { testA11y } from 'cypress/support/utils';
|
|||||||
const COMMUNITY_EDIT_PAGE = '/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')).concat('/edit');
|
const COMMUNITY_EDIT_PAGE = '/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')).concat('/edit');
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// All tests start with visiting the Edit Community Page
|
// All tests start with visiting the Edit Community Page
|
||||||
cy.visit(COMMUNITY_EDIT_PAGE);
|
cy.visit(COMMUNITY_EDIT_PAGE);
|
||||||
|
|
||||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Community > Edit Metadata tab', () => {
|
describe('Edit Community > Edit Metadata tab', () => {
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
// <ds-edit-community> tag must be loaded
|
// <ds-edit-community> tag must be loaded
|
||||||
cy.get('ds-edit-community').should('be.visible');
|
cy.get('ds-edit-community').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-edit-community> for accessibility issues
|
// Analyze <ds-edit-community> for accessibility issues
|
||||||
testA11y('ds-edit-community');
|
testA11y('ds-edit-community');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Community > Assign Roles tab', () => {
|
describe('Edit Community > Assign Roles tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="roles"]').click();
|
cy.get('a[data-test="roles"]').click();
|
||||||
|
|
||||||
// <ds-community-roles> tag must be loaded
|
// <ds-community-roles> tag must be loaded
|
||||||
cy.get('ds-community-roles').should('be.visible');
|
cy.get('ds-community-roles').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-community-roles');
|
testA11y('ds-community-roles');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Community > Curate tab', () => {
|
describe('Edit Community > Curate tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="curate"]').click();
|
cy.get('a[data-test="curate"]').click();
|
||||||
|
|
||||||
// <ds-community-curate> tag must be loaded
|
// <ds-community-curate> tag must be loaded
|
||||||
cy.get('ds-community-curate').should('be.visible');
|
cy.get('ds-community-curate').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-community-curate');
|
testA11y('ds-community-curate');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Community > Access Control tab', () => {
|
describe('Edit Community > Access Control tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="access-control"]').click();
|
cy.get('a[data-test="access-control"]').click();
|
||||||
|
|
||||||
// <ds-community-access-control> tag must be loaded
|
// <ds-community-access-control> tag must be loaded
|
||||||
cy.get('ds-community-access-control').should('be.visible');
|
cy.get('ds-community-access-control').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-community-access-control');
|
testA11y('ds-community-access-control');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Community > Authorizations tab', () => {
|
describe('Edit Community > Authorizations tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="authorizations"]').click();
|
cy.get('a[data-test="authorizations"]').click();
|
||||||
|
|
||||||
// <ds-community-authorizations> tag must be loaded
|
// <ds-community-authorizations> tag must be loaded
|
||||||
cy.get('ds-community-authorizations').should('be.visible');
|
cy.get('ds-community-authorizations').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-community-authorizations');
|
testA11y('ds-community-authorizations');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Community > Delete page', () => {
|
describe('Edit Community > Delete page', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="delete-button"]').click();
|
cy.get('a[data-test="delete-button"]').click();
|
||||||
|
|
||||||
// <ds-delete-community> tag must be loaded
|
// <ds-delete-community> tag must be loaded
|
||||||
cy.get('ds-delete-community').should('be.visible');
|
cy.get('ds-delete-community').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-delete-community');
|
testA11y('ds-delete-community');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -2,16 +2,16 @@ import { testA11y } from 'cypress/support/utils';
|
|||||||
|
|
||||||
describe('Community List Page', () => {
|
describe('Community List Page', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit('/community-list');
|
cy.visit('/community-list');
|
||||||
|
|
||||||
// <ds-community-list-page> tag must be loaded
|
// <ds-community-list-page> tag must be loaded
|
||||||
cy.get('ds-community-list-page').should('be.visible');
|
cy.get('ds-community-list-page').should('be.visible');
|
||||||
|
|
||||||
// Open every expand button on page, so that we can scan sub-elements as well
|
// Open every expand button on page, so that we can scan sub-elements as well
|
||||||
cy.get('[data-test="expand-button"]').click({ multiple: true });
|
cy.get('[data-test="expand-button"]').click({ multiple: true });
|
||||||
|
|
||||||
// Analyze <ds-community-list-page> for accessibility issues
|
// Analyze <ds-community-list-page> for accessibility issues
|
||||||
testA11y('ds-community-list-page');
|
testA11y('ds-community-list-page');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -2,13 +2,13 @@ import { testA11y } from 'cypress/support/utils';
|
|||||||
|
|
||||||
describe('Community Page', () => {
|
describe('Community Page', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit('/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')));
|
cy.visit('/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')));
|
||||||
|
|
||||||
// <ds-community-page> tag must be loaded
|
// <ds-community-page> tag must be loaded
|
||||||
cy.get('ds-community-page').should('be.visible');
|
cy.get('ds-community-page').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-community-page> for accessibility issues
|
// Analyze <ds-community-page> for accessibility issues
|
||||||
testA11y('ds-community-page');
|
testA11y('ds-community-page');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -2,36 +2,36 @@ import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Community Statistics Page', () => {
|
describe('Community Statistics Page', () => {
|
||||||
const COMMUNITYSTATISTICSPAGE = '/statistics/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY'));
|
const COMMUNITYSTATISTICSPAGE = '/statistics/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY'));
|
||||||
|
|
||||||
it('should load if you click on "Statistics" from a Community page', () => {
|
it('should load if you click on "Statistics" from a Community page', () => {
|
||||||
cy.visit('/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')));
|
cy.visit('/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')));
|
||||||
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
||||||
cy.location('pathname').should('eq', COMMUNITYSTATISTICSPAGE);
|
cy.location('pathname').should('eq', COMMUNITYSTATISTICSPAGE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain a "Total visits" section', () => {
|
it('should contain a "Total visits" section', () => {
|
||||||
cy.visit(COMMUNITYSTATISTICSPAGE);
|
cy.visit(COMMUNITYSTATISTICSPAGE);
|
||||||
cy.get('table[data-test="TotalVisits"]').should('be.visible');
|
cy.get('table[data-test="TotalVisits"]').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain a "Total visits per month" section', () => {
|
it('should contain a "Total visits per month" section', () => {
|
||||||
cy.visit(COMMUNITYSTATISTICSPAGE);
|
cy.visit(COMMUNITYSTATISTICSPAGE);
|
||||||
// Check just for existence because this table is empty in CI environment as it's historical data
|
// Check just for existence because this table is empty in CI environment as it's historical data
|
||||||
cy.get('.'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')).concat('_TotalVisitsPerMonth')).should('exist');
|
cy.get('.'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')).concat('_TotalVisitsPerMonth')).should('exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit(COMMUNITYSTATISTICSPAGE);
|
cy.visit(COMMUNITYSTATISTICSPAGE);
|
||||||
|
|
||||||
// <ds-community-statistics-page> tag must be loaded
|
// <ds-community-statistics-page> tag must be loaded
|
||||||
cy.get('ds-community-statistics-page').should('be.visible');
|
cy.get('ds-community-statistics-page').should('be.visible');
|
||||||
|
|
||||||
// Verify / wait until "Total Visits" table's label is non-empty
|
// Verify / wait until "Total Visits" table's label is non-empty
|
||||||
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
||||||
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
||||||
|
|
||||||
// Analyze <ds-community-statistics-page> for accessibility issues
|
// Analyze <ds-community-statistics-page> for accessibility issues
|
||||||
testA11y('ds-community-statistics-page');
|
testA11y('ds-community-statistics-page');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Footer', () => {
|
describe('Footer', () => {
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
|
||||||
// Footer must first be visible
|
// Footer must first be visible
|
||||||
cy.get('ds-footer').should('be.visible');
|
cy.get('ds-footer').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-footer> for accessibility
|
// Analyze <ds-footer> for accessibility
|
||||||
testA11y('ds-footer');
|
testA11y('ds-footer');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Header', () => {
|
describe('Header', () => {
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
|
||||||
// Header must first be visible
|
// Header must first be visible
|
||||||
cy.get('ds-header').should('be.visible');
|
cy.get('ds-header').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-header> for accessibility
|
// Analyze <ds-header> for accessibility
|
||||||
testA11y('ds-header');
|
testA11y('ds-header');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,31 +1,32 @@
|
|||||||
import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
|
|
||||||
import { testA11y } from 'cypress/support/utils';
|
|
||||||
import '../support/commands';
|
import '../support/commands';
|
||||||
|
|
||||||
|
import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
|
||||||
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Site Statistics Page', () => {
|
describe('Site Statistics Page', () => {
|
||||||
it('should load if you click on "Statistics" from homepage', () => {
|
it('should load if you click on "Statistics" from homepage', () => {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
||||||
cy.location('pathname').should('eq', '/statistics');
|
cy.location('pathname').should('eq', '/statistics');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
// generate 2 view events on an Item's page
|
// generate 2 view events on an Item's page
|
||||||
cy.generateViewEvent(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'), 'item');
|
cy.generateViewEvent(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'), 'item');
|
||||||
cy.generateViewEvent(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'), 'item');
|
cy.generateViewEvent(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'), 'item');
|
||||||
|
|
||||||
cy.visit('/statistics');
|
cy.visit('/statistics');
|
||||||
|
|
||||||
// <ds-site-statistics-page> tag must be visable
|
// <ds-site-statistics-page> tag must be visable
|
||||||
cy.get('ds-site-statistics-page').should('be.visible');
|
cy.get('ds-site-statistics-page').should('be.visible');
|
||||||
|
|
||||||
// Verify / wait until "Total Visits" table's *last* label is non-empty
|
// Verify / wait until "Total Visits" table's *last* label is non-empty
|
||||||
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
||||||
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').last().contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').last().contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
||||||
// Wait an extra 500ms, just so all entries in Total Visits have loaded.
|
// Wait an extra 500ms, just so all entries in Total Visits have loaded.
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
|
|
||||||
// Analyze <ds-site-statistics-page> for accessibility issues
|
// Analyze <ds-site-statistics-page> for accessibility issues
|
||||||
testA11y('ds-site-statistics-page');
|
testA11y('ds-site-statistics-page');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,135 +1,135 @@
|
|||||||
import { Options } from 'cypress-axe';
|
|
||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
import { Options } from 'cypress-axe';
|
||||||
|
|
||||||
const ITEM_EDIT_PAGE = '/items/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')).concat('/edit');
|
const ITEM_EDIT_PAGE = '/items/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')).concat('/edit');
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// All tests start with visiting the Edit Item Page
|
// All tests start with visiting the Edit Item Page
|
||||||
cy.visit(ITEM_EDIT_PAGE);
|
cy.visit(ITEM_EDIT_PAGE);
|
||||||
|
|
||||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Item > Edit Metadata tab', () => {
|
describe('Edit Item > Edit Metadata tab', () => {
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="metadata"]').click();
|
cy.get('a[data-test="metadata"]').click();
|
||||||
|
|
||||||
// <ds-edit-item-page> tag must be loaded
|
// <ds-edit-item-page> tag must be loaded
|
||||||
cy.get('ds-edit-item-page').should('be.visible');
|
cy.get('ds-edit-item-page').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-edit-item-page> for accessibility issues
|
// Analyze <ds-edit-item-page> for accessibility issues
|
||||||
testA11y('ds-edit-item-page');
|
testA11y('ds-edit-item-page');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Item > Status tab', () => {
|
describe('Edit Item > Status tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="status"]').click();
|
cy.get('a[data-test="status"]').click();
|
||||||
|
|
||||||
// <ds-item-status> tag must be loaded
|
// <ds-item-status> tag must be loaded
|
||||||
cy.get('ds-item-status').should('be.visible');
|
cy.get('ds-item-status').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-item-status');
|
testA11y('ds-item-status');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Item > Bitstreams tab', () => {
|
describe('Edit Item > Bitstreams tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="bitstreams"]').click();
|
cy.get('a[data-test="bitstreams"]').click();
|
||||||
|
|
||||||
// <ds-item-bitstreams> tag must be loaded
|
// <ds-item-bitstreams> tag must be loaded
|
||||||
cy.get('ds-item-bitstreams').should('be.visible');
|
cy.get('ds-item-bitstreams').should('be.visible');
|
||||||
|
|
||||||
// Table of item bitstreams must also be loaded
|
// Table of item bitstreams must also be loaded
|
||||||
cy.get('div.item-bitstreams').should('be.visible');
|
cy.get('div.item-bitstreams').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-item-bitstreams',
|
testA11y('ds-item-bitstreams',
|
||||||
{
|
{
|
||||||
rules: {
|
rules: {
|
||||||
// Currently Bitstreams page loads a pagination component per Bundle
|
// Currently Bitstreams page loads a pagination component per Bundle
|
||||||
// and they all use the same 'id="p-dad"'.
|
// and they all use the same 'id="p-dad"'.
|
||||||
'duplicate-id': { enabled: false },
|
'duplicate-id': { enabled: false },
|
||||||
}
|
},
|
||||||
} as Options
|
} as Options,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Item > Curate tab', () => {
|
describe('Edit Item > Curate tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="curate"]').click();
|
cy.get('a[data-test="curate"]').click();
|
||||||
|
|
||||||
// <ds-item-curate> tag must be loaded
|
// <ds-item-curate> tag must be loaded
|
||||||
cy.get('ds-item-curate').should('be.visible');
|
cy.get('ds-item-curate').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-item-curate');
|
testA11y('ds-item-curate');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Item > Relationships tab', () => {
|
describe('Edit Item > Relationships tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="relationships"]').click();
|
cy.get('a[data-test="relationships"]').click();
|
||||||
|
|
||||||
// <ds-item-relationships> tag must be loaded
|
// <ds-item-relationships> tag must be loaded
|
||||||
cy.get('ds-item-relationships').should('be.visible');
|
cy.get('ds-item-relationships').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-item-relationships');
|
testA11y('ds-item-relationships');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Item > Version History tab', () => {
|
describe('Edit Item > Version History tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="versionhistory"]').click();
|
cy.get('a[data-test="versionhistory"]').click();
|
||||||
|
|
||||||
// <ds-item-version-history> tag must be loaded
|
// <ds-item-version-history> tag must be loaded
|
||||||
cy.get('ds-item-version-history').should('be.visible');
|
cy.get('ds-item-version-history').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-item-version-history');
|
testA11y('ds-item-version-history');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Item > Access Control tab', () => {
|
describe('Edit Item > Access Control tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="access-control"]').click();
|
cy.get('a[data-test="access-control"]').click();
|
||||||
|
|
||||||
// <ds-item-access-control> tag must be loaded
|
// <ds-item-access-control> tag must be loaded
|
||||||
cy.get('ds-item-access-control').should('be.visible');
|
cy.get('ds-item-access-control').should('be.visible');
|
||||||
|
|
||||||
// Analyze for accessibility issues
|
// Analyze for accessibility issues
|
||||||
testA11y('ds-item-access-control');
|
testA11y('ds-item-access-control');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Edit Item > Collection Mapper tab', () => {
|
describe('Edit Item > Collection Mapper tab', () => {
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.get('a[data-test="mapper"]').click();
|
cy.get('a[data-test="mapper"]').click();
|
||||||
|
|
||||||
// <ds-item-collection-mapper> tag must be loaded
|
// <ds-item-collection-mapper> tag must be loaded
|
||||||
cy.get('ds-item-collection-mapper').should('be.visible');
|
cy.get('ds-item-collection-mapper').should('be.visible');
|
||||||
|
|
||||||
// Analyze entire page for accessibility issues
|
// Analyze entire page for accessibility issues
|
||||||
testA11y('ds-item-collection-mapper');
|
testA11y('ds-item-collection-mapper');
|
||||||
|
|
||||||
// Click on the "Map new collections" tab
|
// Click on the "Map new collections" tab
|
||||||
cy.get('li[data-test="mapTab"] a').click();
|
cy.get('li[data-test="mapTab"] a').click();
|
||||||
|
|
||||||
// Make sure search form is now visible
|
// Make sure search form is now visible
|
||||||
cy.get('ds-search-form').should('be.visible');
|
cy.get('ds-search-form').should('be.visible');
|
||||||
|
|
||||||
// Analyze entire page (again) for accessibility issues
|
// Analyze entire page (again) for accessibility issues
|
||||||
testA11y('ds-item-collection-mapper');
|
testA11y('ds-item-collection-mapper');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,32 +1,32 @@
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Item Page', () => {
|
describe('Item Page', () => {
|
||||||
const ITEMPAGE = '/items/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
const ITEMPAGE = '/items/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
||||||
const ENTITYPAGE = '/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
const ENTITYPAGE = '/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
||||||
|
|
||||||
// Test that entities will redirect to /entities/[type]/[uuid] when accessed via /items/[uuid]
|
// Test that entities will redirect to /entities/[type]/[uuid] when accessed via /items/[uuid]
|
||||||
it('should redirect to the entity page when navigating to an item page', () => {
|
it('should redirect to the entity page when navigating to an item page', () => {
|
||||||
cy.visit(ITEMPAGE);
|
cy.visit(ITEMPAGE);
|
||||||
cy.location('pathname').should('eq', ENTITYPAGE);
|
cy.location('pathname').should('eq', ENTITYPAGE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit(ENTITYPAGE);
|
cy.visit(ENTITYPAGE);
|
||||||
|
|
||||||
// <ds-item-page> tag must be loaded
|
// <ds-item-page> tag must be loaded
|
||||||
cy.get('ds-item-page').should('be.visible');
|
cy.get('ds-item-page').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-item-page> for accessibility issues
|
// Analyze <ds-item-page> for accessibility issues
|
||||||
testA11y('ds-item-page');
|
testA11y('ds-item-page');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should pass accessibility tests on full item page', () => {
|
it('should pass accessibility tests on full item page', () => {
|
||||||
cy.visit(ENTITYPAGE + '/full');
|
cy.visit(ENTITYPAGE + '/full');
|
||||||
|
|
||||||
// <ds-full-item-page> tag must be loaded
|
// <ds-full-item-page> tag must be loaded
|
||||||
cy.get('ds-full-item-page').should('be.visible');
|
cy.get('ds-full-item-page').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-full-item-page> for accessibility issues
|
// Analyze <ds-full-item-page> for accessibility issues
|
||||||
testA11y('ds-full-item-page');
|
testA11y('ds-full-item-page');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -2,42 +2,42 @@ import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('Item Statistics Page', () => {
|
describe('Item Statistics Page', () => {
|
||||||
const ITEMSTATISTICSPAGE = '/statistics/items/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
const ITEMSTATISTICSPAGE = '/statistics/items/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
||||||
|
|
||||||
it('should load if you click on "Statistics" from an Item/Entity page', () => {
|
it('should load if you click on "Statistics" from an Item/Entity page', () => {
|
||||||
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
|
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
|
||||||
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
||||||
cy.location('pathname').should('eq', ITEMSTATISTICSPAGE);
|
cy.location('pathname').should('eq', ITEMSTATISTICSPAGE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain element ds-item-statistics-page when navigating to an item statistics page', () => {
|
it('should contain element ds-item-statistics-page when navigating to an item statistics page', () => {
|
||||||
cy.visit(ITEMSTATISTICSPAGE);
|
cy.visit(ITEMSTATISTICSPAGE);
|
||||||
cy.get('ds-item-statistics-page').should('be.visible');
|
cy.get('ds-item-statistics-page').should('be.visible');
|
||||||
cy.get('ds-item-page').should('not.exist');
|
cy.get('ds-item-page').should('not.exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain a "Total visits" section', () => {
|
it('should contain a "Total visits" section', () => {
|
||||||
cy.visit(ITEMSTATISTICSPAGE);
|
cy.visit(ITEMSTATISTICSPAGE);
|
||||||
cy.get('table[data-test="TotalVisits"]').should('be.visible');
|
cy.get('table[data-test="TotalVisits"]').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain a "Total visits per month" section', () => {
|
it('should contain a "Total visits per month" section', () => {
|
||||||
cy.visit(ITEMSTATISTICSPAGE);
|
cy.visit(ITEMSTATISTICSPAGE);
|
||||||
// Check just for existence because this table is empty in CI environment as it's historical data
|
// Check just for existence because this table is empty in CI environment as it's historical data
|
||||||
cy.get('.'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')).concat('_TotalVisitsPerMonth')).should('exist');
|
cy.get('.'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')).concat('_TotalVisitsPerMonth')).should('exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should pass accessibility tests', () => {
|
it('should pass accessibility tests', () => {
|
||||||
cy.visit(ITEMSTATISTICSPAGE);
|
cy.visit(ITEMSTATISTICSPAGE);
|
||||||
|
|
||||||
// <ds-item-statistics-page> tag must be loaded
|
// <ds-item-statistics-page> tag must be loaded
|
||||||
cy.get('ds-item-statistics-page').should('be.visible');
|
cy.get('ds-item-statistics-page').should('be.visible');
|
||||||
|
|
||||||
// Verify / wait until "Total Visits" table's label is non-empty
|
// Verify / wait until "Total Visits" table's label is non-empty
|
||||||
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
||||||
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
||||||
|
|
||||||
// Analyze <ds-item-statistics-page> for accessibility issues
|
// Analyze <ds-item-statistics-page> for accessibility issues
|
||||||
testA11y('ds-item-statistics-page');
|
testA11y('ds-item-statistics-page');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,150 +1,150 @@
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
const page = {
|
const page = {
|
||||||
openLoginMenu() {
|
openLoginMenu() {
|
||||||
// Click the "Log In" dropdown menu in header
|
// Click the "Log In" dropdown menu in header
|
||||||
cy.get('ds-themed-header [data-test="login-menu"]').click();
|
cy.get('ds-themed-header [data-test="login-menu"]').click();
|
||||||
},
|
},
|
||||||
openUserMenu() {
|
openUserMenu() {
|
||||||
// Once logged in, click the User menu in header
|
// Once logged in, click the User menu in header
|
||||||
cy.get('ds-themed-header [data-test="user-menu"]').click();
|
cy.get('ds-themed-header [data-test="user-menu"]').click();
|
||||||
},
|
},
|
||||||
submitLoginAndPasswordByPressingButton(email, password) {
|
submitLoginAndPasswordByPressingButton(email, password) {
|
||||||
// Enter email
|
// Enter email
|
||||||
cy.get('ds-themed-header [data-test="email"]').type(email);
|
cy.get('ds-themed-header [data-test="email"]').type(email);
|
||||||
// Enter password
|
// Enter password
|
||||||
cy.get('ds-themed-header [data-test="password"]').type(password);
|
cy.get('ds-themed-header [data-test="password"]').type(password);
|
||||||
// Click login button
|
// Click login button
|
||||||
cy.get('ds-themed-header [data-test="login-button"]').click();
|
cy.get('ds-themed-header [data-test="login-button"]').click();
|
||||||
},
|
},
|
||||||
submitLoginAndPasswordByPressingEnter(email, password) {
|
submitLoginAndPasswordByPressingEnter(email, password) {
|
||||||
// In opened Login modal, fill out email & password, then click Enter
|
// In opened Login modal, fill out email & password, then click Enter
|
||||||
cy.get('ds-themed-header [data-test="email"]').type(email);
|
cy.get('ds-themed-header [data-test="email"]').type(email);
|
||||||
cy.get('ds-themed-header [data-test="password"]').type(password);
|
cy.get('ds-themed-header [data-test="password"]').type(password);
|
||||||
cy.get('ds-themed-header [data-test="password"]').type('{enter}');
|
cy.get('ds-themed-header [data-test="password"]').type('{enter}');
|
||||||
},
|
},
|
||||||
submitLogoutByPressingButton() {
|
submitLogoutByPressingButton() {
|
||||||
// This is the POST command that will actually log us out
|
// This is the POST command that will actually log us out
|
||||||
cy.intercept('POST', '/server/api/authn/logout').as('logout');
|
cy.intercept('POST', '/server/api/authn/logout').as('logout');
|
||||||
// Click logout button
|
// Click logout button
|
||||||
cy.get('ds-themed-header [data-test="logout-button"]').click();
|
cy.get('ds-themed-header [data-test="logout-button"]').click();
|
||||||
// Wait until above POST command responds before continuing
|
// Wait until above POST command responds before continuing
|
||||||
// (This ensures next action waits until logout completes)
|
// (This ensures next action waits until logout completes)
|
||||||
cy.wait('@logout');
|
cy.wait('@logout');
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('Login Modal', () => {
|
describe('Login Modal', () => {
|
||||||
it('should login when clicking button & stay on same page', () => {
|
it('should login when clicking button & stay on same page', () => {
|
||||||
const ENTITYPAGE = '/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
const ENTITYPAGE = '/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
||||||
cy.visit(ENTITYPAGE);
|
cy.visit(ENTITYPAGE);
|
||||||
|
|
||||||
// Login menu should exist
|
// Login menu should exist
|
||||||
cy.get('ds-log-in').should('exist');
|
cy.get('ds-log-in').should('exist');
|
||||||
|
|
||||||
// Login, and the <ds-log-in> tag should no longer exist
|
// Login, and the <ds-log-in> tag should no longer exist
|
||||||
page.openLoginMenu();
|
page.openLoginMenu();
|
||||||
cy.get('.form-login').should('be.visible');
|
cy.get('.form-login').should('be.visible');
|
||||||
|
|
||||||
page.submitLoginAndPasswordByPressingButton(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
page.submitLoginAndPasswordByPressingButton(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||||
cy.get('ds-log-in').should('not.exist');
|
cy.get('ds-log-in').should('not.exist');
|
||||||
|
|
||||||
// Verify we are still on the same page
|
// Verify we are still on the same page
|
||||||
cy.url().should('include', ENTITYPAGE);
|
cy.url().should('include', ENTITYPAGE);
|
||||||
|
|
||||||
// Open user menu, verify user menu & logout button now available
|
// Open user menu, verify user menu & logout button now available
|
||||||
page.openUserMenu();
|
page.openUserMenu();
|
||||||
cy.get('ds-user-menu').should('be.visible');
|
cy.get('ds-user-menu').should('be.visible');
|
||||||
cy.get('ds-log-out').should('be.visible');
|
cy.get('ds-log-out').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should login when clicking enter key & stay on same page', () => {
|
it('should login when clicking enter key & stay on same page', () => {
|
||||||
cy.visit('/home');
|
cy.visit('/home');
|
||||||
|
|
||||||
// Open login menu in header & verify <ds-log-in> tag is visible
|
// Open login menu in header & verify <ds-log-in> tag is visible
|
||||||
page.openLoginMenu();
|
page.openLoginMenu();
|
||||||
cy.get('.form-login').should('be.visible');
|
cy.get('.form-login').should('be.visible');
|
||||||
|
|
||||||
// Login, and the <ds-log-in> tag should no longer exist
|
// Login, and the <ds-log-in> tag should no longer exist
|
||||||
page.submitLoginAndPasswordByPressingEnter(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
page.submitLoginAndPasswordByPressingEnter(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||||
cy.get('.form-login').should('not.exist');
|
cy.get('.form-login').should('not.exist');
|
||||||
|
|
||||||
// Verify we are still on homepage
|
// Verify we are still on homepage
|
||||||
cy.url().should('include', '/home');
|
cy.url().should('include', '/home');
|
||||||
|
|
||||||
// Open user menu, verify user menu & logout button now available
|
// Open user menu, verify user menu & logout button now available
|
||||||
page.openUserMenu();
|
page.openUserMenu();
|
||||||
cy.get('ds-user-menu').should('be.visible');
|
cy.get('ds-user-menu').should('be.visible');
|
||||||
cy.get('ds-log-out').should('be.visible');
|
cy.get('ds-log-out').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support logout', () => {
|
it('should support logout', () => {
|
||||||
// First authenticate & access homepage
|
// First authenticate & access homepage
|
||||||
cy.login(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
cy.login(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
|
||||||
// Verify ds-log-in tag doesn't exist, but ds-log-out tag does exist
|
// Verify ds-log-in tag doesn't exist, but ds-log-out tag does exist
|
||||||
cy.get('ds-log-in').should('not.exist');
|
cy.get('ds-log-in').should('not.exist');
|
||||||
cy.get('ds-log-out').should('exist');
|
cy.get('ds-log-out').should('exist');
|
||||||
|
|
||||||
// Click logout button
|
// Click logout button
|
||||||
page.openUserMenu();
|
page.openUserMenu();
|
||||||
page.submitLogoutByPressingButton();
|
page.submitLogoutByPressingButton();
|
||||||
|
|
||||||
// Verify ds-log-in tag now exists
|
// Verify ds-log-in tag now exists
|
||||||
cy.get('ds-log-in').should('exist');
|
cy.get('ds-log-in').should('exist');
|
||||||
cy.get('ds-log-out').should('not.exist');
|
cy.get('ds-log-out').should('not.exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should allow new user registration', () => {
|
it('should allow new user registration', () => {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
|
||||||
page.openLoginMenu();
|
page.openLoginMenu();
|
||||||
|
|
||||||
// Registration link should be visible
|
// Registration link should be visible
|
||||||
cy.get('ds-themed-header [data-test="register"]').should('be.visible');
|
cy.get('ds-themed-header [data-test="register"]').should('be.visible');
|
||||||
|
|
||||||
// Click registration link & you should go to registration page
|
// Click registration link & you should go to registration page
|
||||||
cy.get('ds-themed-header [data-test="register"]').click();
|
cy.get('ds-themed-header [data-test="register"]').click();
|
||||||
cy.location('pathname').should('eq', '/register');
|
cy.location('pathname').should('eq', '/register');
|
||||||
cy.get('ds-register-email').should('exist');
|
cy.get('ds-register-email').should('exist');
|
||||||
|
|
||||||
// Test accessibility of this page
|
// Test accessibility of this page
|
||||||
testA11y('ds-register-email');
|
testA11y('ds-register-email');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should allow forgot password', () => {
|
it('should allow forgot password', () => {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
|
||||||
page.openLoginMenu();
|
page.openLoginMenu();
|
||||||
|
|
||||||
// Forgot password link should be visible
|
// Forgot password link should be visible
|
||||||
cy.get('ds-themed-header [data-test="forgot"]').should('be.visible');
|
cy.get('ds-themed-header [data-test="forgot"]').should('be.visible');
|
||||||
|
|
||||||
// Click link & you should go to Forgot Password page
|
// Click link & you should go to Forgot Password page
|
||||||
cy.get('ds-themed-header [data-test="forgot"]').click();
|
cy.get('ds-themed-header [data-test="forgot"]').click();
|
||||||
cy.location('pathname').should('eq', '/forgot');
|
cy.location('pathname').should('eq', '/forgot');
|
||||||
cy.get('ds-forgot-email').should('exist');
|
cy.get('ds-forgot-email').should('exist');
|
||||||
|
|
||||||
// Test accessibility of this page
|
// Test accessibility of this page
|
||||||
testA11y('ds-forgot-email');
|
testA11y('ds-forgot-email');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should pass accessibility tests in menus', () => {
|
it('should pass accessibility tests in menus', () => {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
|
||||||
// Open login menu & verify accessibility
|
// Open login menu & verify accessibility
|
||||||
page.openLoginMenu();
|
page.openLoginMenu();
|
||||||
cy.get('ds-log-in').should('exist');
|
cy.get('ds-log-in').should('exist');
|
||||||
testA11y('ds-log-in');
|
testA11y('ds-log-in');
|
||||||
|
|
||||||
// Now login
|
// Now login
|
||||||
page.submitLoginAndPasswordByPressingButton(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
page.submitLoginAndPasswordByPressingButton(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||||
cy.get('ds-log-in').should('not.exist');
|
cy.get('ds-log-in').should('not.exist');
|
||||||
|
|
||||||
// Open user menu, verify user menu accesibility
|
// Open user menu, verify user menu accesibility
|
||||||
page.openUserMenu();
|
page.openUserMenu();
|
||||||
cy.get('ds-user-menu').should('be.visible');
|
cy.get('ds-user-menu').should('be.visible');
|
||||||
testA11y('ds-user-menu');
|
testA11y('ds-user-menu');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,134 +1,134 @@
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('My DSpace page', () => {
|
describe('My DSpace page', () => {
|
||||||
it('should display recent submissions and pass accessibility tests', () => {
|
it('should display recent submissions and pass accessibility tests', () => {
|
||||||
cy.visit('/mydspace');
|
cy.visit('/mydspace');
|
||||||
|
|
||||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||||
|
|
||||||
cy.get('ds-my-dspace-page').should('be.visible');
|
cy.get('ds-my-dspace-page').should('be.visible');
|
||||||
|
|
||||||
// At least one recent submission should be displayed
|
// At least one recent submission should be displayed
|
||||||
cy.get('[data-test="list-object"]').should('be.visible');
|
cy.get('[data-test="list-object"]').should('be.visible');
|
||||||
|
|
||||||
// Click each filter toggle to open *every* filter
|
// Click each filter toggle to open *every* filter
|
||||||
// (As we want to scan filter section for accessibility issues as well)
|
// (As we want to scan filter section for accessibility issues as well)
|
||||||
cy.get('.filter-toggle').click({ multiple: true });
|
cy.get('.filter-toggle').click({ multiple: true });
|
||||||
|
|
||||||
// Analyze <ds-my-dspace-page> for accessibility issues
|
// Analyze <ds-my-dspace-page> for accessibility issues
|
||||||
testA11y('ds-my-dspace-page');
|
testA11y('ds-my-dspace-page');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have a working detailed view that passes accessibility tests', () => {
|
||||||
|
cy.visit('/mydspace');
|
||||||
|
|
||||||
|
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||||
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||||
|
|
||||||
|
cy.get('ds-my-dspace-page').should('be.visible');
|
||||||
|
|
||||||
|
// Click button in sidebar to display detailed view
|
||||||
|
cy.get('ds-search-sidebar [data-test="detail-view"]').click();
|
||||||
|
|
||||||
|
cy.get('ds-object-detail').should('be.visible');
|
||||||
|
|
||||||
|
// Analyze <ds-my-dspace-page> for accessibility issues
|
||||||
|
testA11y('ds-my-dspace-page');
|
||||||
|
});
|
||||||
|
|
||||||
|
// NOTE: Deleting existing submissions is exercised by submission.spec.ts
|
||||||
|
it('should let you start a new submission & edit in-progress submissions', () => {
|
||||||
|
cy.visit('/mydspace');
|
||||||
|
|
||||||
|
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||||
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||||
|
|
||||||
|
// Open the New Submission dropdown
|
||||||
|
cy.get('button[data-test="submission-dropdown"]').click();
|
||||||
|
// Click on the "Item" type in that dropdown
|
||||||
|
cy.get('#entityControlsDropdownMenu button[title="none"]').click();
|
||||||
|
|
||||||
|
// This should display the <ds-create-item-parent-selector> (popup window)
|
||||||
|
cy.get('ds-create-item-parent-selector').should('be.visible');
|
||||||
|
|
||||||
|
// Type in a known Collection name in the search box
|
||||||
|
cy.get('ds-authorized-collection-selector input[type="search"]').type(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME'));
|
||||||
|
|
||||||
|
// Click on the button matching that known Collection name
|
||||||
|
cy.get('ds-authorized-collection-selector button[title="'.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME')).concat('"]')).click();
|
||||||
|
|
||||||
|
// New URL should include /workspaceitems, as we've started a new submission
|
||||||
|
cy.url().should('include', '/workspaceitems');
|
||||||
|
|
||||||
|
// The Submission edit form tag should be visible
|
||||||
|
cy.get('ds-submission-edit').should('be.visible');
|
||||||
|
|
||||||
|
// A Collection menu button should exist & its value should be the selected collection
|
||||||
|
cy.get('#collectionControlsMenuButton span').should('have.text', Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME'));
|
||||||
|
|
||||||
|
// Now that we've created a submission, we'll test that we can go back and Edit it.
|
||||||
|
// Get our Submission URL, to parse out the ID of this new submission
|
||||||
|
cy.location().then(fullUrl => {
|
||||||
|
// This will be the full path (/workspaceitems/[id]/edit)
|
||||||
|
const path = fullUrl.pathname;
|
||||||
|
// Split on the slashes
|
||||||
|
const subpaths = path.split('/');
|
||||||
|
// Part 2 will be the [id] of the submission
|
||||||
|
const id = subpaths[2];
|
||||||
|
|
||||||
|
// Click the "Save for Later" button to save this submission
|
||||||
|
cy.get('ds-submission-form-footer [data-test="save-for-later"]').click();
|
||||||
|
|
||||||
|
// "Save for Later" should send us to MyDSpace
|
||||||
|
cy.url().should('include', '/mydspace');
|
||||||
|
|
||||||
|
// Close any open notifications, to make sure they don't get in the way of next steps
|
||||||
|
cy.get('[data-dismiss="alert"]').click({ multiple: true });
|
||||||
|
|
||||||
|
// This is the GET command that will actually run the search
|
||||||
|
cy.intercept('GET', '/server/api/discover/search/objects*').as('search-results');
|
||||||
|
// On MyDSpace, find the submission we just created via its ID
|
||||||
|
cy.get('[data-test="search-box"]').type(id);
|
||||||
|
cy.get('[data-test="search-button"]').click();
|
||||||
|
|
||||||
|
// Wait for search results to come back from the above GET command
|
||||||
|
cy.wait('@search-results');
|
||||||
|
|
||||||
|
// Click the Edit button for this in-progress submission
|
||||||
|
cy.get('#edit_' + id).click();
|
||||||
|
|
||||||
|
// Should send us back to the submission form
|
||||||
|
cy.url().should('include', '/workspaceitems/' + id + '/edit');
|
||||||
|
|
||||||
|
// Discard our new submission by clicking Discard in Submission form & confirming
|
||||||
|
cy.get('ds-submission-form-footer [data-test="discard"]').click();
|
||||||
|
cy.get('button#discard_submit').click();
|
||||||
|
|
||||||
|
// Discarding should send us back to MyDSpace
|
||||||
|
cy.url().should('include', '/mydspace');
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should have a working detailed view that passes accessibility tests', () => {
|
it('should let you import from external sources', () => {
|
||||||
cy.visit('/mydspace');
|
cy.visit('/mydspace');
|
||||||
|
|
||||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||||
|
|
||||||
cy.get('ds-my-dspace-page').should('be.visible');
|
// Open the New Import dropdown
|
||||||
|
cy.get('button[data-test="import-dropdown"]').click();
|
||||||
|
// Click on the "Item" type in that dropdown
|
||||||
|
cy.get('#importControlsDropdownMenu button[title="none"]').click();
|
||||||
|
|
||||||
// Click button in sidebar to display detailed view
|
// New URL should include /import-external, as we've moved to the import page
|
||||||
cy.get('ds-search-sidebar [data-test="detail-view"]').click();
|
cy.url().should('include', '/import-external');
|
||||||
|
|
||||||
cy.get('ds-object-detail').should('be.visible');
|
// The external import searchbox should be visible
|
||||||
|
cy.get('ds-submission-import-external-searchbar').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-my-dspace-page> for accessibility issues
|
// Test for accessibility issues
|
||||||
testA11y('ds-my-dspace-page');
|
testA11y('ds-submission-import-external');
|
||||||
});
|
});
|
||||||
|
|
||||||
// NOTE: Deleting existing submissions is exercised by submission.spec.ts
|
|
||||||
it('should let you start a new submission & edit in-progress submissions', () => {
|
|
||||||
cy.visit('/mydspace');
|
|
||||||
|
|
||||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
|
||||||
|
|
||||||
// Open the New Submission dropdown
|
|
||||||
cy.get('button[data-test="submission-dropdown"]').click();
|
|
||||||
// Click on the "Item" type in that dropdown
|
|
||||||
cy.get('#entityControlsDropdownMenu button[title="none"]').click();
|
|
||||||
|
|
||||||
// This should display the <ds-create-item-parent-selector> (popup window)
|
|
||||||
cy.get('ds-create-item-parent-selector').should('be.visible');
|
|
||||||
|
|
||||||
// Type in a known Collection name in the search box
|
|
||||||
cy.get('ds-authorized-collection-selector input[type="search"]').type(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME'));
|
|
||||||
|
|
||||||
// Click on the button matching that known Collection name
|
|
||||||
cy.get('ds-authorized-collection-selector button[title="'.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME')).concat('"]')).click();
|
|
||||||
|
|
||||||
// New URL should include /workspaceitems, as we've started a new submission
|
|
||||||
cy.url().should('include', '/workspaceitems');
|
|
||||||
|
|
||||||
// The Submission edit form tag should be visible
|
|
||||||
cy.get('ds-submission-edit').should('be.visible');
|
|
||||||
|
|
||||||
// A Collection menu button should exist & its value should be the selected collection
|
|
||||||
cy.get('#collectionControlsMenuButton span').should('have.text', Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME'));
|
|
||||||
|
|
||||||
// Now that we've created a submission, we'll test that we can go back and Edit it.
|
|
||||||
// Get our Submission URL, to parse out the ID of this new submission
|
|
||||||
cy.location().then(fullUrl => {
|
|
||||||
// This will be the full path (/workspaceitems/[id]/edit)
|
|
||||||
const path = fullUrl.pathname;
|
|
||||||
// Split on the slashes
|
|
||||||
const subpaths = path.split('/');
|
|
||||||
// Part 2 will be the [id] of the submission
|
|
||||||
const id = subpaths[2];
|
|
||||||
|
|
||||||
// Click the "Save for Later" button to save this submission
|
|
||||||
cy.get('ds-submission-form-footer [data-test="save-for-later"]').click();
|
|
||||||
|
|
||||||
// "Save for Later" should send us to MyDSpace
|
|
||||||
cy.url().should('include', '/mydspace');
|
|
||||||
|
|
||||||
// Close any open notifications, to make sure they don't get in the way of next steps
|
|
||||||
cy.get('[data-dismiss="alert"]').click({multiple: true});
|
|
||||||
|
|
||||||
// This is the GET command that will actually run the search
|
|
||||||
cy.intercept('GET', '/server/api/discover/search/objects*').as('search-results');
|
|
||||||
// On MyDSpace, find the submission we just created via its ID
|
|
||||||
cy.get('[data-test="search-box"]').type(id);
|
|
||||||
cy.get('[data-test="search-button"]').click();
|
|
||||||
|
|
||||||
// Wait for search results to come back from the above GET command
|
|
||||||
cy.wait('@search-results');
|
|
||||||
|
|
||||||
// Click the Edit button for this in-progress submission
|
|
||||||
cy.get('#edit_' + id).click();
|
|
||||||
|
|
||||||
// Should send us back to the submission form
|
|
||||||
cy.url().should('include', '/workspaceitems/' + id + '/edit');
|
|
||||||
|
|
||||||
// Discard our new submission by clicking Discard in Submission form & confirming
|
|
||||||
cy.get('ds-submission-form-footer [data-test="discard"]').click();
|
|
||||||
cy.get('button#discard_submit').click();
|
|
||||||
|
|
||||||
// Discarding should send us back to MyDSpace
|
|
||||||
cy.url().should('include', '/mydspace');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should let you import from external sources', () => {
|
|
||||||
cy.visit('/mydspace');
|
|
||||||
|
|
||||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
|
||||||
|
|
||||||
// Open the New Import dropdown
|
|
||||||
cy.get('button[data-test="import-dropdown"]').click();
|
|
||||||
// Click on the "Item" type in that dropdown
|
|
||||||
cy.get('#importControlsDropdownMenu button[title="none"]').click();
|
|
||||||
|
|
||||||
// New URL should include /import-external, as we've moved to the import page
|
|
||||||
cy.url().should('include', '/import-external');
|
|
||||||
|
|
||||||
// The external import searchbox should be visible
|
|
||||||
cy.get('ds-submission-import-external-searchbar').should('be.visible');
|
|
||||||
|
|
||||||
// Test for accessibility issues
|
|
||||||
testA11y('ds-submission-import-external');
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -1,18 +1,18 @@
|
|||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
|
||||||
describe('PageNotFound', () => {
|
describe('PageNotFound', () => {
|
||||||
it('should contain element ds-pagenotfound when navigating to page that doesnt exist', () => {
|
it('should contain element ds-pagenotfound when navigating to page that doesnt exist', () => {
|
||||||
// request an invalid page (UUIDs at root path aren't valid)
|
// request an invalid page (UUIDs at root path aren't valid)
|
||||||
cy.visit('/e9019a69-d4f1-4773-b6a3-bd362caa46f2', { failOnStatusCode: false });
|
cy.visit('/e9019a69-d4f1-4773-b6a3-bd362caa46f2', { failOnStatusCode: false });
|
||||||
cy.get('ds-pagenotfound').should('be.visible');
|
cy.get('ds-pagenotfound').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-pagenotfound> for accessibility issues
|
// Analyze <ds-pagenotfound> for accessibility issues
|
||||||
testA11y('ds-pagenotfound');
|
testA11y('ds-pagenotfound');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not contain element ds-pagenotfound when navigating to existing page', () => {
|
it('should not contain element ds-pagenotfound when navigating to existing page', () => {
|
||||||
cy.visit('/home');
|
cy.visit('/home');
|
||||||
cy.get('ds-pagenotfound').should('not.exist');
|
cy.get('ds-pagenotfound').should('not.exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -1,64 +1,64 @@
|
|||||||
const page = {
|
const page = {
|
||||||
fillOutQueryInNavBar(query) {
|
fillOutQueryInNavBar(query) {
|
||||||
// Click the magnifying glass
|
// Click the magnifying glass
|
||||||
cy.get('ds-themed-header [data-test="header-search-icon"]').click();
|
cy.get('ds-themed-header [data-test="header-search-icon"]').click();
|
||||||
// Fill out a query in input that appears
|
// Fill out a query in input that appears
|
||||||
cy.get('ds-themed-header [data-test="header-search-box"]').type(query);
|
cy.get('ds-themed-header [data-test="header-search-box"]').type(query);
|
||||||
},
|
},
|
||||||
submitQueryByPressingEnter() {
|
submitQueryByPressingEnter() {
|
||||||
cy.get('ds-themed-header [data-test="header-search-box"]').type('{enter}');
|
cy.get('ds-themed-header [data-test="header-search-box"]').type('{enter}');
|
||||||
},
|
},
|
||||||
submitQueryByPressingIcon() {
|
submitQueryByPressingIcon() {
|
||||||
cy.get('ds-themed-header [data-test="header-search-icon"]').click();
|
cy.get('ds-themed-header [data-test="header-search-icon"]').click();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('Search from Navigation Bar', () => {
|
describe('Search from Navigation Bar', () => {
|
||||||
// NOTE: these tests currently assume this query will return results!
|
// NOTE: these tests currently assume this query will return results!
|
||||||
const query = Cypress.env('DSPACE_TEST_SEARCH_TERM');
|
const query = Cypress.env('DSPACE_TEST_SEARCH_TERM');
|
||||||
|
|
||||||
it('should go to search page with correct query if submitted (from home)', () => {
|
it('should go to search page with correct query if submitted (from home)', () => {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
// This is the GET command that will actually run the search
|
// This is the GET command that will actually run the search
|
||||||
cy.intercept('GET', '/server/api/discover/search/objects*').as('search-results');
|
cy.intercept('GET', '/server/api/discover/search/objects*').as('search-results');
|
||||||
// Run the search
|
// Run the search
|
||||||
page.fillOutQueryInNavBar(query);
|
page.fillOutQueryInNavBar(query);
|
||||||
page.submitQueryByPressingEnter();
|
page.submitQueryByPressingEnter();
|
||||||
// New URL should include query param
|
// New URL should include query param
|
||||||
cy.url().should('include', 'query='.concat(query));
|
cy.url().should('include', 'query='.concat(query));
|
||||||
// Wait for search results to come back from the above GET command
|
// Wait for search results to come back from the above GET command
|
||||||
cy.wait('@search-results');
|
cy.wait('@search-results');
|
||||||
// At least one search result should be displayed
|
// At least one search result should be displayed
|
||||||
cy.get('[data-test="list-object"]').should('be.visible');
|
cy.get('[data-test="list-object"]').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should go to search page with correct query if submitted (from search)', () => {
|
it('should go to search page with correct query if submitted (from search)', () => {
|
||||||
cy.visit('/search');
|
cy.visit('/search');
|
||||||
// This is the GET command that will actually run the search
|
// This is the GET command that will actually run the search
|
||||||
cy.intercept('GET', '/server/api/discover/search/objects*').as('search-results');
|
cy.intercept('GET', '/server/api/discover/search/objects*').as('search-results');
|
||||||
// Run the search
|
// Run the search
|
||||||
page.fillOutQueryInNavBar(query);
|
page.fillOutQueryInNavBar(query);
|
||||||
page.submitQueryByPressingEnter();
|
page.submitQueryByPressingEnter();
|
||||||
// New URL should include query param
|
// New URL should include query param
|
||||||
cy.url().should('include', 'query='.concat(query));
|
cy.url().should('include', 'query='.concat(query));
|
||||||
// Wait for search results to come back from the above GET command
|
// Wait for search results to come back from the above GET command
|
||||||
cy.wait('@search-results');
|
cy.wait('@search-results');
|
||||||
// At least one search result should be displayed
|
// At least one search result should be displayed
|
||||||
cy.get('[data-test="list-object"]').should('be.visible');
|
cy.get('[data-test="list-object"]').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should allow user to also submit query by clicking icon', () => {
|
it('should allow user to also submit query by clicking icon', () => {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
// This is the GET command that will actually run the search
|
// This is the GET command that will actually run the search
|
||||||
cy.intercept('GET', '/server/api/discover/search/objects*').as('search-results');
|
cy.intercept('GET', '/server/api/discover/search/objects*').as('search-results');
|
||||||
// Run the search
|
// Run the search
|
||||||
page.fillOutQueryInNavBar(query);
|
page.fillOutQueryInNavBar(query);
|
||||||
page.submitQueryByPressingIcon();
|
page.submitQueryByPressingIcon();
|
||||||
// New URL should include query param
|
// New URL should include query param
|
||||||
cy.url().should('include', 'query='.concat(query));
|
cy.url().should('include', 'query='.concat(query));
|
||||||
// Wait for search results to come back from the above GET command
|
// Wait for search results to come back from the above GET command
|
||||||
cy.wait('@search-results');
|
cy.wait('@search-results');
|
||||||
// At least one search result should be displayed
|
// At least one search result should be displayed
|
||||||
cy.get('[data-test="list-object"]').should('be.visible');
|
cy.get('[data-test="list-object"]').should('be.visible');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,57 +1,57 @@
|
|||||||
import { Options } from 'cypress-axe';
|
|
||||||
import { testA11y } from 'cypress/support/utils';
|
import { testA11y } from 'cypress/support/utils';
|
||||||
|
import { Options } from 'cypress-axe';
|
||||||
|
|
||||||
describe('Search Page', () => {
|
describe('Search Page', () => {
|
||||||
// NOTE: these tests currently assume this query will return results!
|
// NOTE: these tests currently assume this query will return results!
|
||||||
const query = Cypress.env('DSPACE_TEST_SEARCH_TERM');
|
const query = Cypress.env('DSPACE_TEST_SEARCH_TERM');
|
||||||
|
|
||||||
it('should redirect to the correct url when query was set and submit button was triggered', () => {
|
it('should redirect to the correct url when query was set and submit button was triggered', () => {
|
||||||
const queryString = 'Another interesting query string';
|
const queryString = 'Another interesting query string';
|
||||||
cy.visit('/search');
|
cy.visit('/search');
|
||||||
// Type query in searchbox & click search button
|
// Type query in searchbox & click search button
|
||||||
cy.get('[data-test="search-box"]').type(queryString);
|
cy.get('[data-test="search-box"]').type(queryString);
|
||||||
cy.get('[data-test="search-button"]').click();
|
cy.get('[data-test="search-button"]').click();
|
||||||
cy.url().should('include', 'query=' + encodeURI(queryString));
|
cy.url().should('include', 'query=' + encodeURI(queryString));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load results and pass accessibility tests', () => {
|
it('should load results and pass accessibility tests', () => {
|
||||||
cy.visit('/search?query='.concat(query));
|
cy.visit('/search?query='.concat(query));
|
||||||
cy.get('[data-test="search-box"]').should('have.value', query);
|
cy.get('[data-test="search-box"]').should('have.value', query);
|
||||||
|
|
||||||
// <ds-search-page> tag must be loaded
|
// <ds-search-page> tag must be loaded
|
||||||
cy.get('ds-search-page').should('be.visible');
|
cy.get('ds-search-page').should('be.visible');
|
||||||
|
|
||||||
// At least one search result should be displayed
|
// At least one search result should be displayed
|
||||||
cy.get('[data-test="list-object"]').should('be.visible');
|
cy.get('[data-test="list-object"]').should('be.visible');
|
||||||
|
|
||||||
// Click each filter toggle to open *every* filter
|
// Click each filter toggle to open *every* filter
|
||||||
// (As we want to scan filter section for accessibility issues as well)
|
// (As we want to scan filter section for accessibility issues as well)
|
||||||
cy.get('[data-test="filter-toggle"]').click({ multiple: true });
|
cy.get('[data-test="filter-toggle"]').click({ multiple: true });
|
||||||
|
|
||||||
// Analyze <ds-search-page> for accessibility issues
|
// Analyze <ds-search-page> for accessibility issues
|
||||||
testA11y('ds-search-page');
|
testA11y('ds-search-page');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have a working grid view that passes accessibility tests', () => {
|
it('should have a working grid view that passes accessibility tests', () => {
|
||||||
cy.visit('/search?query='.concat(query));
|
cy.visit('/search?query='.concat(query));
|
||||||
|
|
||||||
// Click button in sidebar to display grid view
|
// Click button in sidebar to display grid view
|
||||||
cy.get('ds-search-sidebar [data-test="grid-view"]').click();
|
cy.get('ds-search-sidebar [data-test="grid-view"]').click();
|
||||||
|
|
||||||
// <ds-search-page> tag must be loaded
|
// <ds-search-page> tag must be loaded
|
||||||
cy.get('ds-search-page').should('be.visible');
|
cy.get('ds-search-page').should('be.visible');
|
||||||
|
|
||||||
// At least one grid object (card) should be displayed
|
// At least one grid object (card) should be displayed
|
||||||
cy.get('[data-test="grid-object"]').should('be.visible');
|
cy.get('[data-test="grid-object"]').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-search-page> for accessibility issues
|
// Analyze <ds-search-page> for accessibility issues
|
||||||
testA11y('ds-search-page',
|
testA11y('ds-search-page',
|
||||||
{
|
{
|
||||||
rules: {
|
rules: {
|
||||||
// Card titles fail this test currently
|
// Card titles fail this test currently
|
||||||
'heading-order': { enabled: false }
|
'heading-order': { enabled: false },
|
||||||
}
|
},
|
||||||
} as Options
|
} as Options,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -4,224 +4,224 @@ import { Options } from 'cypress-axe';
|
|||||||
|
|
||||||
describe('New Submission page', () => {
|
describe('New Submission page', () => {
|
||||||
|
|
||||||
// NOTE: We already test that new Item submissions can be started from MyDSpace in my-dspace.spec.ts
|
// NOTE: We already test that new Item submissions can be started from MyDSpace in my-dspace.spec.ts
|
||||||
it('should create a new submission when using /submit path & pass accessibility', () => {
|
it('should create a new submission when using /submit path & pass accessibility', () => {
|
||||||
// Test that calling /submit with collection & entityType will create a new submission
|
// Test that calling /submit with collection & entityType will create a new submission
|
||||||
cy.visit('/submit?collection='.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_UUID')).concat('&entityType=none'));
|
cy.visit('/submit?collection='.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_UUID')).concat('&entityType=none'));
|
||||||
|
|
||||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||||
|
|
||||||
// Should redirect to /workspaceitems, as we've started a new submission
|
// Should redirect to /workspaceitems, as we've started a new submission
|
||||||
cy.url().should('include', '/workspaceitems');
|
cy.url().should('include', '/workspaceitems');
|
||||||
|
|
||||||
// The Submission edit form tag should be visible
|
// The Submission edit form tag should be visible
|
||||||
cy.get('ds-submission-edit').should('be.visible');
|
cy.get('ds-submission-edit').should('be.visible');
|
||||||
|
|
||||||
// A Collection menu button should exist & it's value should be the selected collection
|
// A Collection menu button should exist & it's value should be the selected collection
|
||||||
cy.get('#collectionControlsMenuButton span').should('have.text', Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME'));
|
cy.get('#collectionControlsMenuButton span').should('have.text', Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME'));
|
||||||
|
|
||||||
// 4 sections should be visible by default
|
// 4 sections should be visible by default
|
||||||
cy.get('div#section_traditionalpageone').should('be.visible');
|
cy.get('div#section_traditionalpageone').should('be.visible');
|
||||||
cy.get('div#section_traditionalpagetwo').should('be.visible');
|
cy.get('div#section_traditionalpagetwo').should('be.visible');
|
||||||
cy.get('div#section_upload').should('be.visible');
|
cy.get('div#section_upload').should('be.visible');
|
||||||
cy.get('div#section_license').should('be.visible');
|
cy.get('div#section_license').should('be.visible');
|
||||||
|
|
||||||
// Test entire page for accessibility
|
// Test entire page for accessibility
|
||||||
testA11y('ds-submission-edit',
|
testA11y('ds-submission-edit',
|
||||||
{
|
{
|
||||||
rules: {
|
rules: {
|
||||||
// Author & Subject fields have invalid "aria-multiline" attrs.
|
// Author & Subject fields have invalid "aria-multiline" attrs.
|
||||||
// See https://github.com/DSpace/dspace-angular/issues/1272
|
// See https://github.com/DSpace/dspace-angular/issues/1272
|
||||||
'aria-allowed-attr': { enabled: false },
|
'aria-allowed-attr': { enabled: false },
|
||||||
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
|
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
|
||||||
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
|
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
|
||||||
'aria-required-children': { enabled: false },
|
'aria-required-children': { enabled: false },
|
||||||
'nested-interactive': { enabled: false },
|
'nested-interactive': { enabled: false },
|
||||||
// All select boxes fail to have a name / aria-label.
|
// All select boxes fail to have a name / aria-label.
|
||||||
// This is a bug in ng-dynamic-forms and may require https://github.com/DSpace/dspace-angular/issues/2216
|
// This is a bug in ng-dynamic-forms and may require https://github.com/DSpace/dspace-angular/issues/2216
|
||||||
'select-name': { enabled: false },
|
'select-name': { enabled: false },
|
||||||
}
|
},
|
||||||
|
|
||||||
} as Options
|
} as Options,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Discard button should work
|
// Discard button should work
|
||||||
// Clicking it will display a confirmation, which we will confirm with another click
|
// Clicking it will display a confirmation, which we will confirm with another click
|
||||||
cy.get('button#discard').click();
|
cy.get('button#discard').click();
|
||||||
cy.get('button#discard_submit').click();
|
cy.get('button#discard_submit').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should block submission & show errors if required fields are missing', () => {
|
||||||
|
// Create a new submission
|
||||||
|
cy.visit('/submit?collection='.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_UUID')).concat('&entityType=none'));
|
||||||
|
|
||||||
|
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||||
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||||
|
|
||||||
|
// Attempt an immediate deposit without filling out any fields
|
||||||
|
cy.get('button#deposit').click();
|
||||||
|
|
||||||
|
// A warning alert should display.
|
||||||
|
cy.get('ds-notification div.alert-success').should('not.exist');
|
||||||
|
cy.get('ds-notification div.alert-warning').should('be.visible');
|
||||||
|
|
||||||
|
// First section should have an exclamation error in the header
|
||||||
|
// (as it has required fields)
|
||||||
|
cy.get('div#traditionalpageone-header i.fa-exclamation-circle').should('be.visible');
|
||||||
|
|
||||||
|
// Title field should have class "is-invalid" applied, as it's required
|
||||||
|
cy.get('input#dc_title').should('have.class', 'is-invalid');
|
||||||
|
|
||||||
|
// Date Year field should also have "is-valid" class
|
||||||
|
cy.get('input#dc_date_issued_year').should('have.class', 'is-invalid');
|
||||||
|
|
||||||
|
// FINALLY, cleanup after ourselves. This also exercises the MyDSpace delete button.
|
||||||
|
// Get our Submission URL, to parse out the ID of this submission
|
||||||
|
cy.location().then(fullUrl => {
|
||||||
|
// This will be the full path (/workspaceitems/[id]/edit)
|
||||||
|
const path = fullUrl.pathname;
|
||||||
|
// Split on the slashes
|
||||||
|
const subpaths = path.split('/');
|
||||||
|
// Part 2 will be the [id] of the submission
|
||||||
|
const id = subpaths[2];
|
||||||
|
|
||||||
|
// Even though form is incomplete, the "Save for Later" button should still work
|
||||||
|
cy.get('button#saveForLater').click();
|
||||||
|
|
||||||
|
// "Save for Later" should send us to MyDSpace
|
||||||
|
cy.url().should('include', '/mydspace');
|
||||||
|
|
||||||
|
// A success alert should be visible
|
||||||
|
cy.get('ds-notification div.alert-success').should('be.visible');
|
||||||
|
// Now, dismiss any open alert boxes (may be multiple, as tests run quickly)
|
||||||
|
cy.get('[data-dismiss="alert"]').click({ multiple: true });
|
||||||
|
|
||||||
|
// This is the GET command that will actually run the search
|
||||||
|
cy.intercept('GET', '/server/api/discover/search/objects*').as('search-results');
|
||||||
|
// On MyDSpace, find the submission we just saved via its ID
|
||||||
|
cy.get('[data-test="search-box"]').type(id);
|
||||||
|
cy.get('[data-test="search-button"]').click();
|
||||||
|
|
||||||
|
// Wait for search results to come back from the above GET command
|
||||||
|
cy.wait('@search-results');
|
||||||
|
|
||||||
|
// Delete our created submission & confirm deletion
|
||||||
|
cy.get('button#delete_' + id).click();
|
||||||
|
cy.get('button#delete_confirm').click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should allow for deposit if all required fields completed & file uploaded', () => {
|
||||||
|
// Create a new submission
|
||||||
|
cy.visit('/submit?collection='.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_UUID')).concat('&entityType=none'));
|
||||||
|
|
||||||
|
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||||
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||||
|
|
||||||
|
// Fill out all required fields (Title, Date)
|
||||||
|
cy.get('input#dc_title').type('DSpace logo uploaded via e2e tests');
|
||||||
|
cy.get('input#dc_date_issued_year').type('2022');
|
||||||
|
|
||||||
|
// Confirm the required license by checking checkbox
|
||||||
|
// (NOTE: requires "force:true" cause Cypress claims this checkbox is covered by its own <span>)
|
||||||
|
cy.get('input#granted').check( { force: true } );
|
||||||
|
|
||||||
|
// Before using Cypress drag & drop, we have to manually trigger the "dragover" event.
|
||||||
|
// This ensures our UI displays the dropzone that covers the entire submission page.
|
||||||
|
// (For some reason Cypress drag & drop doesn't trigger this even itself & upload won't work without this trigger)
|
||||||
|
cy.get('ds-uploader').trigger('dragover');
|
||||||
|
|
||||||
|
// This is the POST command that will upload the file
|
||||||
|
cy.intercept('POST', '/server/api/submission/workspaceitems/*').as('upload');
|
||||||
|
|
||||||
|
// Upload our DSpace logo via drag & drop onto submission form
|
||||||
|
// cy.get('div#section_upload')
|
||||||
|
cy.get('div.ds-document-drop-zone').selectFile('src/assets/images/dspace-logo.png', {
|
||||||
|
action: 'drag-drop',
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should block submission & show errors if required fields are missing', () => {
|
// Wait for upload to complete before proceeding
|
||||||
// Create a new submission
|
cy.wait('@upload');
|
||||||
cy.visit('/submit?collection='.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_UUID')).concat('&entityType=none'));
|
|
||||||
|
|
||||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
// Wait for deposit button to not be disabled & click it.
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
cy.get('button#deposit').should('not.be.disabled').click();
|
||||||
|
|
||||||
// Attempt an immediate deposit without filling out any fields
|
// No warnings should exist. Instead, just successful deposit alert is displayed
|
||||||
cy.get('button#deposit').click();
|
cy.get('ds-notification div.alert-warning').should('not.exist');
|
||||||
|
cy.get('ds-notification div.alert-success').should('be.visible');
|
||||||
|
});
|
||||||
|
|
||||||
// A warning alert should display.
|
it('is possible to submit a new "Person" and that form passes accessibility', () => {
|
||||||
cy.get('ds-notification div.alert-success').should('not.exist');
|
// To submit a different entity type, we'll start from MyDSpace
|
||||||
cy.get('ds-notification div.alert-warning').should('be.visible');
|
cy.visit('/mydspace');
|
||||||
|
|
||||||
// First section should have an exclamation error in the header
|
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||||
// (as it has required fields)
|
// NOTE: At this time, we MUST login as admin to submit Person objects
|
||||||
cy.get('div#traditionalpageone-header i.fa-exclamation-circle').should('be.visible');
|
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||||
|
|
||||||
// Title field should have class "is-invalid" applied, as it's required
|
// Open the New Submission dropdown
|
||||||
cy.get('input#dc_title').should('have.class', 'is-invalid');
|
cy.get('button[data-test="submission-dropdown"]').click();
|
||||||
|
// Click on the "Person" type in that dropdown
|
||||||
|
cy.get('#entityControlsDropdownMenu button[title="Person"]').click();
|
||||||
|
|
||||||
// Date Year field should also have "is-valid" class
|
// This should display the <ds-create-item-parent-selector> (popup window)
|
||||||
cy.get('input#dc_date_issued_year').should('have.class', 'is-invalid');
|
cy.get('ds-create-item-parent-selector').should('be.visible');
|
||||||
|
|
||||||
// FINALLY, cleanup after ourselves. This also exercises the MyDSpace delete button.
|
// Type in a known Collection name in the search box
|
||||||
// Get our Submission URL, to parse out the ID of this submission
|
cy.get('ds-authorized-collection-selector input[type="search"]').type(Cypress.env('DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME'));
|
||||||
cy.location().then(fullUrl => {
|
|
||||||
// This will be the full path (/workspaceitems/[id]/edit)
|
|
||||||
const path = fullUrl.pathname;
|
|
||||||
// Split on the slashes
|
|
||||||
const subpaths = path.split('/');
|
|
||||||
// Part 2 will be the [id] of the submission
|
|
||||||
const id = subpaths[2];
|
|
||||||
|
|
||||||
// Even though form is incomplete, the "Save for Later" button should still work
|
// Click on the button matching that known Collection name
|
||||||
cy.get('button#saveForLater').click();
|
cy.get('ds-authorized-collection-selector button[title="'.concat(Cypress.env('DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME')).concat('"]')).click();
|
||||||
|
|
||||||
// "Save for Later" should send us to MyDSpace
|
// New URL should include /workspaceitems, as we've started a new submission
|
||||||
cy.url().should('include', '/mydspace');
|
cy.url().should('include', '/workspaceitems');
|
||||||
|
|
||||||
// A success alert should be visible
|
// The Submission edit form tag should be visible
|
||||||
cy.get('ds-notification div.alert-success').should('be.visible');
|
cy.get('ds-submission-edit').should('be.visible');
|
||||||
// Now, dismiss any open alert boxes (may be multiple, as tests run quickly)
|
|
||||||
cy.get('[data-dismiss="alert"]').click({multiple: true});
|
|
||||||
|
|
||||||
// This is the GET command that will actually run the search
|
// A Collection menu button should exist & its value should be the selected collection
|
||||||
cy.intercept('GET', '/server/api/discover/search/objects*').as('search-results');
|
cy.get('#collectionControlsMenuButton span').should('have.text', Cypress.env('DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME'));
|
||||||
// On MyDSpace, find the submission we just saved via its ID
|
|
||||||
cy.get('[data-test="search-box"]').type(id);
|
|
||||||
cy.get('[data-test="search-button"]').click();
|
|
||||||
|
|
||||||
// Wait for search results to come back from the above GET command
|
// 3 sections should be visible by default
|
||||||
cy.wait('@search-results');
|
cy.get('div#section_personStep').should('be.visible');
|
||||||
|
cy.get('div#section_upload').should('be.visible');
|
||||||
|
cy.get('div#section_license').should('be.visible');
|
||||||
|
|
||||||
// Delete our created submission & confirm deletion
|
// Test entire page for accessibility
|
||||||
cy.get('button#delete_' + id).click();
|
testA11y('ds-submission-edit',
|
||||||
cy.get('button#delete_confirm').click();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should allow for deposit if all required fields completed & file uploaded', () => {
|
|
||||||
// Create a new submission
|
|
||||||
cy.visit('/submit?collection='.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_UUID')).concat('&entityType=none'));
|
|
||||||
|
|
||||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
|
||||||
|
|
||||||
// Fill out all required fields (Title, Date)
|
|
||||||
cy.get('input#dc_title').type('DSpace logo uploaded via e2e tests');
|
|
||||||
cy.get('input#dc_date_issued_year').type('2022');
|
|
||||||
|
|
||||||
// Confirm the required license by checking checkbox
|
|
||||||
// (NOTE: requires "force:true" cause Cypress claims this checkbox is covered by its own <span>)
|
|
||||||
cy.get('input#granted').check( {force: true} );
|
|
||||||
|
|
||||||
// Before using Cypress drag & drop, we have to manually trigger the "dragover" event.
|
|
||||||
// This ensures our UI displays the dropzone that covers the entire submission page.
|
|
||||||
// (For some reason Cypress drag & drop doesn't trigger this even itself & upload won't work without this trigger)
|
|
||||||
cy.get('ds-uploader').trigger('dragover');
|
|
||||||
|
|
||||||
// This is the POST command that will upload the file
|
|
||||||
cy.intercept('POST', '/server/api/submission/workspaceitems/*').as('upload');
|
|
||||||
|
|
||||||
// Upload our DSpace logo via drag & drop onto submission form
|
|
||||||
// cy.get('div#section_upload')
|
|
||||||
cy.get('div.ds-document-drop-zone').selectFile('src/assets/images/dspace-logo.png', {
|
|
||||||
action: 'drag-drop'
|
|
||||||
});
|
|
||||||
|
|
||||||
// Wait for upload to complete before proceeding
|
|
||||||
cy.wait('@upload');
|
|
||||||
|
|
||||||
// Wait for deposit button to not be disabled & click it.
|
|
||||||
cy.get('button#deposit').should('not.be.disabled').click();
|
|
||||||
|
|
||||||
// No warnings should exist. Instead, just successful deposit alert is displayed
|
|
||||||
cy.get('ds-notification div.alert-warning').should('not.exist');
|
|
||||||
cy.get('ds-notification div.alert-success').should('be.visible');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('is possible to submit a new "Person" and that form passes accessibility', () => {
|
|
||||||
// To submit a different entity type, we'll start from MyDSpace
|
|
||||||
cy.visit('/mydspace');
|
|
||||||
|
|
||||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
|
||||||
// NOTE: At this time, we MUST login as admin to submit Person objects
|
|
||||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
|
||||||
|
|
||||||
// Open the New Submission dropdown
|
|
||||||
cy.get('button[data-test="submission-dropdown"]').click();
|
|
||||||
// Click on the "Person" type in that dropdown
|
|
||||||
cy.get('#entityControlsDropdownMenu button[title="Person"]').click();
|
|
||||||
|
|
||||||
// This should display the <ds-create-item-parent-selector> (popup window)
|
|
||||||
cy.get('ds-create-item-parent-selector').should('be.visible');
|
|
||||||
|
|
||||||
// Type in a known Collection name in the search box
|
|
||||||
cy.get('ds-authorized-collection-selector input[type="search"]').type(Cypress.env('DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME'));
|
|
||||||
|
|
||||||
// Click on the button matching that known Collection name
|
|
||||||
cy.get('ds-authorized-collection-selector button[title="'.concat(Cypress.env('DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME')).concat('"]')).click();
|
|
||||||
|
|
||||||
// New URL should include /workspaceitems, as we've started a new submission
|
|
||||||
cy.url().should('include', '/workspaceitems');
|
|
||||||
|
|
||||||
// The Submission edit form tag should be visible
|
|
||||||
cy.get('ds-submission-edit').should('be.visible');
|
|
||||||
|
|
||||||
// A Collection menu button should exist & its value should be the selected collection
|
|
||||||
cy.get('#collectionControlsMenuButton span').should('have.text', Cypress.env('DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME'));
|
|
||||||
|
|
||||||
// 3 sections should be visible by default
|
|
||||||
cy.get('div#section_personStep').should('be.visible');
|
|
||||||
cy.get('div#section_upload').should('be.visible');
|
|
||||||
cy.get('div#section_license').should('be.visible');
|
|
||||||
|
|
||||||
// Test entire page for accessibility
|
|
||||||
testA11y('ds-submission-edit',
|
|
||||||
{
|
{
|
||||||
rules: {
|
rules: {
|
||||||
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
|
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
|
||||||
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
|
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
|
||||||
'aria-required-children': { enabled: false },
|
'aria-required-children': { enabled: false },
|
||||||
'nested-interactive': { enabled: false },
|
'nested-interactive': { enabled: false },
|
||||||
}
|
},
|
||||||
|
|
||||||
} as Options
|
} as Options,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Click the lookup button next to "Publication" field
|
// Click the lookup button next to "Publication" field
|
||||||
cy.get('button[data-test="lookup-button"]').click();
|
cy.get('button[data-test="lookup-button"]').click();
|
||||||
|
|
||||||
// A popup modal window should be visible
|
// A popup modal window should be visible
|
||||||
cy.get('ds-dynamic-lookup-relation-modal').should('be.visible');
|
cy.get('ds-dynamic-lookup-relation-modal').should('be.visible');
|
||||||
|
|
||||||
// Popup modal should also pass accessibility tests
|
// Popup modal should also pass accessibility tests
|
||||||
//testA11y('ds-dynamic-lookup-relation-modal');
|
//testA11y('ds-dynamic-lookup-relation-modal');
|
||||||
testA11y({
|
testA11y({
|
||||||
include: ['ds-dynamic-lookup-relation-modal'],
|
include: ['ds-dynamic-lookup-relation-modal'],
|
||||||
exclude: [
|
exclude: [
|
||||||
['ul.nav-tabs'] // Tabs at top of model have several issues which seem to be caused by ng-bootstrap
|
['ul.nav-tabs'], // Tabs at top of model have several issues which seem to be caused by ng-bootstrap
|
||||||
],
|
],
|
||||||
});
|
|
||||||
|
|
||||||
// Close popup window
|
|
||||||
cy.get('ds-dynamic-lookup-relation-modal button.close').click();
|
|
||||||
|
|
||||||
// Back on the form, click the discard button to remove new submission
|
|
||||||
// Clicking it will display a confirmation, which we will confirm with another click
|
|
||||||
cy.get('button#discard').click();
|
|
||||||
cy.get('button#discard_submit').click();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Close popup window
|
||||||
|
cy.get('ds-dynamic-lookup-relation-modal button.close').click();
|
||||||
|
|
||||||
|
// Back on the form, click the discard button to remove new submission
|
||||||
|
// Clicking it will display a confirmation, which we will confirm with another click
|
||||||
|
cy.get('button#discard').click();
|
||||||
|
cy.get('button#discard_submit').click();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -9,51 +9,51 @@ let REST_DOMAIN: string;
|
|||||||
// Plugins enable you to tap into, modify, or extend the internal behavior of Cypress
|
// Plugins enable you to tap into, modify, or extend the internal behavior of Cypress
|
||||||
// For more info, visit https://on.cypress.io/plugins-api
|
// For more info, visit https://on.cypress.io/plugins-api
|
||||||
module.exports = (on, config) => {
|
module.exports = (on, config) => {
|
||||||
on('task', {
|
on('task', {
|
||||||
// Define "log" and "table" tasks, used for logging accessibility errors during CI
|
// Define "log" and "table" tasks, used for logging accessibility errors during CI
|
||||||
// Borrowed from https://github.com/component-driven/cypress-axe#in-cypress-plugins-file
|
// Borrowed from https://github.com/component-driven/cypress-axe#in-cypress-plugins-file
|
||||||
log(message: string) {
|
log(message: string) {
|
||||||
console.log(message);
|
console.log(message);
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
table(message: string) {
|
table(message: string) {
|
||||||
console.table(message);
|
console.table(message);
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
// Cypress doesn't have access to the running application in Node.js.
|
// Cypress doesn't have access to the running application in Node.js.
|
||||||
// So, it's not possible to inject or load the AppConfig or environment of the Angular UI.
|
// So, it's not possible to inject or load the AppConfig or environment of the Angular UI.
|
||||||
// Instead, we'll read our running application's config.json, which contains the configs &
|
// Instead, we'll read our running application's config.json, which contains the configs &
|
||||||
// is regenerated at runtime each time the Angular UI application starts up.
|
// is regenerated at runtime each time the Angular UI application starts up.
|
||||||
readUIConfig() {
|
readUIConfig() {
|
||||||
// Check if we have a config.json in the src/assets. If so, use that.
|
// Check if we have a config.json in the src/assets. If so, use that.
|
||||||
// This is where it's written when running "ng e2e" or "yarn serve"
|
// This is where it's written when running "ng e2e" or "yarn serve"
|
||||||
if (fs.existsSync('./src/assets/config.json')) {
|
if (fs.existsSync('./src/assets/config.json')) {
|
||||||
return fs.readFileSync('./src/assets/config.json', 'utf8');
|
return fs.readFileSync('./src/assets/config.json', 'utf8');
|
||||||
// Otherwise, check the dist/browser/assets
|
// Otherwise, check the dist/browser/assets
|
||||||
// This is where it's written when running "serve:ssr", which is what CI uses to start the frontend
|
// This is where it's written when running "serve:ssr", which is what CI uses to start the frontend
|
||||||
} else if (fs.existsSync('./dist/browser/assets/config.json')) {
|
} else if (fs.existsSync('./dist/browser/assets/config.json')) {
|
||||||
return fs.readFileSync('./dist/browser/assets/config.json', 'utf8');
|
return fs.readFileSync('./dist/browser/assets/config.json', 'utf8');
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
// Save value of REST Base URL, looked up before all tests.
|
// Save value of REST Base URL, looked up before all tests.
|
||||||
// This allows other tests to use it easily via getRestBaseURL() below.
|
// This allows other tests to use it easily via getRestBaseURL() below.
|
||||||
saveRestBaseURL(url: string) {
|
saveRestBaseURL(url: string) {
|
||||||
return (REST_BASE_URL = url);
|
return (REST_BASE_URL = url);
|
||||||
},
|
},
|
||||||
// Retrieve currently saved value of REST Base URL
|
// Retrieve currently saved value of REST Base URL
|
||||||
getRestBaseURL() {
|
getRestBaseURL() {
|
||||||
return REST_BASE_URL ;
|
return REST_BASE_URL ;
|
||||||
},
|
},
|
||||||
// Save value of REST Domain, looked up before all tests.
|
// Save value of REST Domain, looked up before all tests.
|
||||||
// This allows other tests to use it easily via getRestBaseDomain() below.
|
// This allows other tests to use it easily via getRestBaseDomain() below.
|
||||||
saveRestBaseDomain(domain: string) {
|
saveRestBaseDomain(domain: string) {
|
||||||
return (REST_DOMAIN = domain);
|
return (REST_DOMAIN = domain);
|
||||||
},
|
},
|
||||||
// Retrieve currently saved value of REST Domain
|
// Retrieve currently saved value of REST Domain
|
||||||
getRestBaseDomain() {
|
getRestBaseDomain() {
|
||||||
return REST_DOMAIN ;
|
return REST_DOMAIN ;
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@@ -3,8 +3,14 @@
|
|||||||
// See docs at https://docs.cypress.io/api/cypress-api/custom-commands
|
// See docs at https://docs.cypress.io/api/cypress-api/custom-commands
|
||||||
// ***********************************************
|
// ***********************************************
|
||||||
|
|
||||||
import { AuthTokenInfo, TOKENITEM } from 'src/app/core/auth/models/auth-token-info.model';
|
import {
|
||||||
import { DSPACE_XSRF_COOKIE, XSRF_REQUEST_HEADER } from 'src/app/core/xsrf/xsrf.constants';
|
AuthTokenInfo,
|
||||||
|
TOKENITEM,
|
||||||
|
} from 'src/app/core/auth/models/auth-token-info.model';
|
||||||
|
import {
|
||||||
|
DSPACE_XSRF_COOKIE,
|
||||||
|
XSRF_REQUEST_HEADER,
|
||||||
|
} from 'src/app/core/xsrf/xsrf.constants';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
|
||||||
// Declare Cypress namespace to help with Intellisense & code completion in IDEs
|
// Declare Cypress namespace to help with Intellisense & code completion in IDEs
|
||||||
@@ -57,33 +63,33 @@ declare global {
|
|||||||
* @param password password to login as
|
* @param password password to login as
|
||||||
*/
|
*/
|
||||||
function login(email: string, password: string): void {
|
function login(email: string, password: string): void {
|
||||||
// Create a fake CSRF cookie/token to use in POST
|
// Create a fake CSRF cookie/token to use in POST
|
||||||
cy.createCSRFCookie().then((csrfToken: string) => {
|
cy.createCSRFCookie().then((csrfToken: string) => {
|
||||||
// get our REST API's base URL, also needed for POST
|
// get our REST API's base URL, also needed for POST
|
||||||
cy.task('getRestBaseURL').then((baseRestUrl: string) => {
|
cy.task('getRestBaseURL').then((baseRestUrl: string) => {
|
||||||
// Now, send login POST request including that CSRF token
|
// Now, send login POST request including that CSRF token
|
||||||
cy.request({
|
cy.request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: baseRestUrl + '/api/authn/login',
|
url: baseRestUrl + '/api/authn/login',
|
||||||
headers: { [XSRF_REQUEST_HEADER]: csrfToken},
|
headers: { [XSRF_REQUEST_HEADER]: csrfToken },
|
||||||
form: true, // indicates the body should be form urlencoded
|
form: true, // indicates the body should be form urlencoded
|
||||||
body: { user: email, password: password }
|
body: { user: email, password: password },
|
||||||
}).then((resp) => {
|
}).then((resp) => {
|
||||||
// We expect a successful login
|
// We expect a successful login
|
||||||
expect(resp.status).to.eq(200);
|
expect(resp.status).to.eq(200);
|
||||||
// We expect to have a valid authorization header returned (with our auth token)
|
// We expect to have a valid authorization header returned (with our auth token)
|
||||||
expect(resp.headers).to.have.property('authorization');
|
expect(resp.headers).to.have.property('authorization');
|
||||||
|
|
||||||
// Initialize our AuthTokenInfo object from the authorization header.
|
// Initialize our AuthTokenInfo object from the authorization header.
|
||||||
const authheader = resp.headers.authorization as string;
|
const authheader = resp.headers.authorization as string;
|
||||||
const authinfo: AuthTokenInfo = new AuthTokenInfo(authheader);
|
const authinfo: AuthTokenInfo = new AuthTokenInfo(authheader);
|
||||||
|
|
||||||
// Save our AuthTokenInfo object to our dsAuthInfo UI cookie
|
// Save our AuthTokenInfo object to our dsAuthInfo UI cookie
|
||||||
// This ensures the UI will recognize we are logged in on next "visit()"
|
// This ensures the UI will recognize we are logged in on next "visit()"
|
||||||
cy.setCookie(TOKENITEM, JSON.stringify(authinfo));
|
cy.setCookie(TOKENITEM, JSON.stringify(authinfo));
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// Add as a Cypress command (i.e. assign to 'cy.login')
|
// Add as a Cypress command (i.e. assign to 'cy.login')
|
||||||
Cypress.Commands.add('login', login);
|
Cypress.Commands.add('login', login);
|
||||||
@@ -94,12 +100,12 @@ Cypress.Commands.add('login', login);
|
|||||||
* @param password password to login as
|
* @param password password to login as
|
||||||
*/
|
*/
|
||||||
function loginViaForm(email: string, password: string): void {
|
function loginViaForm(email: string, password: string): void {
|
||||||
// Enter email
|
// Enter email
|
||||||
cy.get('ds-log-in [data-test="email"]').type(email);
|
cy.get('ds-log-in [data-test="email"]').type(email);
|
||||||
// Enter password
|
// Enter password
|
||||||
cy.get('ds-log-in [data-test="password"]').type(password);
|
cy.get('ds-log-in [data-test="password"]').type(password);
|
||||||
// Click login button
|
// Click login button
|
||||||
cy.get('ds-log-in [data-test="login-button"]').click();
|
cy.get('ds-log-in [data-test="login-button"]').click();
|
||||||
}
|
}
|
||||||
// Add as a Cypress command (i.e. assign to 'cy.loginViaForm')
|
// Add as a Cypress command (i.e. assign to 'cy.loginViaForm')
|
||||||
Cypress.Commands.add('loginViaForm', loginViaForm);
|
Cypress.Commands.add('loginViaForm', loginViaForm);
|
||||||
@@ -117,29 +123,29 @@ Cypress.Commands.add('loginViaForm', loginViaForm);
|
|||||||
* @param dsoType type of DSpace Object (e.g. "item", "collection", "community")
|
* @param dsoType type of DSpace Object (e.g. "item", "collection", "community")
|
||||||
*/
|
*/
|
||||||
function generateViewEvent(uuid: string, dsoType: string): void {
|
function generateViewEvent(uuid: string, dsoType: string): void {
|
||||||
// Create a fake CSRF cookie/token to use in POST
|
// Create a fake CSRF cookie/token to use in POST
|
||||||
cy.createCSRFCookie().then((csrfToken: string) => {
|
cy.createCSRFCookie().then((csrfToken: string) => {
|
||||||
// get our REST API's base URL, also needed for POST
|
// get our REST API's base URL, also needed for POST
|
||||||
cy.task('getRestBaseURL').then((baseRestUrl: string) => {
|
cy.task('getRestBaseURL').then((baseRestUrl: string) => {
|
||||||
// Now, send 'statistics/viewevents' POST request including that fake CSRF token in required header
|
// Now, send 'statistics/viewevents' POST request including that fake CSRF token in required header
|
||||||
cy.request({
|
cy.request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: baseRestUrl + '/api/statistics/viewevents',
|
url: baseRestUrl + '/api/statistics/viewevents',
|
||||||
headers: {
|
headers: {
|
||||||
[XSRF_REQUEST_HEADER] : csrfToken,
|
[XSRF_REQUEST_HEADER] : csrfToken,
|
||||||
// use a known public IP address to avoid being seen as a "bot"
|
// use a known public IP address to avoid being seen as a "bot"
|
||||||
'X-Forwarded-For': '1.1.1.1',
|
'X-Forwarded-For': '1.1.1.1',
|
||||||
// Use a user-agent of a Firefox browser on Windows. This again avoids being seen as a "bot"
|
// Use a user-agent of a Firefox browser on Windows. This again avoids being seen as a "bot"
|
||||||
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0',
|
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0',
|
||||||
},
|
},
|
||||||
//form: true, // indicates the body should be form urlencoded
|
//form: true, // indicates the body should be form urlencoded
|
||||||
body: { targetId: uuid, targetType: dsoType },
|
body: { targetId: uuid, targetType: dsoType },
|
||||||
}).then((resp) => {
|
}).then((resp) => {
|
||||||
// We expect a 201 (which means statistics event was created)
|
// We expect a 201 (which means statistics event was created)
|
||||||
expect(resp.status).to.eq(201);
|
expect(resp.status).to.eq(201);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// Add as a Cypress command (i.e. assign to 'cy.generateViewEvent')
|
// Add as a Cypress command (i.e. assign to 'cy.generateViewEvent')
|
||||||
Cypress.Commands.add('generateViewEvent', generateViewEvent);
|
Cypress.Commands.add('generateViewEvent', generateViewEvent);
|
||||||
@@ -153,17 +159,17 @@ Cypress.Commands.add('generateViewEvent', generateViewEvent);
|
|||||||
* @returns a Cypress Chainable which can be used to get the generated CSRF Token
|
* @returns a Cypress Chainable which can be used to get the generated CSRF Token
|
||||||
*/
|
*/
|
||||||
function createCSRFCookie(): Cypress.Chainable {
|
function createCSRFCookie(): Cypress.Chainable {
|
||||||
// Generate a new token which is a random UUID
|
// Generate a new token which is a random UUID
|
||||||
const csrfToken: string = uuidv4();
|
const csrfToken: string = uuidv4();
|
||||||
|
|
||||||
// Save it to our required cookie
|
// Save it to our required cookie
|
||||||
cy.task('getRestBaseDomain').then((baseDomain: string) => {
|
cy.task('getRestBaseDomain').then((baseDomain: string) => {
|
||||||
// Create a fake CSRF Token. Set it in the required server-side cookie
|
// Create a fake CSRF Token. Set it in the required server-side cookie
|
||||||
cy.setCookie(DSPACE_XSRF_COOKIE, csrfToken, { 'domain': baseDomain });
|
cy.setCookie(DSPACE_XSRF_COOKIE, csrfToken, { 'domain': baseDomain });
|
||||||
});
|
});
|
||||||
|
|
||||||
// return the generated token wrapped in a chainable
|
// return the generated token wrapped in a chainable
|
||||||
return cy.wrap(csrfToken);
|
return cy.wrap(csrfToken);
|
||||||
}
|
}
|
||||||
// Add as a Cypress command (i.e. assign to 'cy.createCSRFCookie')
|
// Add as a Cypress command (i.e. assign to 'cy.createCSRFCookie')
|
||||||
Cypress.Commands.add('createCSRFCookie', createCSRFCookie);
|
Cypress.Commands.add('createCSRFCookie', createCSRFCookie);
|
||||||
|
@@ -15,10 +15,10 @@
|
|||||||
|
|
||||||
// Import all custom Commands (from commands.ts) for all tests
|
// Import all custom Commands (from commands.ts) for all tests
|
||||||
import './commands';
|
import './commands';
|
||||||
|
|
||||||
// Import Cypress Axe tools for all tests
|
// Import Cypress Axe tools for all tests
|
||||||
// https://github.com/component-driven/cypress-axe
|
// https://github.com/component-driven/cypress-axe
|
||||||
import 'cypress-axe';
|
import 'cypress-axe';
|
||||||
|
|
||||||
import { DSPACE_XSRF_COOKIE } from 'src/app/core/xsrf/xsrf.constants';
|
import { DSPACE_XSRF_COOKIE } from 'src/app/core/xsrf/xsrf.constants';
|
||||||
|
|
||||||
// Runs once before all tests
|
// Runs once before all tests
|
||||||
@@ -34,18 +34,18 @@ before(() => {
|
|||||||
// Find URL of our REST API & save to global variable via task
|
// Find URL of our REST API & save to global variable via task
|
||||||
let baseRestUrl = FALLBACK_TEST_REST_BASE_URL;
|
let baseRestUrl = FALLBACK_TEST_REST_BASE_URL;
|
||||||
if (!config.rest.baseUrl) {
|
if (!config.rest.baseUrl) {
|
||||||
console.warn("Could not load 'rest.baseUrl' from config.json. Falling back to " + FALLBACK_TEST_REST_BASE_URL);
|
console.warn("Could not load 'rest.baseUrl' from config.json. Falling back to " + FALLBACK_TEST_REST_BASE_URL);
|
||||||
} else {
|
} else {
|
||||||
baseRestUrl = config.rest.baseUrl;
|
baseRestUrl = config.rest.baseUrl;
|
||||||
}
|
}
|
||||||
cy.task('saveRestBaseURL', baseRestUrl);
|
cy.task('saveRestBaseURL', baseRestUrl);
|
||||||
|
|
||||||
// Find domain of our REST API & save to global variable via task.
|
// Find domain of our REST API & save to global variable via task.
|
||||||
let baseDomain = FALLBACK_TEST_REST_DOMAIN;
|
let baseDomain = FALLBACK_TEST_REST_DOMAIN;
|
||||||
if (!config.rest.host) {
|
if (!config.rest.host) {
|
||||||
console.warn("Could not load 'rest.host' from config.json. Falling back to " + FALLBACK_TEST_REST_DOMAIN);
|
console.warn("Could not load 'rest.host' from config.json. Falling back to " + FALLBACK_TEST_REST_DOMAIN);
|
||||||
} else {
|
} else {
|
||||||
baseDomain = config.rest.host;
|
baseDomain = config.rest.host;
|
||||||
}
|
}
|
||||||
cy.task('saveRestBaseDomain', baseDomain);
|
cy.task('saveRestBaseDomain', baseDomain);
|
||||||
|
|
||||||
@@ -54,12 +54,12 @@ before(() => {
|
|||||||
|
|
||||||
// Runs once before the first test in each "block"
|
// Runs once before the first test in each "block"
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// Pre-agree to all Klaro cookies by setting the klaro-anonymous cookie
|
// Pre-agree to all Klaro cookies by setting the klaro-anonymous cookie
|
||||||
// This just ensures it doesn't get in the way of matching other objects in the page.
|
// This just ensures it doesn't get in the way of matching other objects in the page.
|
||||||
cy.setCookie('klaro-anonymous', '{%22authentication%22:true%2C%22preferences%22:true%2C%22acknowledgement%22:true%2C%22google-analytics%22:true%2C%22google-recaptcha%22:true}');
|
cy.setCookie('klaro-anonymous', '{%22authentication%22:true%2C%22preferences%22:true%2C%22acknowledgement%22:true%2C%22google-analytics%22:true%2C%22google-recaptcha%22:true}');
|
||||||
|
|
||||||
// Remove any CSRF cookies saved from prior tests
|
// Remove any CSRF cookies saved from prior tests
|
||||||
cy.clearCookie(DSPACE_XSRF_COOKIE);
|
cy.clearCookie(DSPACE_XSRF_COOKIE);
|
||||||
});
|
});
|
||||||
|
|
||||||
// NOTE: FALLBACK_TEST_REST_BASE_URL is only used if Cypress cannot read the REST API BaseURL
|
// NOTE: FALLBACK_TEST_REST_BASE_URL is only used if Cypress cannot read the REST API BaseURL
|
||||||
|
@@ -5,26 +5,26 @@ import { Options } from 'cypress-axe';
|
|||||||
// Uses 'log' and 'table' tasks defined in ../plugins/index.ts
|
// Uses 'log' and 'table' tasks defined in ../plugins/index.ts
|
||||||
// Borrowed from https://github.com/component-driven/cypress-axe#in-your-spec-file
|
// Borrowed from https://github.com/component-driven/cypress-axe#in-your-spec-file
|
||||||
function terminalLog(violations: Result[]) {
|
function terminalLog(violations: Result[]) {
|
||||||
cy.task(
|
cy.task(
|
||||||
'log',
|
'log',
|
||||||
`${violations.length} accessibility violation${violations.length === 1 ? '' : 's'} ${violations.length === 1 ? 'was' : 'were'} detected`
|
`${violations.length} accessibility violation${violations.length === 1 ? '' : 's'} ${violations.length === 1 ? 'was' : 'were'} detected`,
|
||||||
);
|
);
|
||||||
// pluck specific keys to keep the table readable
|
// pluck specific keys to keep the table readable
|
||||||
const violationData = violations.map(
|
const violationData = violations.map(
|
||||||
({ id, impact, description, helpUrl, nodes }) => ({
|
({ id, impact, description, helpUrl, nodes }) => ({
|
||||||
id,
|
id,
|
||||||
impact,
|
impact,
|
||||||
description,
|
description,
|
||||||
helpUrl,
|
helpUrl,
|
||||||
nodes: nodes.length,
|
nodes: nodes.length,
|
||||||
html: nodes.map(node => node.html)
|
html: nodes.map(node => node.html),
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Print violations as an array, since 'node.html' above often breaks table alignment
|
// Print violations as an array, since 'node.html' above often breaks table alignment
|
||||||
cy.task('log', violationData);
|
cy.task('log', violationData);
|
||||||
// Optionally, uncomment to print as a table
|
// Optionally, uncomment to print as a table
|
||||||
// cy.task('table', violationData);
|
// cy.task('table', violationData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,13 +32,13 @@ function terminalLog(violations: Result[]) {
|
|||||||
// while also ensuring any violations are logged to the terminal (see terminalLog above)
|
// while also ensuring any violations are logged to the terminal (see terminalLog above)
|
||||||
// This method MUST be called after cy.visit(), as cy.injectAxe() must be called after page load
|
// This method MUST be called after cy.visit(), as cy.injectAxe() must be called after page load
|
||||||
export const testA11y = (context?: any, options?: Options) => {
|
export const testA11y = (context?: any, options?: Options) => {
|
||||||
cy.injectAxe();
|
cy.injectAxe();
|
||||||
cy.configureAxe({
|
cy.configureAxe({
|
||||||
rules: [
|
rules: [
|
||||||
// Disable color contrast checks as they are inaccurate / result in a lot of false positives
|
// Disable color contrast checks as they are inaccurate / result in a lot of false positives
|
||||||
// See also open issues in axe-core: https://github.com/dequelabs/axe-core/labels/color%20contrast
|
// See also open issues in axe-core: https://github.com/dequelabs/axe-core/labels/color%20contrast
|
||||||
{ id: 'color-contrast', enabled: false },
|
{ id: 'color-contrast', enabled: false },
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
cy.checkA11y(context, options, terminalLog);
|
cy.checkA11y(context, options, terminalLog);
|
||||||
};
|
};
|
||||||
|
@@ -13,7 +13,7 @@ import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
|||||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||||
import { SearchService } from '../../core/shared/search/search.service';
|
import { SearchService } from '../../core/shared/search/search.service';
|
||||||
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
||||||
import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model';
|
import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model';
|
||||||
import { SearchObjects } from '../../shared/search/models/search-objects.model';
|
import { SearchObjects } from '../../shared/search/models/search-objects.model';
|
||||||
|
@@ -11,7 +11,7 @@ import { RequestService } from '../../../../core/data/request.service';
|
|||||||
import { RouteService } from '../../../../core/services/route.service';
|
import { RouteService } from '../../../../core/services/route.service';
|
||||||
import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service';
|
||||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { MockActivatedRoute } from '../../../../shared/mocks/active-router.mock';
|
import { MockActivatedRoute } from '../../../../shared/mocks/active-router.mock';
|
||||||
import { getMockRemoteDataBuildService } from '../../../../shared/mocks/remote-data-build.service.mock';
|
import { getMockRemoteDataBuildService } from '../../../../shared/mocks/remote-data-build.service.mock';
|
||||||
import { routeServiceStub } from '../../../../shared/testing/route-service.stub';
|
import { routeServiceStub } from '../../../../shared/testing/route-service.stub';
|
||||||
|
@@ -4,7 +4,7 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-admin-notify-incoming',
|
selector: 'ds-admin-notify-incoming',
|
||||||
|
@@ -16,7 +16,7 @@ import { map } from 'rxjs/operators';
|
|||||||
import { Context } from '../../../../core/shared/context.model';
|
import { Context } from '../../../../core/shared/context.model';
|
||||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-admin-notify-logs-result',
|
selector: 'ds-admin-notify-logs-result',
|
||||||
|
@@ -11,7 +11,7 @@ import { RequestService } from '../../../../core/data/request.service';
|
|||||||
import { RouteService } from '../../../../core/services/route.service';
|
import { RouteService } from '../../../../core/services/route.service';
|
||||||
import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service';
|
||||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { MockActivatedRoute } from '../../../../shared/mocks/active-router.mock';
|
import { MockActivatedRoute } from '../../../../shared/mocks/active-router.mock';
|
||||||
import { getMockRemoteDataBuildService } from '../../../../shared/mocks/remote-data-build.service.mock';
|
import { getMockRemoteDataBuildService } from '../../../../shared/mocks/remote-data-build.service.mock';
|
||||||
import { routeServiceStub } from '../../../../shared/testing/route-service.stub';
|
import { routeServiceStub } from '../../../../shared/testing/route-service.stub';
|
||||||
|
@@ -4,7 +4,7 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-admin-notify-outgoing',
|
selector: 'ds-admin-notify-outgoing',
|
||||||
|
@@ -20,7 +20,7 @@ import { RouteService } from '../../../core/services/route.service';
|
|||||||
import { ConfigurationProperty } from '../../../core/shared/configuration-property.model';
|
import { ConfigurationProperty } from '../../../core/shared/configuration-property.model';
|
||||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { routeServiceStub } from '../../../shared/testing/route-service.stub';
|
import { routeServiceStub } from '../../../shared/testing/route-service.stub';
|
||||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { AdminNotifyDetailModalComponent } from '../admin-notify-detail-modal/admin-notify-detail-modal.component';
|
import { AdminNotifyDetailModalComponent } from '../admin-notify-detail-modal/admin-notify-detail-modal.component';
|
||||||
|
@@ -15,7 +15,7 @@ import { PaginatedList } from '../../../core/data/paginated-list.model';
|
|||||||
import { Context } from '../../../core/shared/context.model';
|
import { Context } from '../../../core/shared/context.model';
|
||||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||||
import { ViewMode } from '../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../core/shared/view-mode.model';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { tabulatableObjectsComponent } from '../../../shared/object-collection/shared/tabulatable-objects/tabulatable-objects.decorator';
|
import { tabulatableObjectsComponent } from '../../../shared/object-collection/shared/tabulatable-objects/tabulatable-objects.decorator';
|
||||||
import { TabulatableResultListElementsComponent } from '../../../shared/object-list/search-result-list-element/tabulatable-search-result/tabulatable-result-list-elements.component';
|
import { TabulatableResultListElementsComponent } from '../../../shared/object-list/search-result-list-element/tabulatable-search-result/tabulatable-result-list-elements.component';
|
||||||
import { AdminNotifyDetailModalComponent } from '../admin-notify-detail-modal/admin-notify-detail-modal.component';
|
import { AdminNotifyDetailModalComponent } from '../admin-notify-detail-modal/admin-notify-detail-modal.component';
|
||||||
|
@@ -35,7 +35,7 @@ import { Collection } from '../../core/shared/collection.model';
|
|||||||
import { ConfigurationProperty } from '../../core/shared/configuration-property.model';
|
import { ConfigurationProperty } from '../../core/shared/configuration-property.model';
|
||||||
import { SearchService } from '../../core/shared/search/search.service';
|
import { SearchService } from '../../core/shared/search/search.service';
|
||||||
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { ErrorComponent } from '../../shared/error/error.component';
|
import { ErrorComponent } from '../../shared/error/error.component';
|
||||||
import { HostWindowService } from '../../shared/host-window.service';
|
import { HostWindowService } from '../../shared/host-window.service';
|
||||||
import { LoadingComponent } from '../../shared/loading/loading.component';
|
import { LoadingComponent } from '../../shared/loading/loading.component';
|
||||||
|
@@ -53,7 +53,7 @@ import {
|
|||||||
} from '../../core/shared/operators';
|
} from '../../core/shared/operators';
|
||||||
import { SearchService } from '../../core/shared/search/search.service';
|
import { SearchService } from '../../core/shared/search/search.service';
|
||||||
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import {
|
import {
|
||||||
fadeIn,
|
fadeIn,
|
||||||
fadeInOut,
|
fadeInOut,
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import { SearchConfigurationService } from '../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { ThemedSearchComponent } from '../shared/search/themed-search.component';
|
import { ThemedSearchComponent } from '../shared/search/themed-search.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@@ -49,6 +49,7 @@ import {
|
|||||||
getFirstSucceededRemoteDataPayload,
|
getFirstSucceededRemoteDataPayload,
|
||||||
} from '../../../../../core/shared/operators';
|
} from '../../../../../core/shared/operators';
|
||||||
import { SearchConfigurationService } from '../../../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../../core/shared/search/search-configuration.service';
|
||||||
|
import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import {
|
import {
|
||||||
hasValue,
|
hasValue,
|
||||||
isNotEmpty,
|
isNotEmpty,
|
||||||
@@ -68,7 +69,6 @@ import {
|
|||||||
} from './relationship.actions';
|
} from './relationship.actions';
|
||||||
import { ThemedDynamicLookupRelationSearchTabComponent } from './search-tab/themed-dynamic-lookup-relation-search-tab.component';
|
import { ThemedDynamicLookupRelationSearchTabComponent } from './search-tab/themed-dynamic-lookup-relation-search-tab.component';
|
||||||
import { DsDynamicLookupRelationSelectionTabComponent } from './selection-tab/dynamic-lookup-relation-selection-tab.component';
|
import { DsDynamicLookupRelationSelectionTabComponent } from './selection-tab/dynamic-lookup-relation-selection-tab.component';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-dynamic-lookup-relation-modal',
|
selector: 'ds-dynamic-lookup-relation-modal',
|
||||||
|
@@ -39,7 +39,7 @@ import { Item } from '../../../../../../core/shared/item.model';
|
|||||||
import { ItemType } from '../../../../../../core/shared/item-relationships/item-type.model';
|
import { ItemType } from '../../../../../../core/shared/item-relationships/item-type.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../../../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../../../../core/shared/operators';
|
||||||
import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import {
|
import {
|
||||||
fadeIn,
|
fadeIn,
|
||||||
fadeInOut,
|
fadeInOut,
|
||||||
|
@@ -39,7 +39,7 @@ import {
|
|||||||
} from '../../../../../../core/shared/operators';
|
} from '../../../../../../core/shared/operators';
|
||||||
import { SearchService } from '../../../../../../core/shared/search/search.service';
|
import { SearchService } from '../../../../../../core/shared/search/search.service';
|
||||||
import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { hasValue } from '../../../../../empty.util';
|
import { hasValue } from '../../../../../empty.util';
|
||||||
import { CollectionElementLinkType } from '../../../../../object-collection/collection-element-link.type';
|
import { CollectionElementLinkType } from '../../../../../object-collection/collection-element-link.type';
|
||||||
import { ListableObject } from '../../../../../object-collection/shared/listable-object.model';
|
import { ListableObject } from '../../../../../object-collection/shared/listable-object.model';
|
||||||
|
@@ -21,7 +21,7 @@ import { PaginationService } from '../../../../../../core/pagination/pagination.
|
|||||||
import { Context } from '../../../../../../core/shared/context.model';
|
import { Context } from '../../../../../../core/shared/context.model';
|
||||||
import { PageInfo } from '../../../../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../../../../core/shared/page-info.model';
|
||||||
import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { ListableObject } from '../../../../../object-collection/shared/listable-object.model';
|
import { ListableObject } from '../../../../../object-collection/shared/listable-object.model';
|
||||||
import { PaginationComponentOptions } from '../../../../../pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../../../../../pagination/pagination-component-options.model';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../../../remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../../../../../remote-data.utils';
|
||||||
|
@@ -20,9 +20,9 @@ import { APP_CONFIG } from '../../../../config/app-config.interface';
|
|||||||
import { environment } from '../../../../environments/environment';
|
import { environment } from '../../../../environments/environment';
|
||||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||||
import { SearchService } from '../../../core/shared/search/search.service';
|
import { SearchService } from '../../../core/shared/search/search.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../form/builder/form-builder.service';
|
||||||
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
import { getMockFormBuilderService } from '../../mocks/form-builder-service.mock';
|
||||||
import { BrowserOnlyMockPipe } from '../../testing/browser-only-mock.pipe';
|
import { BrowserOnlyMockPipe } from '../../testing/browser-only-mock.pipe';
|
||||||
import { RouterStub } from '../../testing/router.stub';
|
import { RouterStub } from '../../testing/router.stub';
|
||||||
import { SearchConfigurationServiceStub } from '../../testing/search-configuration-service.stub';
|
import { SearchConfigurationServiceStub } from '../../testing/search-configuration-service.stub';
|
||||||
|
@@ -25,7 +25,7 @@ import {
|
|||||||
|
|
||||||
import { SearchService } from '../../../core/shared/search/search.service';
|
import { SearchService } from '../../../core/shared/search/search.service';
|
||||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { slide } from '../../animations/slide';
|
import { slide } from '../../animations/slide';
|
||||||
import { BrowserOnlyPipe } from '../../utils/browser-only.pipe';
|
import { BrowserOnlyPipe } from '../../utils/browser-only.pipe';
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@ import {
|
|||||||
SCOPE,
|
SCOPE,
|
||||||
SearchFilterService,
|
SearchFilterService,
|
||||||
} from '../../../../../core/shared/search/search-filter.service';
|
} from '../../../../../core/shared/search/search-filter.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils';
|
||||||
import { RouterStub } from '../../../../testing/router.stub';
|
import { RouterStub } from '../../../../testing/router.stub';
|
||||||
import { SearchConfigurationServiceStub } from '../../../../testing/search-configuration-service.stub';
|
import { SearchConfigurationServiceStub } from '../../../../testing/search-configuration-service.stub';
|
||||||
|
@@ -28,7 +28,7 @@ import { SearchService } from '../../../../core/shared/search/search.service';
|
|||||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||||
import { SearchFilterService } from '../../../../core/shared/search/search-filter.service';
|
import { SearchFilterService } from '../../../../core/shared/search/search-filter.service';
|
||||||
import { SequenceService } from '../../../../core/shared/sequence.service';
|
import { SequenceService } from '../../../../core/shared/sequence.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { slide } from '../../../animations/slide';
|
import { slide } from '../../../animations/slide';
|
||||||
import {
|
import {
|
||||||
hasValue,
|
hasValue,
|
||||||
|
@@ -15,7 +15,7 @@ import { Observable } from 'rxjs';
|
|||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
|
|
||||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { ObjectKeysPipe } from '../../utils/object-keys-pipe';
|
import { ObjectKeysPipe } from '../../utils/object-keys-pipe';
|
||||||
import { SearchLabelComponent } from './search-label/search-label.component';
|
import { SearchLabelComponent } from './search-label/search-label.component';
|
||||||
|
|
||||||
|
@@ -5,6 +5,7 @@ import {
|
|||||||
waitForAsync,
|
waitForAsync,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
@@ -14,10 +15,14 @@ import {
|
|||||||
SortOptions,
|
SortOptions,
|
||||||
} from '../../../core/cache/models/sort-options.model';
|
} from '../../../core/cache/models/sort-options.model';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
import { SearchService } from '../../../core/shared/search/search.service';
|
||||||
|
import { SearchFilterService } from '../../../core/shared/search/search-filter.service';
|
||||||
|
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { PaginationComponentOptions } from '../../pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../../pagination/pagination-component-options.model';
|
||||||
import { SidebarService } from '../../sidebar/sidebar.service';
|
import { SidebarService } from '../../sidebar/sidebar.service';
|
||||||
|
import { ActivatedRouteStub } from '../../testing/active-router.stub';
|
||||||
import { PaginationServiceStub } from '../../testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../testing/pagination-service.stub';
|
||||||
|
import { SearchServiceStub } from '../../testing/search-service.stub';
|
||||||
import { SidebarServiceStub } from '../../testing/sidebar-service.stub';
|
import { SidebarServiceStub } from '../../testing/sidebar-service.stub';
|
||||||
import { EnumKeysPipe } from '../../utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../utils/enum-keys-pipe';
|
||||||
import { VarDirective } from '../../utils/var.directive';
|
import { VarDirective } from '../../utils/var.directive';
|
||||||
@@ -59,8 +64,8 @@ describe('SearchSettingsComponent', () => {
|
|||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), SearchSettingsComponent, EnumKeysPipe, VarDirective],
|
imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), SearchSettingsComponent, EnumKeysPipe, VarDirective],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: SearchService, useValue: searchServiceStub },
|
{ provide: SearchService, useValue: new SearchServiceStub() },
|
||||||
{ provide: ActivatedRoute, useValue: activatedRouteStub },
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||||
{
|
{
|
||||||
provide: SidebarService,
|
provide: SidebarService,
|
||||||
useValue: SidebarServiceStub,
|
useValue: SidebarServiceStub,
|
||||||
|
@@ -54,7 +54,7 @@ import { ViewMode } from '../../core/shared/view-mode.model';
|
|||||||
import { SubmissionObject } from '../../core/submission/models/submission-object.model';
|
import { SubmissionObject } from '../../core/submission/models/submission-object.model';
|
||||||
import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model';
|
import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model';
|
||||||
import { ITEM_MODULE_PATH } from '../../item-page/item-page-routing-paths';
|
import { ITEM_MODULE_PATH } from '../../item-page/item-page-routing-paths';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { pushInOut } from '../animations/push';
|
import { pushInOut } from '../animations/push';
|
||||||
import {
|
import {
|
||||||
hasValue,
|
hasValue,
|
||||||
|
@@ -7,12 +7,12 @@ import {
|
|||||||
Component,
|
Component,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { MyDSpaceConfigurationService } from '../../../../app/my-dspace-page/my-dspace-configuration.service';
|
|
||||||
import { MyDSpaceNewSubmissionComponent } from '../../../../app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component';
|
|
||||||
import {
|
import {
|
||||||
MyDSpacePageComponent as BaseComponent,
|
MyDSpaceConfigurationService,
|
||||||
SEARCH_CONFIG_SERVICE,
|
SEARCH_CONFIG_SERVICE,
|
||||||
} from '../../../../app/my-dspace-page/my-dspace-page.component';
|
} from '../../../../app/my-dspace-page/my-dspace-configuration.service';
|
||||||
|
import { MyDSpaceNewSubmissionComponent } from '../../../../app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component';
|
||||||
|
import { MyDSpacePageComponent as BaseComponent } from '../../../../app/my-dspace-page/my-dspace-page.component';
|
||||||
import { MyDspaceQaEventsNotificationsComponent } from '../../../../app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component';
|
import { MyDspaceQaEventsNotificationsComponent } from '../../../../app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component';
|
||||||
import { SuggestionsNotificationComponent } from '../../../../app/notifications/suggestions-notification/suggestions-notification.component';
|
import { SuggestionsNotificationComponent } from '../../../../app/notifications/suggestions-notification/suggestions-notification.component';
|
||||||
import { pushInOut } from '../../../../app/shared/animations/push';
|
import { pushInOut } from '../../../../app/shared/animations/push';
|
||||||
|
@@ -10,7 +10,7 @@ import {
|
|||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { SearchConfigurationService } from '../../../../app/core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../app/core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../app/my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../app/my-dspace-page/my-dspace-configuration.service';
|
||||||
import { ConfigurationSearchPageComponent as BaseComponent } from '../../../../app/search-page/configuration-search-page.component';
|
import { ConfigurationSearchPageComponent as BaseComponent } from '../../../../app/search-page/configuration-search-page.component';
|
||||||
import { pushInOut } from '../../../../app/shared/animations/push';
|
import { pushInOut } from '../../../../app/shared/animations/push';
|
||||||
import { SearchLabelsComponent } from '../../../../app/shared/search/search-labels/search-labels.component';
|
import { SearchLabelsComponent } from '../../../../app/shared/search/search-labels/search-labels.component';
|
||||||
|
@@ -15,7 +15,7 @@ import { RouterLink } from '@angular/router';
|
|||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { SearchConfigurationService } from '../../../../../../app/core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../../../app/core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-dspace-configuration.service';
|
||||||
import { AdvancedSearchComponent } from '../../../../../../app/shared/search/advanced-search/advanced-search.component';
|
import { AdvancedSearchComponent } from '../../../../../../app/shared/search/advanced-search/advanced-search.component';
|
||||||
import { SearchFilterComponent } from '../../../../../../app/shared/search/search-filters/search-filter/search-filter.component';
|
import { SearchFilterComponent } from '../../../../../../app/shared/search/search-filters/search-filter/search-filter.component';
|
||||||
import { SearchFiltersComponent as BaseComponent } from '../../../../../../app/shared/search/search-filters/search-filters.component';
|
import { SearchFiltersComponent as BaseComponent } from '../../../../../../app/shared/search/search-filters/search-filters.component';
|
||||||
|
@@ -14,7 +14,7 @@ import { FormsModule } from '@angular/forms';
|
|||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { SearchConfigurationService } from '../../../../../../app/core/shared/search/search-configuration.service';
|
import { SearchConfigurationService } from '../../../../../../app/core/shared/search/search-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-dspace-configuration.service';
|
||||||
import { PageSizeSelectorComponent } from '../../../../../../app/shared/page-size-selector/page-size-selector.component';
|
import { PageSizeSelectorComponent } from '../../../../../../app/shared/page-size-selector/page-size-selector.component';
|
||||||
import { SearchSettingsComponent as BaseComponent } from '../../../../../../app/shared/search/search-settings/search-settings.component';
|
import { SearchSettingsComponent as BaseComponent } from '../../../../../../app/shared/search/search-settings/search-settings.component';
|
||||||
import { SidebarDropdownComponent } from '../../../../../../app/shared/sidebar/sidebar-dropdown.component';
|
import { SidebarDropdownComponent } from '../../../../../../app/shared/sidebar/sidebar-dropdown.component';
|
||||||
|
Reference in New Issue
Block a user