diff --git a/.cypress/integration/3_panels.spec.js b/.cypress/integration/3_panels.spec.js index e7b349633..023a4d2ae 100644 --- a/.cypress/integration/3_panels.spec.js +++ b/.cypress/integration/3_panels.spec.js @@ -35,7 +35,6 @@ const moveToTestPanel = () => { cy.get('.euiTableCellContent').contains(TEST_PANEL).trigger('mouseover').click(); cy.wait(delay * 3); cy.get('h1').contains(TEST_PANEL).should('exist'); - cy.wait(delay); }; describe('Adding sample data and visualization', () => { @@ -103,73 +102,52 @@ describe('Testing panels table', () => { }); it('Displays error toast for invalid panel name', () => { - cy.get('.euiButton__text').contains('Create panel').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiButton__text') - .contains(/^Create$/) - .trigger('mouseover') - .click(); - cy.wait(delay); - + cy.get('button[data-test-subj="customPanels__createNewPanels"]').click(); + cy.get('button[data-test-subj="runModalButton"]').click(); cy.get('.euiToastHeader__title').contains('Invalid Operational Panel name').should('exist'); }); it('Creates a panel and redirects to the panel', () => { - cy.get('.euiButton__text').contains('Create panel').trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="customPanels__createNewPanels"]').click(); cy.get('input.euiFieldText').focus().type(TEST_PANEL, { delay: 50, }); - cy.get('.euiButton__text') - .contains(/^Create$/) - .trigger('mouseover') - .click(); - cy.wait(delay); - + cy.get('button[data-test-subj="runModalButton"]').click(); cy.contains(TEST_PANEL).should('exist'); }); - it('Duplicates and renames a panel', () => { + it('Duplicates a panel', () => { cy.get('.euiCheckbox__input[title="Select this row"]').eq(0).trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiButton__text').contains('Actions').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text').contains('Duplicate').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiButton__text').contains('Duplicate').trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="operationalPanelsActionsButton"]').click(); + cy.get('button[data-test-subj="duplicateContextMenuItem"]').click(); + cy.get('button[data-test-subj="runModalButton"]').click(); + }); - cy.get('.euiCheckbox__input[title="Select this row"]').eq(1).trigger('mouseover').click(); - cy.wait(delay); + it('Renames a panel', () => { cy.get('.euiCheckbox__input[title="Select this row"]').eq(0).trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiButton__text').contains('Actions').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text').contains('Rename').trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="operationalPanelsActionsButton"]').click(); + cy.get('button[data-test-subj="renameContextMenuItem"]').click(); cy.get('input.euiFieldText').focus().type(' (rename)', { delay: 50, }); - cy.get('.euiButton__text').contains('Rename').trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="runModalButton"]').click(); }); it('Searches existing panel', () => { - cy.get('input.euiFieldSearch').focus().type('this panel should not exist', { - delay: 50, - }); - cy.wait(delay); + cy.get('input[data-test-subj="operationalPanelSearchBar"]') + .focus() + .type('this panel should not exist', { + delay: 50, + }); cy.get('.euiTableCellContent__text').contains('No items found').should('exist'); - cy.get('.euiFormControlLayoutClearButton').trigger('mouseover').click(); - cy.wait(delay); - cy.get('input.euiFieldSearch') + cy.get('[aria-label="Clear input"]').click(); + cy.get('input[data-test-subj="operationalPanelSearchBar"]') .focus() .type(TEST_PANEL + ' (copy) (rename)', { delay: 50, }); - cy.wait(delay); cy.get('a.euiLink') .contains(TEST_PANEL + ' (copy) (rename)') @@ -177,34 +155,26 @@ describe('Testing panels table', () => { }); it('Deletes panels', () => { - cy.get('.euiCheckbox__input[data-test-subj="checkboxSelectAll"]').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiButton__text').contains('Actions').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text').contains('Delete').trigger('mouseover').click(); - cy.wait(delay); - - cy.get('button.euiButton--danger').should('be.disabled'); + cy.get('input[data-test-subj="checkboxSelectAll"]').click(); + cy.get('button[data-test-subj="operationalPanelsActionsButton"]').click(); + cy.get('button[data-test-subj="deleteContextMenuItem"]').click(); + cy.get('button[data-test-subj="popoverModal__deleteButton"]').should('be.disabled'); cy.get('input.euiFieldText[placeholder="delete"]').focus().type('delete', { delay: 50, }); - cy.get('button.euiButton--danger').should('not.be.disabled'); - cy.get('.euiButton__text').contains('Delete').trigger('mouseover').click(); - - cy.get('.euiTextAlign').contains('No Operational Panels').should('exist'); + cy.get('button[data-test-subj="popoverModal__deleteButton"]').should('not.be.disabled'); + cy.get('button[data-test-subj="popoverModal__deleteButton"]').click(); + cy.get('h2[data-test-subj="customPanels__noPanelsHome"]').should('exist'); + }); + it('Create a panel for testing', () => { // keep a panel for testing - cy.get('.euiButton__text').contains('Create panel').trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="customPanels__createNewPanels"]').click(); cy.get('input.euiFieldText').focus().type(TEST_PANEL, { delay: 50, }); - cy.get('.euiButton__text') - .contains(/^Create$/) - .trigger('mouseover') - .click(); - cy.wait(delay * 2); + cy.get('button[data-test-subj="runModalButton"]').click(); }); }); @@ -214,66 +184,42 @@ describe('Testing a panel', () => { }); it('Opens visualization flyout from empty panel', () => { - cy.get('.euiButton').eq(4).contains('Add visualization').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text') - .contains('Select existing visualization') - .trigger('mouseover') - .click(); - cy.wait(delay); - cy.get('.euiButton').contains('Cancel').trigger('mouseover').click(); - cy.get('.euiButton').eq(2).contains('Add visualization').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text') - .contains('Select existing visualization') - .trigger('mouseover') - .click(); - cy.wait(delay); - cy.get('.euiButton').contains('Cancel').trigger('mouseover').click(); - cy.get('.euiButton').contains('Add visualization').first().trigger('mouseover').click(); - cy.get('.euiContextMenuItem__text') - .contains('Create new visualization') - .trigger('mouseover') - .click(); - cy.wait(delay); - cy.get('.euiBreadcrumb').contains('Explorer').should('exist'); - cy.get('.euiCallOut').contains('No results match your search criteria').should('exist'); + cy.get('button[data-test-subj="addVisualizationButton"]').eq(1).click(); + cy.get('button[data-test-subj="selectExistingVizContextMenuItem"]').click(); + cy.get('button[data-test-subj="closeFlyoutButton"]').click(); }); it('Redirects to correct page on breadcrumb click', () => { moveToTestPanel(); - cy.get('.euiBreadcrumb').contains(TEST_PANEL).trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiTitle').contains(TEST_PANEL).should('exist'); - cy.get('.euiBreadcrumb').contains('Operational panels').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiTitle').contains('Operational panels').should('exist'); - cy.get('.euiBreadcrumb').contains('Observability').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiTitle').contains('Event analytics').should('exist'); + cy.get('a[data-test-subj="breadcrumb last"]').click(); + + cy.get('h1[data-test-subj="panelNameHeader"]').contains(TEST_PANEL).should('exist'); + cy.get('a[data-test-subj="breadcrumb"]').contains('Operational panels').click(); + + cy.get('a[data-test-subj="breadcrumb last"]').contains('Operational panels').should('exist'); + cy.get('a[data-test-subj="breadcrumb first"]').contains('Observability').click(); + + cy.get('a[data-test-subj="breadcrumb"]').contains('Event analytics').should('exist'); }); it('Duplicate the open panel', () => { moveToTestPanel(); - cy.get('.euiButton__text').contains('Panel actions').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text').contains('Duplicate panel').trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="panelActionContextMenu"]').click(); + + cy.get('button[data-test-subj="duplicatePanelContextMenuItem"]').click(); + cy.get(`input.euiFieldText[value="${TEST_PANEL} (copy)"]`).should('exist'); - cy.get('.euiButton__text').contains('Duplicate').trigger('mouseover').click(); - cy.wait(delay * 3); - cy.get('.euiToastHeader__title').contains('successfully').should('exist'); - cy.get('h1') + cy.get('button[data-test-subj="runModalButton"]').click(); + cy.get('h1[data-test-subj="panelNameHeader"]') .contains(TEST_PANEL + ' (copy)') .should('exist'); - cy.wait(delay); }); it('Rename the open panel', () => { - cy.get('.euiButton__text').contains('Panel actions').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text').contains('Rename panel').trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="panelActionContextMenu"]').click(); + + cy.get('button[data-test-subj="renamePanelContextMenuItem"]').click(); + cy.get(`input.euiFieldText[value="${TEST_PANEL} (copy)"]`) .focus() .clear({ force: true }) @@ -281,11 +227,8 @@ describe('Testing a panel', () => { .type('Renamed Panel', { delay: 200, }); - cy.get('.euiButton__text').contains('Rename').trigger('mouseover').click(); - cy.wait(delay * 3); - cy.get('.euiToastHeader__title').contains('successfully').should('exist'); - cy.get('h1').contains('Renamed Panel').should('exist'); - cy.wait(delay); + cy.get('button[data-test-subj="runModalButton"]').click(); + cy.get('h1[data-test-subj="panelNameHeader"]').contains('Renamed Panel').should('exist'); }); it('Change date filter of the panel', () => { @@ -293,45 +236,37 @@ describe('Testing a panel', () => { cy.get('.euiButtonEmpty[data-test-subj="superDatePickerToggleQuickMenuButton"]').click({ force: true, }); - cy.get('.euiLink').contains('This year').trigger('mouseover').click(); - cy.wait(delay * 2); - cy.get('.euiSuperDatePicker__prettyFormat[data-test-subj="superDatePickerShowDatesButton"]') + cy.get('button[data-test-subj="superDatePickerCommonlyUsed_This_year"]').click(); + cy.get('button[data-test-subj="superDatePickerShowDatesButton"]') .contains('This year') .should('exist'); - cy.wait(delay); }); it('Add existing visualization #1', () => { - cy.get('.euiButton__text').contains('Add visualization').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text') - .contains('Select existing visualization') - .trigger('mouseover') - .click(); - cy.wait(delay); + cy.get('button[data-test-subj="addVisualizationButton"]').eq(0).click(); + + cy.get('button[data-test-subj="selectExistingVizContextMenuItem"]').click(); + cy.get('select').select(PPL_VISUALIZATIONS_NAMES[0]); cy.get('button[aria-label="refreshPreview"]').trigger('mouseover').click(); cy.wait(delay * 2); cy.get('.plot-container').should('exist'); - cy.get('.euiButton__text').contains(new RegExp('^Add$', 'g')).trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="addFlyoutButton"]').click(); + cy.get('.euiToastHeader__title').contains('successfully').should('exist'); }); it('Add existing visualization #2', () => { - cy.get('.euiButton__text').contains('Add visualization').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text') - .contains('Select existing visualization') - .trigger('mouseover') - .click(); - cy.wait(delay); + cy.get('button[data-test-subj="addVisualizationButton"]').eq(0).click(); + + cy.get('button[data-test-subj="selectExistingVizContextMenuItem"]').click(); + cy.get('select').select(PPL_VISUALIZATIONS_NAMES[1]); cy.get('button[aria-label="refreshPreview"]').trigger('mouseover').click(); cy.wait(delay * 2); cy.get('.plot-container').should('exist'); - cy.get('.euiButton__text').contains(new RegExp('^Add$', 'g')).trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="addFlyoutButton"]').click(); + cy.get('.euiToastHeader__title').contains('successfully').should('exist'); }); @@ -345,7 +280,7 @@ describe('Testing a panel', () => { delay: 500, }); - cy.get('.euiButton__text').contains('Refresh').trigger('mouseover').click(); + cy.get('button[data-test-subj="superDatePickerApplyTimeButton"]').click(); cy.wait(delay * 3); cy.get('.xtick').should('contain', 'OpenSearch-Air'); cy.get('.xtick').should('contain', 'Munich Airport'); @@ -353,101 +288,101 @@ describe('Testing a panel', () => { cy.get('.xtick').contains('BeatsWest').should('not.exist'); cy.get('.xtick').contains('Logstash Airways').should('not.exist'); cy.get('.xtick').contains('OpenSearch Dashboards Airlines').should('not.exist'); - cy.wait(delay); }); it('Drag and drop a visualization', () => { - cy.get('.euiButton__text').contains('Edit').trigger('mouseover').click(); - cy.wait(delay); - cy.get('h5') + cy.get('button[data-test-subj="editPanelButton"]').click(); + + cy.get('h5[data-test-subj="visualizationHeader"]') .contains(PPL_VISUALIZATIONS_NAMES[1]) .trigger('mousedown', { which: 1 }) .trigger('mousemove', { clientX: 1100, clientY: 0 }) .trigger('mouseup', { force: true }); - cy.wait(delay); - cy.get('.euiButton__text').contains('Save').trigger('mouseover').click(); + + cy.get('button[data-test-subj="savePanelButton"]').click(); cy.wait(delay * 3); cy.get('div.react-grid-layout>div') .eq(1) .invoke('attr', 'style') .should('match', new RegExp('(.*)transform: translate((.*)10px)(.*)')); - cy.wait(delay); }); it('Resize a visualization', () => { - cy.get('.euiButton__text').contains('Edit').trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="editPanelButton"]').click(); + cy.get('.react-resizable-handle') .eq(1) .trigger('mousedown', { which: 1 }) .trigger('mousemove', { clientX: 2000, clientY: 800 }) .trigger('mouseup', { force: true }); - cy.wait(delay); - cy.get('.euiButton__text').contains('Save').trigger('mouseover').click(); + + cy.get('button[data-test-subj="savePanelButton"]').click(); cy.wait(delay * 3); cy.get('div.react-grid-layout>div').eq(1).invoke('height').should('match', new RegExp('470')); - cy.wait(delay); }); it('Delete a visualization', () => { - cy.get('h5').contains(PPL_VISUALIZATIONS_NAMES[1]).should('exist'); - cy.get('.euiButton__text').contains('Edit').trigger('mouseover').click(); - cy.wait(delay); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(PPL_VISUALIZATIONS_NAMES[1]) + .should('exist'); + cy.get('button[data-test-subj="editPanelButton"]').click(); + cy.get('.visualization-action-button > .euiIcon').eq(1).trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiButton__text').contains('Save').trigger('mouseover').click(); + + cy.get('button[data-test-subj="savePanelButton"]').click(); cy.wait(delay * 3); - cy.get('h5').contains(PPL_VISUALIZATIONS_NAMES[1]).should('not.exist'); - cy.wait(delay); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(PPL_VISUALIZATIONS_NAMES[1]) + .should('not.exist'); }); it('Duplicate a visualization', () => { - cy.get('h5').contains(PPL_VISUALIZATIONS_NAMES[0]).should('exist'); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(PPL_VISUALIZATIONS_NAMES[0]) + .should('exist'); cy.get('button[aria-label="actionMenuButton"]').trigger('mouseover').click(); - cy.get('.euiContextMenu__itemLayout > .euiContextMenuItem__text') - .contains('Duplicate') - .trigger('mouseover') - .click(); + cy.get('button[data-test-subj="duplicateVizContextMenuItem"]').click(); cy.wait(delay * 2); cy.get('.euiToastHeader__title').contains('successfully').should('exist'); - cy.wait(delay); - cy.get('h5').eq(0).contains(PPL_VISUALIZATIONS_NAMES[0]).should('exist'); - cy.get('h5').eq(1).contains(PPL_VISUALIZATIONS_NAMES[0]).should('exist'); - cy.wait(delay); + + cy.get('h5[data-test-subj="visualizationHeader"]') + .eq(0) + .contains(PPL_VISUALIZATIONS_NAMES[0]) + .should('exist'); + cy.get('h5[data-test-subj="visualizationHeader"]') + .eq(1) + .contains(PPL_VISUALIZATIONS_NAMES[0]) + .should('exist'); }); it('Replace a visualization', () => { - cy.get('.visualization-action-button').eq(1).trigger('mouseover').click(); - cy.get('.euiContextMenu__itemLayout > .euiContextMenuItem__text') - .contains('Replace') - .trigger('mouseover') - .click(); + cy.get('button[aria-label="actionMenuButton"]').eq(1).click(); + cy.get('button[data-test-subj="replaceVizContextMenuItem"]').click(); cy.get('select').select(PPL_VISUALIZATIONS_NAMES[1]); cy.get('button[aria-label="refreshPreview"]').trigger('mouseover').click(); cy.wait(delay * 3); cy.get('.plot-container').should('exist'); - cy.get('.euiButton__text').contains(new RegExp('^Add$', 'g')).trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="addFlyoutButton"]').click(); + cy.get('.euiToastHeader__title').contains('successfully').should('exist'); cy.wait(delay); - cy.get('h5').eq(0).contains(PPL_VISUALIZATIONS_NAMES[0]).should('exist'); - cy.get('h5').eq(1).contains(PPL_VISUALIZATIONS_NAMES[1]).should('exist'); - cy.wait(delay); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(PPL_VISUALIZATIONS_NAMES[0]) + .should('exist'); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(PPL_VISUALIZATIONS_NAMES[1]) + .should('exist'); }); - it('Create new visualization and add to panel', () => { - cy.get('.euiButton__text').contains('Add visualization').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text') - .contains('Create new visualization') - .trigger('mouseover') - .click(); - cy.wait(delay * 3); + it('add new visualization to panel', () => { + cy.get('button[data-test-subj="addVisualizationButton"]').eq(0).click(); + cy.get('button[data-test-subj="createNewVizContextMenuItem"]').click(); cy.url().should('match', new RegExp('(.*)#/event_analytics/explorer')); + cy.get('a[data-test-subj="eventExplorer__addNewTab"]').click(); cy.get('[id^=autocomplete-textarea]').focus().type(PPL_VISUALIZATIONS[2], { delay: 50, }); - cy.get('.euiButton__text').contains('Refresh').trigger('mouseover').click(); + cy.get('button[data-test-subj="superDatePickerApplyTimeButton"]').click(); supressResizeObserverIssue(); cy.get('button[id="main-content-vis"]').contains('Visualizations').trigger('mouseover').click(); @@ -465,26 +400,32 @@ describe('Testing a panel', () => { delay: 50, }); cy.get('[data-test-subj="eventExplorer__querySaveConfirm"]').trigger('mouseover').click(); - cy.wait(delay); + cy.get('.euiToastHeader__title').contains('successfully').should('exist'); moveToTestPanel(); - cy.get('h5').contains(PPL_VISUALIZATIONS_NAMES[0]).should('exist'); - cy.get('h5').contains(PPL_VISUALIZATIONS_NAMES[1]).should('exist'); - cy.get('h5').contains(PPL_VISUALIZATIONS_NAMES[2]).should('exist'); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(PPL_VISUALIZATIONS_NAMES[0]) + .should('exist'); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(PPL_VISUALIZATIONS_NAMES[1]) + .should('exist'); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(PPL_VISUALIZATIONS_NAMES[2]) + .should('exist'); }); - it('Move to test panel and check visualization edit button', () => { + it('Check visualization edit button', () => { moveToTestPanel(); - cy.get('h5').contains(PPL_VISUALIZATIONS_NAMES[0]).should('exist'); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(PPL_VISUALIZATIONS_NAMES[0]) + .should('exist'); cy.get('button[aria-label="actionMenuButton"]').eq(0).trigger('mouseover').click(); supressResizeObserverIssue(); - cy.get('.euiContextMenu__itemLayout > .euiContextMenuItem__text') - .contains('Edit') - .trigger('mouseover') - .click(); + cy.get('button[data-test-subj="editVizContextMenuItem"]').click(); cy.wait(delay * 3); cy.url().should('match', new RegExp('(.*)#/event_analytics/explorer')); cy.wait(delay); + cy.get('[data-test-subj="eventExplorer__saveManagementPopover"]').trigger('mouseover').click(); cy.wait(1000); cy.get('[data-test-subj="eventExplorer__querySaveName"]') @@ -493,53 +434,51 @@ describe('Testing a panel', () => { delay: 200, }); cy.get('[data-test-subj="eventExplorer__querySaveConfirm"]').trigger('mouseover').click(); - cy.wait(delay); + cy.get('.euiToastHeader__title').contains('successfully').should('exist'); moveToTestPanel(); - cy.get('h5').contains(NEW_VISUALIZATION_NAME).should('exist'); - cy.get('h5').contains(PPL_VISUALIZATIONS_NAMES[1]).should('exist'); - cy.get('h5').contains(PPL_VISUALIZATIONS_NAMES[2]).should('exist'); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(NEW_VISUALIZATION_NAME) + .should('exist'); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(PPL_VISUALIZATIONS_NAMES[1]) + .should('exist'); + cy.get('h5[data-test-subj="visualizationHeader"]') + .contains(PPL_VISUALIZATIONS_NAMES[2]) + .should('exist'); }); }); describe('Clean up all test data', () => { - it('Delete visualizations from event analytics', () => { moveToEventsHome(); cy.get('[data-test-subj="tablePaginationPopoverButton"]').trigger('mouseover').click(); - cy.get('.euiContextMenuItem__text').contains('50 rows').trigger('mouseover').click(); + cy.get('button[data-test-subj="tablePagination-50-rows"]').click(); cy.get('.euiCheckbox__input[data-test-subj="checkboxSelectAll"]').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiButton__text').contains('Actions').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text').contains('Delete').trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="eventHomeAction"]').click(); + + cy.get('button[data-test-subj="eventHomeAction__delete"]').click(); cy.get('button.euiButton--danger').should('be.disabled'); cy.get('input.euiFieldText[placeholder="delete"]').focus().type('delete', { delay: 50, }); cy.get('button.euiButton--danger').should('not.be.disabled'); - cy.get('.euiButton__text').contains('Delete').trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="popoverModal__deleteButton"]').click(); cy.get('.euiTextAlign').contains('No Queries or Visualizations').should('exist'); }); it('Deletes test panel', () => { moveToPanelHome(); cy.get('.euiCheckbox__input[data-test-subj="checkboxSelectAll"]').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiButton__text').contains('Actions').trigger('mouseover').click(); - cy.wait(delay); - cy.get('.euiContextMenuItem__text').contains('Delete').trigger('mouseover').click(); - cy.wait(delay); + cy.get('button[data-test-subj="operationalPanelsActionsButton"]').click(); + cy.get('button[data-test-subj="deleteContextMenuItem"]').click(); cy.get('button.euiButton--danger').should('be.disabled'); cy.get('input.euiFieldText[placeholder="delete"]').focus().type('delete', { delay: 50, }); cy.get('button.euiButton--danger').should('not.be.disabled'); - cy.get('.euiButton__text').contains('Delete').trigger('mouseover').click(); + cy.get('button[data-test-subj="popoverModal__deleteButton"]').click(); cy.get('.euiTextAlign').contains('No Operational Panels').should('exist'); }); }); - diff --git a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_table.test.tsx.snap b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_table.test.tsx.snap index 879d250c5..66fdf6c39 100644 --- a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_table.test.tsx.snap +++ b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_table.test.tsx.snap @@ -417,7 +417,9 @@ exports[`Panels Table Component renders empty panel table container 1`] = `
-

+

No Operational Panels

@@ -170,12 +171,14 @@ exports[`Panels View Component renders panel view container with visualizations className="euiFlexItem" >