Commits

Tim Donohue authored e9cd0f4c64a
Ensure admin menu e2e tests hover over admin menu before clicking on it.

Attempt to stabilize tests which open this menu.
No tags

cypress/e2e/admin-add-new-modals.cy.ts

Modified
1 1 import { testA11y } from 'cypress/support/utils';
2 2
3 3 describe('Admin Add New Modals', () => {
4 4 beforeEach(() => {
5 5 // Must login as an Admin for sidebar to appear
6 6 cy.visit('/login');
7 7 cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
8 8 });
9 9
10 10 it('Add new Community modal should pass accessibility tests', () => {
11 11 // Pin the sidebar open
12 + cy.get('#sidebar-collapse-toggle').trigger('mouseover');
12 13 cy.get('#sidebar-collapse-toggle').click();
13 14
14 15 // Click on entry of menu
15 16 cy.get('#admin-menu-section-new-title').should('be.visible');
16 17 cy.get('#admin-menu-section-new-title').click();
17 18
18 19 cy.get('a[data-test="menu.section.new_community"]').click();
19 20
20 21 // Analyze <ds-create-community-parent-selector> for accessibility
21 22 testA11y('ds-create-community-parent-selector');
22 23 });
23 24
24 25 it('Add new Collection modal should pass accessibility tests', () => {
25 26 // Pin the sidebar open
27 + cy.get('#sidebar-collapse-toggle').trigger('mouseover');
26 28 cy.get('#sidebar-collapse-toggle').click();
27 29
28 30 // Click on entry of menu
29 31 cy.get('#admin-menu-section-new-title').should('be.visible');
30 32 cy.get('#admin-menu-section-new-title').click();
31 33
32 34 cy.get('a[data-test="menu.section.new_collection"]').click();
33 35
34 36 // Analyze <ds-create-collection-parent-selector> for accessibility
35 37 testA11y('ds-create-collection-parent-selector');
36 38 });
37 39
38 40 it('Add new Item modal should pass accessibility tests', () => {
39 41 // Pin the sidebar open
42 + cy.get('#sidebar-collapse-toggle').trigger('mouseover');
40 43 cy.get('#sidebar-collapse-toggle').click();
41 44
42 45 // Click on entry of menu
43 46 cy.get('#admin-menu-section-new-title').should('be.visible');
44 47 cy.get('#admin-menu-section-new-title').click();
45 48
46 49 cy.get('a[data-test="menu.section.new_item"]').click();
47 50
48 51 // Analyze <ds-create-item-parent-selector> for accessibility
49 52 testA11y('ds-create-item-parent-selector');

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut