Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into disable-inline-css
Browse files Browse the repository at this point in the history
  • Loading branch information
ybnd committed Apr 5, 2024
2 parents 4a39f33 + 1e33960 commit 6203055
Show file tree
Hide file tree
Showing 1,885 changed files with 26,144 additions and 19,243 deletions.
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
}
],
"@angular-eslint/no-attribute-decorator": "error",
"@angular-eslint/no-forward-ref": "error",
"@angular-eslint/no-output-native": "warn",
"@angular-eslint/no-output-on-prefix": "warn",
"@angular-eslint/no-conflicting-lifecycle": "warn",
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ 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
# 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:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]
# Do NOT exit immediately if one matrix job fails
fail-fast: false
# These are the actual CI steps to perform per job
Expand Down Expand Up @@ -108,12 +108,12 @@ jobs:
path: 'coverage/dspace-angular/lcov.info'
retention-days: 14

# Using docker-compose start backend using CI configuration
# Using "docker compose" start backend using CI configuration
# and load assetstore from a cached copy
- name: Start DSpace REST Backend via Docker (for e2e tests)
run: |
docker-compose -f ./docker/docker-compose-ci.yml up -d
docker-compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
docker compose -f ./docker/docker-compose-ci.yml up -d
docker compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
docker container ls
# Run integration tests via Cypress.io
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
run: kill -9 $(lsof -t -i:4000)

- name: Shutdown Docker containers
run: docker-compose -f ./docker/docker-compose-ci.yml down
run: docker compose -f ./docker/docker-compose-ci.yml down

# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
Expand Down
38 changes: 19 additions & 19 deletions cypress/e2e/admin-sidebar.cy.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { Options } from 'cypress-axe';
import { testA11y } from 'cypress/support/utils';
import { Options } from 'cypress-axe';

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'));
});
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();
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});
// 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',
// 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 },
}
rules: {
// Currently all expandable sections have nested interactive elements
// See https://github.com/DSpace/dspace-angular/issues/2178
'nested-interactive': { enabled: false },
},
} as Options);
});
});
});
16 changes: 8 additions & 8 deletions cypress/e2e/breadcrumbs.cy.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
it('should pass accessibility tests', () => {
// Visit an Item, as those have more breadcrumbs
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));

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

// Analyze <ds-breadcrumbs> for accessibility
testA11y('ds-breadcrumbs');
});
// Analyze <ds-breadcrumbs> for accessibility
testA11y('ds-breadcrumbs');
});
});
14 changes: 7 additions & 7 deletions cypress/e2e/browse-by-author.cy.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { testA11y } from 'cypress/support/utils';

describe('Browse By Author', () => {
it('should pass accessibility tests', () => {
cy.visit('/browse/author');
it('should pass accessibility tests', () => {
cy.visit('/browse/author');

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

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

describe('Browse By Date Issued', () => {
it('should pass accessibility tests', () => {
cy.visit('/browse/dateissued');
it('should pass accessibility tests', () => {
cy.visit('/browse/dateissued');

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

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

describe('Browse By Subject', () => {
it('should pass accessibility tests', () => {
cy.visit('/browse/subject');
it('should pass accessibility tests', () => {
cy.visit('/browse/subject');

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

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

describe('Browse By Title', () => {
it('should pass accessibility tests', () => {
cy.visit('/browse/title');
it('should pass accessibility tests', () => {
cy.visit('/browse/title');

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

// Analyze <ds-browse-by-title-page> for accessibility
testA11y('ds-browse-by-title');
});
// Analyze <ds-browse-by-title-page> for accessibility
testA11y('ds-browse-by-title');
});
});
138 changes: 69 additions & 69 deletions cypress/e2e/collection-edit.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,126 +3,126 @@ 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);
// 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'));
// 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');
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');
});
// 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();
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');
// <ds-collection-roles> tag must be loaded
cy.get('ds-collection-roles').should('be.visible');

// Analyze for accessibility issues
testA11y('ds-collection-roles');
});
// 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();
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');
// <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();
// 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');
// 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');
});
// 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();
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');
// <ds-collection-curate> tag must be loaded
cy.get('ds-collection-curate').should('be.visible');

// Analyze for accessibility issues
testA11y('ds-collection-curate');
});
// 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();
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');
// <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');
});
// 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();
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');
// <ds-collection-authorizations> tag must be loaded
cy.get('ds-collection-authorizations').should('be.visible');

// Analyze for accessibility issues
testA11y('ds-collection-authorizations');
});
// 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();
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');
// <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');
// 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();
// 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');
// 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');
});
// 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();
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');
// <ds-delete-collection> tag must be loaded
cy.get('ds-delete-collection').should('be.visible');

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

0 comments on commit 6203055

Please sign in to comment.