Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into multiline-search-filt…
Browse files Browse the repository at this point in the history
…er-badge_main
  • Loading branch information
LotteHofstede committed Mar 4, 2024
2 parents b11fa60 + 061129e commit a63a69d
Show file tree
Hide file tree
Showing 908 changed files with 43,258 additions and 5,040 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
#CHROME_VERSION: "90.0.4430.212-1"
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
NODE_OPTIONS: '--max-old-space-size=4096'
# Project name to use when running docker-compose prior to e2e tests
COMPOSE_PROJECT_NAME: 'ci'
strategy:
# Create a matrix of Node versions to test against (in parallel)
matrix:
Expand Down
59 changes: 53 additions & 6 deletions config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ cache:
anonymousCache:
# Maximum number of pages to cache. Default is zero (0) which means anonymous user cache is disabled.
# As all pages are cached in server memory, increasing this value will increase memory needs.
# Individual cached pages are usually small (<100KB), so a value of max=1000 would only require ~100MB of memory.
# Individual cached pages are usually small (<100KB), so a value of max=1000 would only require ~100MB of memory.
max: 0
# Amount of time after which cached pages are considered stale (in ms). After becoming stale, the cached
# copy is automatically refreshed on the next request.
Expand Down Expand Up @@ -136,7 +136,7 @@ submission:
# NOTE: example of configuration
# # NOTE: metadata name
# - name: dc.author
# # NOTE: fontawesome (v5.x) icon classes and bootstrap utility classes can be used
# # NOTE: fontawesome (v6.x) icon classes and bootstrap utility classes can be used
# style: fas fa-user
- name: dc.author
style: fas fa-user
Expand All @@ -147,18 +147,40 @@ submission:
confidence:
# NOTE: example of configuration
# # NOTE: confidence value
# - name: dc.author
# # NOTE: fontawesome (v5.x) icon classes and bootstrap utility classes can be used
# style: fa-user
# - value: 600
# # NOTE: fontawesome (v6.x) icon classes and bootstrap utility classes can be used
# style: text-success
# icon: fa-circle-check
# # NOTE: the class configured in property style is used by default, the icon property could be used in component
# configured to use a 'icon mode' display (mainly in edit-item page)
- value: 600
style: text-success
icon: fa-circle-check
- value: 500
style: text-info
icon: fa-gear
- value: 400
style: text-warning
icon: fa-circle-question
- value: 300
style: text-muted
icon: fa-thumbs-down
- value: 200
style: text-muted
icon: fa-circle-exclamation
- value: 100
style: text-muted
icon: fa-circle-stop
- value: 0
style: text-muted
icon: fa-ban
- value: -1
style: text-muted
icon: fa-circle-xmark
# default configuration
- value: default
style: text-muted
icon: fa-circle-xmark

# Default Language in which the UI will be rendered if the user's browser language is not an active language
defaultLanguage: en
Expand Down Expand Up @@ -272,6 +294,8 @@ homePage:
# No. of communities to list per page on the home page
# This will always round to the nearest number from the list of page sizes. e.g. if you set it to 7 it'll use 10
pageSize: 5
# Enable or disable the Discover filters on the homepage
showDiscoverFilters: false

# Item Config
item:
Expand All @@ -285,8 +309,17 @@ item:
# settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
pageSize: 5

# Community Page Config
community:
# Search tab config
searchSection:
showSidebar: true

# Collection Page Config
collection:
# Search tab config
searchSection:
showSidebar: true
edit:
undoTimeout: 10000 # 10 seconds

Expand Down Expand Up @@ -382,7 +415,21 @@ vocabularies:
vocabulary: 'srsc'
enabled: true

# Default collection/community sorting order at Advanced search, Create/update community and collection when there are not a query.
# Default collection/community sorting order at Advanced search, Create/update community and collection when there are not a query.
comcolSelectionSort:
sortField: 'dc.title'
sortDirection: 'ASC'

# Example of fallback collection for suggestions import
# suggestion:
# - collectionId: 8f7df5ca-f9c2-47a4-81ec-8a6393d6e5af
# source: "openaire"


