0
0
Fork 0

perf: refs #7889 perf shortcut test

This commit is contained in:
Jon Elias 2024-09-09 09:45:30 +02:00
parent de08ae81a3
commit 2bd80b2ee7
1 changed files with 15 additions and 15 deletions

View File

@ -1,4 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('VnShortcuts', () => { describe('VnShortcuts', () => {
const modules = { const modules = {
item: 'a', item: 'a',
@ -7,27 +8,26 @@ describe('VnShortcuts', () => {
claim: 'r', claim: 'r',
worker: 'w', worker: 'w',
monitor: 'm', monitor: 'm',
order: 'p', order: 'o',
supplier: 'p', supplier: 'p',
entry: 'e', entry: 'e',
zone: 'z', zone: 'z',
account: 'u', account: 'u',
}; };
beforeEach(() => {
it('should visit each module', () => {
cy.login('developer'); cy.login('developer');
cy.visit('/'); cy.visit('/');
Object.keys(modules).forEach((module) => { });
const shortcut = modules[module];
cy.get('body').click(); for (const [module, shortcut] of Object.entries(modules)) {
cy.get('body').type(`{ctrl+alt+${shortcut}}`); it(`should visit ${module} module`, () => {
cy.get('body').trigger('keydown', {
ctrlKey: true,
altKey: true,
code: `Key${shortcut.toUpperCase()}`,
});
if (shortcut != 'u' && shortcut != 'o') { cy.url().should('include', module);
cy.get('.q-table__middle').should('be.visible'); });
} }
cy.visit('/');
});
});
}); });