salix-front/test/cypress/integration/vnComponent/VnShortcut.spec.js

34 lines
778 B
JavaScript
Raw Permalink Normal View History

/// <reference types="cypress" />
2024-09-09 07:45:30 +00:00
describe('VnShortcuts', () => {
const modules = {
item: 'a',
customer: 'c',
ticket: 't',
claim: 'r',
worker: 'w',
monitor: 'm',
2024-09-09 07:45:30 +00:00
order: 'o',
supplier: 'p',
2024-09-09 06:47:44 +00:00
entry: 'e',
zone: 'z',
account: 'u',
};
2024-09-09 07:45:30 +00:00
beforeEach(() => {
2024-09-09 06:47:44 +00:00
cy.login('developer');
cy.visit('/');
2024-09-09 07:45:30 +00:00
});
2024-09-09 07:45:30 +00:00
for (const [module, shortcut] of Object.entries(modules)) {
it(`should visit ${module} module`, () => {
cy.get('body').trigger('keydown', {
ctrlKey: true,
altKey: true,
code: `Key${shortcut.toUpperCase()}`,
});
2024-09-09 07:45:30 +00:00
cy.url().should('include', module);
});
2024-09-09 07:45:30 +00:00
}
});