Skip to content

Commit b577120

Browse files
Merge remote-tracking branch 'upstream/main' into fix-specs-without-expectations_contribute-main
2 parents 230adc1 + 0551229 commit b577120

513 files changed

Lines changed: 19348 additions & 2783 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
#CHROME_VERSION: "90.0.4430.212-1"
3434
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
3535
NODE_OPTIONS: '--max-old-space-size=4096'
36+
# Project name to use when running docker-compose prior to e2e tests
37+
COMPOSE_PROJECT_NAME: 'ci'
3638
strategy:
3739
# Create a matrix of Node versions to test against (in parallel)
3840
matrix:

config/config.example.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ cache:
7575
anonymousCache:
7676
# Maximum number of pages to cache. Default is zero (0) which means anonymous user cache is disabled.
7777
# As all pages are cached in server memory, increasing this value will increase memory needs.
78-
# Individual cached pages are usually small (<100KB), so a value of max=1000 would only require ~100MB of memory.
78+
# Individual cached pages are usually small (<100KB), so a value of max=1000 would only require ~100MB of memory.
7979
max: 0
8080
# Amount of time after which cached pages are considered stale (in ms). After becoming stale, the cached
8181
# copy is automatically refreshed on the next request.
@@ -382,7 +382,13 @@ vocabularies:
382382
vocabulary: 'srsc'
383383
enabled: true
384384

385-
# Default collection/community sorting order at Advanced search, Create/update community and collection when there are not a query.
385+
# Default collection/community sorting order at Advanced search, Create/update community and collection when there are not a query.
386386
comcolSelectionSort:
387387
sortField: 'dc.title'
388388
sortDirection: 'ASC'
389+
390+
# Example of fallback collection for suggestions import
391+
# suggestion:
392+
# - collectionId: 8f7df5ca-f9c2-47a4-81ec-8a6393d6e5af
393+
# source: "openaire"
394+

cypress.config.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ export default defineConfig({
99
openMode: 0,
1010
},
1111
env: {
12-
// Global constants used in DSpace e2e tests (see also ./cypress/support/e2e.ts)
13-
// May be overridden in our cypress.json config file using specified environment variables.
12+
// Global DSpace environment variables used in all our Cypress e2e tests
13+
// May be modified in this config, or overridden in a variety of ways.
14+
// See Cypress environment variable docs: https://docs.cypress.io/guides/guides/environment-variables
1415
// Default values listed here are all valid for the Demo Entities Data set available at
1516
// https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
1617
// (This is the data set used in our CI environment)
@@ -21,12 +22,14 @@ export default defineConfig({
2122
// Community/collection/publication used for view/edit tests
2223
DSPACE_TEST_COMMUNITY: '0958c910-2037-42a9-81c7-dca80e3892b4',
2324
DSPACE_TEST_COLLECTION: '282164f5-d325-4740-8dd1-fa4d6d3e7200',
24-
DSPACE_TEST_ENTITY_PUBLICATION: 'e98b0f27-5c19-49a0-960d-eb6ad5287067',
25+
DSPACE_TEST_ENTITY_PUBLICATION: '6160810f-1e53-40db-81ef-f6621a727398',
2526
// Search term (should return results) used in search tests
2627
DSPACE_TEST_SEARCH_TERM: 'test',
27-
// Collection used for submission tests
28+
// Main Collection used for submission tests. Should be able to accept normal Item objects
2829
DSPACE_TEST_SUBMIT_COLLECTION_NAME: 'Sample Collection',
2930
DSPACE_TEST_SUBMIT_COLLECTION_UUID: '9d8334e9-25d3-4a67-9cea-3dffdef80144',
31+
// Collection used for Person entity submission tests. MUST be configured with EntityType=Person.
32+
DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME: 'People',
3033
// Account used to test basic submission process
3134
DSPACE_TEST_SUBMIT_USER: 'dspacedemo+submit@gmail.com',
3235
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'dspace',

cypress/e2e/admin-sidebar.cy.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Options } from 'cypress-axe';
2+
import { testA11y } from 'cypress/support/utils';
3+
4+
describe('Admin Sidebar', () => {
5+
beforeEach(() => {
6+
// Must login as an Admin for sidebar to appear
7+
cy.visit('/login');
8+
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
9+
});
10+
11+
it('should be pinnable and pass accessibility tests', () => {
12+
// Pin the sidebar open
13+
cy.get('#sidebar-collapse-toggle').click();
14+
15+
// Click on every expandable section to open all menus
16+
cy.get('ds-expandable-admin-sidebar-section').click({multiple: true});
17+
18+
// Analyze <ds-admin-sidebar> for accessibility
19+
testA11y('ds-admin-sidebar',
20+
{
21+
rules: {
22+
// Currently all expandable sections have nested interactive elements
23+
// See https://github.com/DSpace/dspace-angular/issues/2178
24+
'nested-interactive': { enabled: false },
25+
}
26+
} as Options);
27+
});
28+
});

cypress/e2e/breadcrumbs.cy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { TEST_ENTITY_PUBLICATION } from 'cypress/support/e2e';
21
import { testA11y } from 'cypress/support/utils';
32

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

98
// Wait for breadcrumbs to be visible
109
cy.get('ds-breadcrumbs').should('be.visible');

cypress/e2e/browse-by-author.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ describe('Browse By Author', () => {
55
cy.visit('/browse/author');
66

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

1010
// Analyze <ds-browse-by-metadata-page> for accessibility
11-
testA11y('ds-browse-by-metadata-page');
11+
testA11y('ds-browse-by-metadata');
1212
});
1313
});

cypress/e2e/browse-by-dateissued.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ describe('Browse By Date Issued', () => {
55
cy.visit('/browse/dateissued');
66

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

1010
// Analyze <ds-browse-by-date-page> for accessibility
11-
testA11y('ds-browse-by-date-page');
11+
testA11y('ds-browse-by-date');
1212
});
1313
});

