2024-09-06 08:30:32 +00:00
|
|
|
/// <reference types="cypress" />
|
2024-09-09 07:45:30 +00:00
|
|
|
|
2024-09-06 08:30:32 +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',
|
2024-09-06 08:30:32 +00:00
|
|
|
supplier: 'p',
|
2024-09-09 06:47:44 +00:00
|
|
|
entry: 'e',
|
2024-09-06 08:30:32 +00:00
|
|
|
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-06 08:30:32 +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-06 08:30:32 +00:00
|
|
|
|
2024-09-09 07:45:30 +00:00
|
|
|
cy.url().should('include', module);
|
2024-09-06 08:30:32 +00:00
|
|
|
});
|
2024-09-09 07:45:30 +00:00
|
|
|
}
|
2024-09-06 08:30:32 +00:00
|
|
|
});
|