an extra test

This commit is contained in:
joshhunt
2024-06-06 11:10:41 +01:00
parent b47b3da86b
commit 72f9411dbd
+18
View File
@@ -26,6 +26,24 @@ describe('Keyboard shortcuts', options, () => {
e2e.components.Panels.Panel.title('Latest from the blog').should('be.visible');
});
it('ctrl+z should zoom out the time range', options, () => {
cy.get('body').type('ge');
e2e.pages.Explore.General.container().should('be.visible');
// Time range is 1 minute, so each shortcut press should jump back or forward by 1 minute
e2e.flows.setTimeRange({
from: '2024-06-05 10:05:00',
to: '2024-06-05 10:06:00',
zone: 'Browser',
});
e2e.components.TimePicker.fromField().should('not.exist');
cy.wait(500); // waiting is anti-pattern, but it's inconsistent for me locally without this
cy.get('body').type('{ctrl}z');
let expectedRange = `Time range selected: 2024-06-05 10:03:30 to 2024-06-05 10:07:30`;
e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange);
});
it('multiple time range shortcuts should work', options, () => {
cy.get('body').type('ge');
e2e.pages.Explore.General.container().should('be.visible');