mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Minor test cleanup after upgrade
This commit is contained in:
@@ -7,7 +7,7 @@ describe('Collection Page', () => {
|
|||||||
cy.visit('/collections/' + TEST_COLLECTION);
|
cy.visit('/collections/' + TEST_COLLECTION);
|
||||||
|
|
||||||
// <ds-collection-page> tag must be loaded
|
// <ds-collection-page> tag must be loaded
|
||||||
cy.get('ds-collection-page').should('exist');
|
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');
|
||||||
|
@@ -12,7 +12,7 @@ describe('Collection Statistics Page', () => {
|
|||||||
|
|
||||||
it('should contain a "Total visits" section', () => {
|
it('should contain a "Total visits" section', () => {
|
||||||
cy.visit(COLLECTIONSTATISTICSPAGE);
|
cy.visit(COLLECTIONSTATISTICSPAGE);
|
||||||
cy.get('.' + TEST_COLLECTION + '_TotalVisits').should('exist');
|
cy.get('.' + TEST_COLLECTION + '_TotalVisits').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain a "Total visits per month" section', () => {
|
it('should contain a "Total visits per month" section', () => {
|
||||||
@@ -24,7 +24,7 @@ describe('Collection Statistics Page', () => {
|
|||||||
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('exist');
|
cy.get('ds-collection-statistics-page').should('be.visible');
|
||||||
|
|
||||||
// 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');
|
||||||
|
@@ -7,10 +7,10 @@ describe('Community List Page', () => {
|
|||||||
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('exist');
|
cy.get('ds-community-list-page').should('be.visible');
|
||||||
|
|
||||||
// Open first Community (to show Collections)...that way we scan sub-elements as well
|
// Open every expand button on page, so that we can scan sub-elements as well
|
||||||
cy.get('ds-community-list :nth-child(1) > .btn-group > .btn').click();
|
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
|
||||||
// Disable heading-order checks until it is fixed
|
// Disable heading-order checks until it is fixed
|
||||||
|
@@ -7,7 +7,7 @@ describe('Community Page', () => {
|
|||||||
cy.visit('/communities/' + TEST_COMMUNITY);
|
cy.visit('/communities/' + TEST_COMMUNITY);
|
||||||
|
|
||||||
// <ds-community-page> tag must be loaded
|
// <ds-community-page> tag must be loaded
|
||||||
cy.get('ds-community-page').should('exist');
|
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',);
|
||||||
|
@@ -12,7 +12,7 @@ describe('Community Statistics Page', () => {
|
|||||||
|
|
||||||
it('should contain a "Total visits" section', () => {
|
it('should contain a "Total visits" section', () => {
|
||||||
cy.visit(COMMUNITYSTATISTICSPAGE);
|
cy.visit(COMMUNITYSTATISTICSPAGE);
|
||||||
cy.get('.' + TEST_COMMUNITY + '_TotalVisits').should('exist');
|
cy.get('.' + TEST_COMMUNITY + '_TotalVisits').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain a "Total visits per month" section', () => {
|
it('should contain a "Total visits per month" section', () => {
|
||||||
@@ -24,7 +24,7 @@ describe('Community Statistics Page', () => {
|
|||||||
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('exist');
|
cy.get('ds-community-statistics-page').should('be.visible');
|
||||||
|
|
||||||
// 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');
|
||||||
|
@@ -16,7 +16,7 @@ describe('Item Page', () => {
|
|||||||
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('exist');
|
cy.get('ds-item-page').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-item-page> for accessibility issues
|
// Analyze <ds-item-page> for accessibility issues
|
||||||
// Disable heading-order checks until it is fixed
|
// Disable heading-order checks until it is fixed
|
||||||
|
@@ -12,13 +12,13 @@ describe('Item Statistics Page', () => {
|
|||||||
|
|
||||||
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('exist');
|
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('.' + TEST_ENTITY_PUBLICATION + '_TotalVisits').should('exist');
|
cy.get('.' + TEST_ENTITY_PUBLICATION + '_TotalVisits').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain a "Total visits per month" section', () => {
|
it('should contain a "Total visits per month" section', () => {
|
||||||
@@ -30,7 +30,7 @@ describe('Item Statistics Page', () => {
|
|||||||
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('exist');
|
cy.get('ds-item-statistics-page').should('be.visible');
|
||||||
|
|
||||||
// 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');
|
||||||
|
@@ -9,7 +9,7 @@ describe('My DSpace 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(TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD);
|
cy.loginViaForm(TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD);
|
||||||
|
|
||||||
cy.get('ds-my-dspace-page').should('exist');
|
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');
|
||||||
@@ -42,12 +42,12 @@ describe('My DSpace 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(TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD);
|
cy.loginViaForm(TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD);
|
||||||
|
|
||||||
cy.get('ds-my-dspace-page').should('exist');
|
cy.get('ds-my-dspace-page').should('be.visible');
|
||||||
|
|
||||||
// Click button in sidebar to display detailed view
|
// Click button in sidebar to display detailed view
|
||||||
cy.get('ds-search-sidebar [data-test="detail-view"]').click();
|
cy.get('ds-search-sidebar [data-test="detail-view"]').click();
|
||||||
|
|
||||||
cy.get('ds-object-detail').should('exist');
|
cy.get('ds-object-detail').should('be.visible');
|
||||||
|
|
||||||
// Analyze <ds-search-page> for accessibility issues
|
// Analyze <ds-search-page> for accessibility issues
|
||||||
testA11y('ds-my-dspace-page',
|
testA11y('ds-my-dspace-page',
|
||||||
|
@@ -2,7 +2,7 @@ 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('exist');
|
cy.get('ds-pagenotfound').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not contain element ds-pagenotfound when navigating to existing page', () => {
|
it('should not contain element ds-pagenotfound when navigating to existing page', () => {
|
||||||
|
@@ -17,7 +17,7 @@ describe('Search Page', () => {
|
|||||||
cy.get('[data-test="search-box"]').should('have.value', TEST_SEARCH_TERM);
|
cy.get('[data-test="search-box"]').should('have.value', TEST_SEARCH_TERM);
|
||||||
|
|
||||||
// <ds-search-page> tag must be loaded
|
// <ds-search-page> tag must be loaded
|
||||||
cy.get('ds-search-page').should('exist');
|
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');
|
||||||
@@ -51,7 +51,7 @@ describe('Search Page', () => {
|
|||||||
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('exist');
|
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');
|
||||||
|
@@ -40,5 +40,13 @@ export const testA11y = (context?: any, options?: Options) => {
|
|||||||
{ id: 'color-contrast', enabled: false },
|
{ id: 'color-contrast', enabled: false },
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
// Default retries to 2, meaning this accessibility test will retry up to 2 times.
|
||||||
|
const a11yRetries = 2;
|
||||||
|
if (options) {
|
||||||
|
options.retries = a11yRetries;
|
||||||
|
} else {
|
||||||
|
options = { retries: a11yRetries } as Options;
|
||||||
|
}
|
||||||
|
|
||||||
cy.checkA11y(context, options, terminalLog);
|
cy.checkA11y(context, options, terminalLog);
|
||||||
};
|
};
|
||||||
|
@@ -28,7 +28,8 @@
|
|||||||
[title]="'toggle ' + node.name"
|
[title]="'toggle ' + node.name"
|
||||||
[attr.aria-label]="'toggle ' + node.name"
|
[attr.aria-label]="'toggle ' + node.name"
|
||||||
(click)="toggleExpanded(node)"
|
(click)="toggleExpanded(node)"
|
||||||
[ngClass]="(hasChild(null, node)| async) ? 'visible' : 'invisible'">
|
[ngClass]="(hasChild(null, node)| async) ? 'visible' : 'invisible'"
|
||||||
|
[attr.data-test]="(hasChild(null, node)| async) ? 'expand-button' : ''">
|
||||||
<span class="{{node.isExpanded ? 'fa fa-chevron-down' : 'fa fa-chevron-right'}}"
|
<span class="{{node.isExpanded ? 'fa fa-chevron-down' : 'fa fa-chevron-right'}}"
|
||||||
aria-hidden="true"></span>
|
aria-hidden="true"></span>
|
||||||
</button>
|
</button>
|
||||||
|
Reference in New Issue
Block a user