# Search settings
search:
# Settings to enable/disable or configure advanced search filters.
advancedFilters:
enabled: false
# List of filters to enable in "Advanced Search" dropdown
filter: [ 'title', 'author', 'subject', 'entityType' ]
11 changes: 7 additions & 4 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ export default defineConfig({
openMode: 0,
},
env: {
// Global constants used in DSpace e2e tests (see also ./cypress/support/e2e.ts)
// May be overridden in our cypress.json config file using specified environment variables.
// Global DSpace environment variables used in all our Cypress e2e tests
// May be modified in this config, or overridden in a variety of ways.
// See Cypress environment variable docs: https://docs.cypress.io/guides/guides/environment-variables
// Default values listed here are all valid for the Demo Entities Data set available at
// https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
// (This is the data set used in our CI environment)
Expand All @@ -21,12 +22,14 @@ export default defineConfig({
// Community/collection/publication used for view/edit tests
DSPACE_TEST_COMMUNITY: '0958c910-2037-42a9-81c7-dca80e3892b4',
DSPACE_TEST_COLLECTION: '282164f5-d325-4740-8dd1-fa4d6d3e7200',
DSPACE_TEST_ENTITY_PUBLICATION: 'e98b0f27-5c19-49a0-960d-eb6ad5287067',
DSPACE_TEST_ENTITY_PUBLICATION: '6160810f-1e53-40db-81ef-f6621a727398',
// Search term (should return results) used in search tests
DSPACE_TEST_SEARCH_TERM: 'test',
// Collection used for submission tests
// Main Collection used for submission tests. Should be able to accept normal Item objects
DSPACE_TEST_SUBMIT_COLLECTION_NAME: 'Sample Collection',
DSPACE_TEST_SUBMIT_COLLECTION_UUID: '9d8334e9-25d3-4a67-9cea-3dffdef80144',
// Collection used for Person entity submission tests. MUST be configured with EntityType=Person.
DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME: 'People',
// Account used to test basic submission process
DSPACE_TEST_SUBMIT_USER: '[email protected]',
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'dspace',
Expand Down
28 changes: 28 additions & 0 deletions cypress/e2e/admin-sidebar.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Options } from 'cypress-axe';
import { testA11y } from 'cypress/support/utils';

describe('Admin Sidebar', () => {
beforeEach(() => {
// Must login as an Admin for sidebar to appear
cy.visit('/login');
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
});

it('should be pinnable and pass accessibility tests', () => {
// Pin the sidebar open
cy.get('#sidebar-collapse-toggle').click();

// Click on every expandable section to open all menus
cy.get('ds-expandable-admin-sidebar-section').click({multiple: true});

// Analyze <ds-admin-sidebar> for accessibility
testA11y('ds-admin-sidebar',
{
rules: {
// Currently all expandable sections have nested interactive elements
// See https://github.com/DSpace/dspace-angular/issues/2178
'nested-interactive': { enabled: false },
}
} as Options);
});
});
3 changes: 1 addition & 2 deletions cypress/e2e/breadcrumbs.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { TEST_ENTITY_PUBLICATION } from 'cypress/support/e2e';
import { testA11y } from 'cypress/support/utils';

describe('Breadcrumbs', () => {
it('should pass accessibility tests', () => {
// Visit an Item, as those have more breadcrumbs
cy.visit('/entities/publication/'.concat(TEST_ENTITY_PUBLICATION));
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));

// Wait for breadcrumbs to be visible
cy.get('ds-breadcrumbs').should('be.visible');
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/browse-by-author.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ describe('Browse By Author', () => {
cy.visit('/browse/author');

// Wait for <ds-browse-by-metadata-page> to be visible
cy.get('ds-browse-by-metadata-page').should('be.visible');
cy.get('ds-browse-by-metadata').should('be.visible');

// Analyze <ds-browse-by-metadata-page> for accessibility
testA11y('ds-browse-by-metadata-page');
testA11y('ds-browse-by-metadata');
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/browse-by-dateissued.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ describe('Browse By Date Issued', () => {
cy.visit('/browse/dateissued');

// Wait for <ds-browse-by-date-page> to be visible
cy.get('ds-browse-by-date-page').should('be.visible');
cy.get('ds-browse-by-date').should('be.visible');

// Analyze <ds-browse-by-date-page> for accessibility
testA11y('ds-browse-by-date-page');
testA11y('ds-browse-by-date');
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/browse-by-subject.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ describe('Browse By Subject', () => {
cy.visit('/browse/subject');

// Wait for <ds-browse-by-metadata-page> to be visible
cy.get('ds-browse-by-metadata-page').should('be.visible');
cy.get('ds-browse-by-metadata').should('be.visible');

// Analyze <ds-browse-by-metadata-page> for accessibility
testA11y('ds-browse-by-metadata-page');
testA11y('ds-browse-by-metadata');
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/browse-by-title.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ describe('Browse By Title', () => {
cy.visit('/browse/title');

// Wait for <ds-browse-by-title-page> to be visible
cy.get('ds-browse-by-title-page').should('be.visible');
cy.get('ds-browse-by-title').should('be.visible');

// Analyze <ds-browse-by-title-page> for accessibility
testA11y('ds-browse-by-title-page');
testA11y('ds-browse-by-title');
});
});
128 changes: 128 additions & 0 deletions cypress/e2e/collection-edit.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import { testA11y } from 'cypress/support/utils';

const COLLECTION_EDIT_PAGE = '/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('/edit');

beforeEach(() => {
// All tests start with visiting the Edit Collection Page
cy.visit(COLLECTION_EDIT_PAGE);

// 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'));
});

describe('Edit Collection > Edit Metadata tab', () => {
it('should pass accessibility tests', () => {
// <ds-edit-collection> tag must be loaded
cy.get('ds-edit-collection').should('be.visible');

// Analyze <ds-edit-collection> for accessibility issues
testA11y('ds-edit-collection');
});
});

describe('Edit Collection > Assign Roles tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="roles"]').click();

// <ds-collection-roles> tag must be loaded
cy.get('ds-collection-roles').should('be.visible');

// Analyze for accessibility issues
testA11y('ds-collection-roles');
});
});

describe('Edit Collection > Content Source tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="source"]').click();

// <ds-collection-source> tag must be loaded
cy.get('ds-collection-source').should('be.visible');

// Check the external source checkbox (to display all fields on the page)
cy.get('#externalSourceCheck').check();

// Wait for the source controls to appear
// cy.get('ds-collection-source-controls').should('be.visible');

// Analyze entire page for accessibility issues
testA11y('ds-collection-source');
});
});

describe('Edit Collection > Curate tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="curate"]').click();

// <ds-collection-curate> tag must be loaded
cy.get('ds-collection-curate').should('be.visible');

// Analyze for accessibility issues
testA11y('ds-collection-curate');
});
});

describe('Edit Collection > Access Control tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="access-control"]').click();

// <ds-collection-access-control> tag must be loaded
cy.get('ds-collection-access-control').should('be.visible');

// Analyze for accessibility issues
testA11y('ds-collection-access-control');
});
});

describe('Edit Collection > Authorizations tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="authorizations"]').click();

// <ds-collection-authorizations> tag must be loaded
cy.get('ds-collection-authorizations').should('be.visible');

// Analyze for accessibility issues
testA11y('ds-collection-authorizations');
});
});

describe('Edit Collection > Item Mapper tab', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="mapper"]').click();

// <ds-collection-item-mapper> tag must be loaded
cy.get('ds-collection-item-mapper').should('be.visible');

// Analyze entire page for accessibility issues
testA11y('ds-collection-item-mapper');

// Click on the "Map new Items" tab
cy.get('li[data-test="mapTab"] a').click();

// Make sure search form is now visible
cy.get('ds-search-form').should('be.visible');

// Analyze entire page (again) for accessibility issues
testA11y('ds-collection-item-mapper');
});
});


describe('Edit Collection > Delete page', () => {

it('should pass accessibility tests', () => {
cy.get('a[data-test="delete-button"]').click();

// <ds-delete-collection> tag must be loaded
cy.get('ds-delete-collection').should('be.visible');

// Analyze for accessibility issues
testA11y('ds-delete-collection');
});
});
3 changes: 1 addition & 2 deletions cypress/e2e/collection-page.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { TEST_COLLECTION } from 'cypress/support/e2e';
import { testA11y } from 'cypress/support/utils';

describe('Collection Page', () => {

it('should pass accessibility tests', () => {
cy.visit('/collections/'.concat(TEST_COLLECTION));
cy.visit('/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')));

// <ds-collection-page> tag must be loaded
cy.get('ds-collection-page').should('be.visible');
Expand Down
Loading

0 comments on commit a63a69d

Please sign in to comment.