Keybinds: Add wait to e2e test to hopefully mitigate flakiness (#88854)

Revert "remove anti-patterns"

This reverts commit 55eb0fa32a.
pull/88859/head
Josh Hunt 1 year ago committed by GitHub
parent 62fc451f7a
commit be96971289
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      e2e/various-suite/keybinds.spec.ts

@ -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}');

Loading…
Cancel
Save