From 54cfae8fef337dde7308b59e80781e623c7f893c Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Wed, 26 Jun 2024 10:37:33 +0100 Subject: [PATCH] Chore: Simplify keybinds e2e test (#89760) simplify keybinds e2e test --- e2e/scenes/various-suite/keybinds.spec.ts | 24 +++-------------------- e2e/various-suite/keybinds.spec.ts | 24 +++-------------------- 2 files changed, 6 insertions(+), 42 deletions(-) diff --git a/e2e/scenes/various-suite/keybinds.spec.ts b/e2e/scenes/various-suite/keybinds.spec.ts index 88e256b5576..624731dbec4 100644 --- a/e2e/scenes/various-suite/keybinds.spec.ts +++ b/e2e/scenes/various-suite/keybinds.spec.ts @@ -41,7 +41,7 @@ describe.skip('Keyboard shortcuts', () => { e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); }); - it('multiple time range shortcuts should work', () => { + it('time range shortcuts should work', () => { cy.get('body').type('ge'); e2e.pages.Explore.General.container().should('be.visible'); @@ -61,28 +61,10 @@ describe.skip('Keyboard shortcuts', () => { expectedRange = `Time range selected: 2024-06-05 10:04:00 to 2024-06-05 10:05:00`; // 1 min back e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); - cy.log('Trying two shift-lefts'); - cy.get('body').type('t{leftarrow}'); - e2e.components.RefreshPicker.runButtonV2().should('have.text', 'Run query'); - expectedRange = `Time range selected: 2024-06-05 10:03:00 to 2024-06-05 10:04:00`; // 1 min back - e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); - cy.get('body').type('t{leftarrow}'); - e2e.components.RefreshPicker.runButtonV2().should('have.text', 'Run query'); - expectedRange = `Time range selected: 2024-06-05 10:02:00 to 2024-06-05 10:03:00`; // 2 mins back - e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); - - cy.log('Trying two shift-lefts and a shift-right'); - cy.get('body').type('t{leftarrow}'); - e2e.components.RefreshPicker.runButtonV2().should('have.text', 'Run query'); - expectedRange = `Time range selected: 2024-06-05 10:01:00 to 2024-06-05 10:02:00`; // 1 min back - e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); - cy.get('body').type('t{leftarrow}'); - e2e.components.RefreshPicker.runButtonV2().should('have.text', 'Run query'); - expectedRange = `Time range selected: 2024-06-05 10:00:00 to 2024-06-05 10:01:00`; // 2 mins back - e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); + cy.log('Trying one shift-right'); cy.get('body').type('t{rightarrow}'); e2e.components.RefreshPicker.runButtonV2().should('have.text', 'Run query'); - expectedRange = `Time range selected: 2024-06-05 10:01:00 to 2024-06-05 10:02:00`; // 1 min forward (1 min back total) + expectedRange = `Time range selected: 2024-06-05 10:05:00 to 2024-06-05 10:06:00`; // 1 min forward e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); }); }); diff --git a/e2e/various-suite/keybinds.spec.ts b/e2e/various-suite/keybinds.spec.ts index 37f3c8da9c0..3f51fe04037 100644 --- a/e2e/various-suite/keybinds.spec.ts +++ b/e2e/various-suite/keybinds.spec.ts @@ -42,7 +42,7 @@ describe('Keyboard shortcuts', () => { e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); }); - it('multiple time range shortcuts should work', () => { + it('time range shortcuts should work', () => { cy.get('body').type('ge'); e2e.pages.Explore.General.container().should('be.visible'); @@ -62,28 +62,10 @@ describe('Keyboard shortcuts', () => { expectedRange = `Time range selected: 2024-06-05 10:04:00 to 2024-06-05 10:05:00`; // 1 min back e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); - cy.log('Trying two shift-lefts'); - cy.get('body').type('t{leftarrow}'); - e2e.components.RefreshPicker.runButtonV2().should('have.text', 'Run query'); - expectedRange = `Time range selected: 2024-06-05 10:03:00 to 2024-06-05 10:04:00`; // 1 min back - e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); - cy.get('body').type('t{leftarrow}'); - e2e.components.RefreshPicker.runButtonV2().should('have.text', 'Run query'); - expectedRange = `Time range selected: 2024-06-05 10:02:00 to 2024-06-05 10:03:00`; // 2 mins back - e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); - - cy.log('Trying two shift-lefts and a shift-right'); - cy.get('body').type('t{leftarrow}'); - e2e.components.RefreshPicker.runButtonV2().should('have.text', 'Run query'); - expectedRange = `Time range selected: 2024-06-05 10:01:00 to 2024-06-05 10:02:00`; // 1 min back - e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); - cy.get('body').type('t{leftarrow}'); - e2e.components.RefreshPicker.runButtonV2().should('have.text', 'Run query'); - expectedRange = `Time range selected: 2024-06-05 10:00:00 to 2024-06-05 10:01:00`; // 2 mins back - e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); + cy.log('Trying one shift-right'); cy.get('body').type('t{rightarrow}'); e2e.components.RefreshPicker.runButtonV2().should('have.text', 'Run query'); - expectedRange = `Time range selected: 2024-06-05 10:01:00 to 2024-06-05 10:02:00`; // 1 min forward (1 min back total) + expectedRange = `Time range selected: 2024-06-05 10:05:00 to 2024-06-05 10:06:00`; // 1 min forward e2e.components.TimePicker.openButton().should('have.attr', 'aria-label', expectedRange); }); });