|
|
|
@ -1,7 +1,11 @@ |
|
|
|
|
import { e2e } from '../utils'; |
|
|
|
|
import { fromBaseUrl } from '../utils/support/url'; |
|
|
|
|
|
|
|
|
|
describe('Keyboard shortcuts', () => { |
|
|
|
|
const options = { |
|
|
|
|
defaultCommandTimeout: 5 * 1000, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
describe('Keyboard shortcuts', options, () => { |
|
|
|
|
beforeEach(() => { |
|
|
|
|
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD')); |
|
|
|
|
|
|
|
|
@ -22,7 +26,7 @@ describe('Keyboard shortcuts', () => { |
|
|
|
|
e2e.components.Panels.Panel.title('Latest from the blog').should('be.visible'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('ctrl+z should zoom out the time range', () => { |
|
|
|
|
it('ctrl+z should zoom out the time range', options, () => { |
|
|
|
|
cy.get('body').type('ge'); |
|
|
|
|
e2e.pages.Explore.General.container().should('be.visible'); |
|
|
|
|
|
|
|
|
@ -33,13 +37,14 @@ describe('Keyboard shortcuts', () => { |
|
|
|
|
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', () => { |
|
|
|
|
it('multiple time range shortcuts should work', options, () => { |
|
|
|
|
cy.get('body').type('ge'); |
|
|
|
|
e2e.pages.Explore.General.container().should('be.visible'); |
|
|
|
|
|
|
|
|
@ -50,6 +55,7 @@ describe('Keyboard shortcuts', () => { |
|
|
|
|
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.log('Trying one shift-left'); |
|
|
|
|
cy.get('body').type('t{leftarrow}'); |
|
|
|
|