cypress/e2e/browse-by-subject.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ describe('Browse By Subject', () => {
55
cy.visit('/browse/subject');
66

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

1010
// Analyze <ds-browse-by-metadata-page> for accessibility
11-
testA11y('ds-browse-by-metadata-page');
11+
testA11y('ds-browse-by-metadata');
1212
});
1313
});

cypress/e2e/browse-by-title.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ describe('Browse By Title', () => {
55
cy.visit('/browse/title');
66

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

1010
// Analyze <ds-browse-by-title-page> for accessibility
11-
testA11y('ds-browse-by-title-page');
11+
testA11y('ds-browse-by-title');
1212
});
1313
});

cypress/e2e/collection-edit.cy.ts

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import { testA11y } from 'cypress/support/utils';
2+
3+
const COLLECTION_EDIT_PAGE = '/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('/edit');
4+
5+
beforeEach(() => {
6+
// All tests start with visiting the Edit Collection Page
7+
cy.visit(COLLECTION_EDIT_PAGE);
8+
9+
// This page is restricted, so we will be shown the login form. Fill it out & submit.
10+
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
11+
});
12+
13+
describe('Edit Collection > Edit Metadata tab', () => {
14+
it('should pass accessibility tests', () => {
15+
// <ds-edit-collection> tag must be loaded
16+
cy.get('ds-edit-collection').should('be.visible');
17+
18+
// Analyze <ds-edit-collection> for accessibility issues
19+
testA11y('ds-edit-collection');
20+
});
21+
});
22+
23+
describe('Edit Collection > Assign Roles tab', () => {
24+
25+
it('should pass accessibility tests', () => {
26+
cy.get('a[data-test="roles"]').click();
27+
28+
// <ds-collection-roles> tag must be loaded
29+
cy.get('ds-collection-roles').should('be.visible');
30+
31+
// Analyze for accessibility issues
32+
testA11y('ds-collection-roles');
33+
});
34+
});
35+
36+
describe('Edit Collection > Content Source tab', () => {
37+
38+
it('should pass accessibility tests', () => {
39+
cy.get('a[data-test="source"]').click();
40+
41+
// <ds-collection-source> tag must be loaded
42+
cy.get('ds-collection-source').should('be.visible');
43+
44+
// Check the external source checkbox (to display all fields on the page)
45+
cy.get('#externalSourceCheck').check();
46+
47+
// Wait for the source controls to appear
48+
cy.get('ds-collection-source-controls').should('be.visible');
49+
50+
// Analyze entire page for accessibility issues
51+
testA11y('ds-collection-source');
52+
});
53+
});
54+
55+
describe('Edit Collection > Curate tab', () => {
56+
57+
it('should pass accessibility tests', () => {
58+
cy.get('a[data-test="curate"]').click();
59+
60+
// <ds-collection-curate> tag must be loaded
61+
cy.get('ds-collection-curate').should('be.visible');
62+
63+
// Analyze for accessibility issues
64+
testA11y('ds-collection-curate');
65+
});
66+
});
67+
68+
describe('Edit Collection > Access Control tab', () => {
69+
70+
it('should pass accessibility tests', () => {
71+
cy.get('a[data-test="access-control"]').click();
72+
73+
// <ds-collection-access-control> tag must be loaded
74+
cy.get('ds-collection-access-control').should('be.visible');
75+
76+
// Analyze for accessibility issues
77+
testA11y('ds-collection-access-control');
78+
});
79+
});
80+
81+
describe('Edit Collection > Authorizations tab', () => {
82+
83+
it('should pass accessibility tests', () => {
84+
cy.get('a[data-test="authorizations"]').click();
85+
86+
// <ds-collection-authorizations> tag must be loaded
87+
cy.get('ds-collection-authorizations').should('be.visible');
88+
89+
// Analyze for accessibility issues
90+
testA11y('ds-collection-authorizations');
91+
});
92+
});
93+
94+
describe('Edit Collection > Item Mapper tab', () => {
95+
96+
it('should pass accessibility tests', () => {
97+
cy.get('a[data-test="mapper"]').click();
98+
99+
// <ds-collection-item-mapper> tag must be loaded
100+
cy.get('ds-collection-item-mapper').should('be.visible');
101+
102+
// Analyze entire page for accessibility issues
103+
testA11y('ds-collection-item-mapper');
104+
105+
// Click on the "Map new Items" tab
106+
cy.get('li[data-test="mapTab"] a').click();
107+
108+
// Make sure search form is now visible
109+
cy.get('ds-search-form').should('be.visible');
110+
111+
// Analyze entire page (again) for accessibility issues
112+
testA11y('ds-collection-item-mapper');
113+
});
114+
});
115+
116+
117+
describe('Edit Collection > Delete page', () => {
118+
119+
it('should pass accessibility tests', () => {
120+
cy.get('a[data-test="delete-button"]').click();
121+
122+
// <ds-delete-collection> tag must be loaded
123+
cy.get('ds-delete-collection').should('be.visible');
124+
125+
// Analyze for accessibility issues
126+
testA11y('ds-delete-collection');
127+
});
128+
});

0 commit comments

Comments
 (0)