mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
33 lines
967 B
TypeScript
33 lines
967 B
TypeScript
import { testA11y } from 'cypress/support/utils';
|
|
|
|
describe('Homepage', () => {
|
|
beforeEach(() => {
|
|
// All tests start with visiting homepage
|
|
cy.visit('/');
|
|
});
|
|
|
|
it('should display translated title "DSpace Angular :: Home"', () => {
|
|
cy.title().should('eq', 'DSpace Angular :: Home');
|
|
});
|
|
|
|
it('should contain a news section', () => {
|
|
cy.get('ds-home-news').should('be.visible');
|
|
});
|
|
|
|
it('should have a working search box', () => {
|
|
const queryString = 'test';
|
|
cy.get('ds-search-form input[name="query"]').type(queryString);
|
|
cy.get('ds-search-form button.search-button').click();
|
|
cy.url().should('include', '/search');
|
|
cy.url().should('include', 'query=' + encodeURI(queryString));
|
|
});
|
|
|
|
it('should pass accessibility tests', () => {
|
|
// Wait for homepage tag to appear
|
|
cy.get('ds-home-page').should('be.visible');
|
|
|
|
// Analyze <ds-home-page> for accessibility issues
|
|
testA11y('ds-home-page');
|
|
});
|
|
});
|