mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Automated upgrade to Cypress 12.
This commit is contained in:
32
cypress/e2e/homepage.cy.ts
Normal file
32
cypress/e2e/homepage.cy.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
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('[data-test="search-box"]').type(queryString);
|
||||
cy.get('[data-test="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');
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user