forked from verdnatura/salix-front
perf: refs #7889 perf shortcut test
This commit is contained in:
parent
de08ae81a3
commit
2bd80b2ee7
|
@ -1,4 +1,5 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
describe('VnShortcuts', () => {
|
||||
const modules = {
|
||||
item: 'a',
|
||||
|
@ -7,27 +8,26 @@ describe('VnShortcuts', () => {
|
|||
claim: 'r',
|
||||
worker: 'w',
|
||||
monitor: 'm',
|
||||
order: 'p',
|
||||
order: 'o',
|
||||
supplier: 'p',
|
||||
entry: 'e',
|
||||
zone: 'z',
|
||||
account: 'u',
|
||||
};
|
||||
|
||||
it('should visit each module', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.visit('/');
|
||||
Object.keys(modules).forEach((module) => {
|
||||
const shortcut = modules[module];
|
||||
|
||||
cy.get('body').click();
|
||||
cy.get('body').type(`{ctrl+alt+${shortcut}}`);
|
||||
|
||||
if (shortcut != 'u' && shortcut != 'o') {
|
||||
cy.get('.q-table__middle').should('be.visible');
|
||||
}
|
||||
|
||||
cy.visit('/');
|
||||
});
|
||||
});
|
||||
|
||||
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()}`,
|
||||
});
|
||||
|
||||
cy.url().should('include', module);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue