diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos.spec.js index 4283e0f4f..9716ec06e 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos.spec.js @@ -37,7 +37,6 @@ describe('date_nanos', () => { cy.setTopNavDate(fromTime, toTime); cy.waitForSearch(); - cy.switchDiscoverTable('new'); }); after(() => { @@ -48,8 +47,8 @@ describe('date_nanos', () => { it('should show a timestamp with nanoseconds in the first result row', function () { cy.verifyTimeConfig(fromTime, toTime); - cy.get(`[data-test-subj="dataGridRowCell"]`) - .eq(1) + cy.get(`[data-test-subj="osdDocTableCellDataField"]`) + .eq(0) .contains('Sep 22, 2019 @ 16:50:13.253123345'); }); }); diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos_mixed.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos_mixed.spec.js index 6cc468c6a..17c05d771 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos_mixed.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos_mixed.spec.js @@ -36,7 +36,6 @@ describe('date_nanos_mixed', () => { const toTime = 'Jan 1, 2019 @ 23:59:59.999'; cy.setTopNavDate(fromTime, toTime); cy.waitForSearch(); - cy.switchDiscoverTable('new'); }); after(() => { @@ -46,20 +45,20 @@ describe('date_nanos_mixed', () => { }); it('shows a list of records of indices with date & date_nanos fields in the right order', function () { - cy.get(`[data-test-subj="dataGridRowCell"]`) - .eq(1) + cy.get(`[data-test-subj="osdDocTableCellDataField"]`) + .eq(0) .contains('Jan 1, 2019 @ 04:10:30.124000000'); - cy.get(`[data-test-subj="dataGridRowCell"]`) - .eq(4) + cy.get(`[data-test-subj="osdDocTableCellDataField"]`) + .eq(1) .contains('Jan 1, 2019 @ 04:10:30.123498765'); - cy.get(`[data-test-subj="dataGridRowCell"]`) - .eq(7) + cy.get(`[data-test-subj="osdDocTableCellDataField"]`) + .eq(2) .contains('Jan 1, 2019 @ 04:10:30.123456789'); - cy.get(`[data-test-subj="dataGridRowCell"]`) - .eq(10) + cy.get(`[data-test-subj="osdDocTableCellDataField"]`) + .eq(3) .contains('Jan 1, 2019 @ 04:10:30.123000000'); }); }); diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js index 3c30216f6..5d1c73b0d 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js @@ -53,7 +53,6 @@ describe('discover app', { scrollBehavior: false }, () => { ); cy.waitForLoader(); cy.waitForSearch(); - cy.switchDiscoverTable('new'); }); beforeEach(() => { @@ -67,7 +66,6 @@ describe('discover app', { scrollBehavior: false }, () => { after(() => { cy.get('[data-test-subj~="filter-key-extension.raw"]').click(); cy.getElementByTestId(`deleteFilter`).click(); - cy.switchDiscoverTable('legacy'); }); it('should persist across refresh', function () { // Set up query and filter @@ -79,15 +77,6 @@ describe('discover app', { scrollBehavior: false }, () => { 'be.visible' ); }); - - it('should persist across switching table', function () { - cy.switchDiscoverTable('new'); - cy.getElementByTestId(`queryInput`).should('have.text', 'response:200'); - cy.get('[data-test-subj~="filter-key-extension.raw"]').should( - 'be.visible' - ); - cy.clearTopNavQuery(); - }); }); describe('save search', () => { @@ -124,13 +113,6 @@ describe('discover app', { scrollBehavior: false }, () => { .should('have.text', saveSearch2); }); - it('should show the correct hit count', function () { - cy.loadSaveSearch(saveSearch2); - cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); - const expectedHitCount = '14,004'; - cy.verifyHitCount(expectedHitCount); - }); - it('should show correct time range string in chart', function () { cy.getElementByTestId('discoverIntervalDateRange').should( 'have.text', @@ -171,7 +153,6 @@ describe('discover app', { scrollBehavior: false }, () => { before(() => { CURRENT_TENANT.newTenant = 'global'; cy.fleshTenantSettings(); - cy.switchDiscoverTable('new'); cy.setTopNavDate(fromTime, toTime); }); @@ -285,10 +266,6 @@ describe('discover app', { scrollBehavior: false }, () => { }); describe('refresh interval', function () { - beforeEach(() => { - cy.switchDiscoverTable('new'); - }); - it('should refetch when autofresh is enabled', () => { cy.getElementByTestId('openInspectorButton').click(); cy.getElementByTestId('inspectorPanel') diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js index 55cbed79b..5536ffa53 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js @@ -100,52 +100,6 @@ describe('discover_advanced_setting', () => { }); describe('Default Sort Order advanced setting', () => { - it('check Default Sort Order Descending is respected in new table', function () { - cy.setAdvancedSetting({ - 'discover:sort:defaultOrder': 'desc', - }); - cy.reload(); - cy.switchDiscoverTable('new'); - cy.wait(2000); // Intentional Wait to account for low performant env - - cy.get('.euiDataGridRowCell--date') - .eq(0) - .invoke('text') - .then((date1) => { - cy.get('.euiDataGridRowCell--date') - .eq(99) - .invoke('text') - .then((date2) => { - expect(new Date(date1.slice(0, -18))).greaterThan( - new Date(date2.slice(0, -20)) - ); - }); - }); - }); - - it('check Default Sort Order Ascending is respected in new table', function () { - cy.setAdvancedSetting({ - 'discover:sort:defaultOrder': 'asc', - }); - cy.reload(); - cy.switchDiscoverTable('new'); - cy.wait(2000); // Intentional Wait to account for low performant env - - cy.get('.euiDataGridRowCell--date') - .eq(0) - .invoke('text') - .then((date1) => { - cy.get('.euiDataGridRowCell--date') - .eq(99) - .invoke('text') - .then((date2) => { - expect(new Date(date1.slice(0, -18))).lessThan( - new Date(date2.slice(0, -20)) - ); - }); - }); - }); - it('check Default Sort Order Descending is respected in legacy table', function () { cy.setAdvancedSetting({ 'discover:sort:defaultOrder': 'desc', @@ -202,19 +156,10 @@ describe('discover_advanced_setting', () => { 'discover:sampleSize': 5, }); cy.reload(); - cy.switchDiscoverTable('new'); cy.wait(2000); // Intentional Wait to account for low performant env }); - it('check new table respects Number of rows setting', function () { - cy.get('[aria-label="Inspect document details"]').should( - 'have.length', - 5 - ); - }); - it('check legacy table respects Number of rows setting', function () { - cy.switchDiscoverTable('legacy'); cy.wait(2000); // Intentional Wait to account for low performant env cy.get('[aria-label="Toggle row details"]').should('have.length', 5); }); @@ -266,22 +211,6 @@ describe('discover_advanced_setting', () => { }); }); - it('check time is not added on removing last column when hideTimeColumn is true in new table', function () { - miscUtils.visitPage( - `app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))` - ); - cy.waitForSearch(); - cy.switchDiscoverTable('new'); - cy.get('[data-test-subj="dataGridHeaderCell-@timestamp"]').should( - 'not.exist' - ); - cy.get('[data-test-subj="fieldToggle-agent"]').click(); - cy.get('[data-test-subj="fieldToggle-agent"]').click(); - cy.get('[data-test-subj="dataGridHeaderCell-@timestamp"]').should( - 'not.exist' - ); - }); - it('check time is not added on removing last column when hideTimeColumn is true in legacy table', function () { miscUtils.visitPage( `app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))` @@ -321,24 +250,6 @@ describe('discover_advanced_setting', () => { }); }); - it('check new table respects doc_table:highlight setting', function () { - // check if we have highlighted fields - cy.get('mark').should('exist'); - - cy.setAdvancedSetting({ - 'doc_table:highlight': false, - }); - cy.reload(); - cy.switchDiscoverTable('new'); - cy.get('mark').should('not.exist'); - - // reset the setting to default value - cy.setAdvancedSetting({ - 'doc_table:highlight': true, - }); - cy.reload(); - }); - it('check legacy table respects doc_table:highlight setting', function () { // check if we have highlighted fields cy.setAdvancedSetting({ @@ -384,18 +295,6 @@ describe('discover_advanced_setting', () => { }); }); - it('check defaultcolumns setting is respected in new table', function () { - cy.setAdvancedSetting({ - defaultColumns: ['host', 'agent'], - }); - cy.reload(); - cy.switchDiscoverTable('new'); - cy.get('[data-test-subj="dataGridHeaderCell-agent"]').should( - 'be.visible' - ); - cy.get('[data-test-subj="dataGridHeaderCell-host"]').should('be.visible'); - }); - it('check defaultcolumns setting is respected in legacy table', function () { cy.setAdvancedSetting({ defaultColumns: ['host', 'agent'], @@ -481,34 +380,6 @@ describe('modifyColumnsOnSwitch advanced setting', () => { */ }); - it('check columns still available after switching data sources in new table', function () { - miscUtils.visitPage( - `app/data-explorer/discover#/?_a=(discover:(metadata:(indexPattern:'logstash-*',view:discover))&_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))` - ); - cy.waitForSearch(); - cy.switchDiscoverTable('new'); - - cy.get('[data-test-subj="fieldToggle-agent"]').click(); - - // Now switching the data sources - cy.get('[data-test-subj="comboBoxSearchInput"]') - .type('nestedindex') - .then(() => { - cy.waitForSearch(); - cy.get('[title="nestedindex*"]') - .trigger('click') - .then(() => { - cy.get('[data-test-subj="dataGridHeaderCell-agent"]').should( - 'be.visible' - ); - cy.wait(2000); - cy.get('[data-test-subj="dataGridRowCell"]') - .contains('-') - .should('exist'); - }); - }); - }); - after(() => { cy.setAdvancedSetting({ 'discover:modifyColumnsOnSwitch': true, diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_table.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_table.spec.js index 2b7f1f06d..2401b68d4 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_table.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_table.spec.js @@ -68,35 +68,8 @@ describe('discover_table', () => { }); }); - describe('dynamic height of row in new table', () => { - before(() => { - cy.switchDiscoverTable('new'); - cy.waitForLoader(); - }); - - it('checks if height of new table changes with change to line count property ', function () { - cy.get('[data-test-subj="dataGridRowCell"]') - .first() - .invoke('height') // Get Row Height Before update - .then((res) => { - cy.get('.euiButtonEmpty') - .contains('Display') - .click() - .then(() => { - cy.get('[type="number"]').type('{selectall}').type('2'); // Update the line count value - }); - - cy.get('[data-test-subj="dataGridRowCell"]') - .first() - .invoke('height') - .should('be.gt', res); // Check if the new height is greater than previus height - }); - }); - }); - describe('expand multiple documents in legacy table', () => { before(() => { - cy.switchDiscoverTable('legacy'); cy.wait(2000); // Intentional Wait to account for low performant env }); @@ -185,162 +158,6 @@ describe('discover_table', () => { }); }); - describe('left navigation display', () => { - before(() => { - cy.switchDiscoverTable('new'); - }); - it('check _source is available as default selected field', function () { - cy.get('[data-test-subj="fieldList-selected"]').should( - 'contain.text', - '_source' - ); - }); - it('check timestamp is not added to selected field when a column is added', function () { - // Click to add fields - cy.get('[data-test-subj="fieldToggle-_id"]').click(); - cy.get('[data-test-subj="fieldToggle-agent"]').click(); - - // Check that the selected field don't contain timestamp - cy.get('[data-test-subj="fieldList-selected"]').should( - 'not.contain.text', - '@timestamp' - ); - }); - it('check timestamp is not added to selected field when a column is removed', function () { - cy.get('[data-test-subj="fieldToggle-_id"]').first().click(); - - // Check that the selected field don't contain timestamp - cy.get('[data-test-subj="fieldList-selected"]').should( - 'not.contain.text', - '@timestamp' - ); - }); - it('check _source gets restored when all selected columns are removed', function () { - cy.get('[data-test-subj="fieldToggle-agent"]').first().click(); // toggle the previously selected fields - - // Now the field selected should get defaulted to _source - cy.get('[data-test-subj="fieldList-selected"]').should('have.length', 1); - cy.get('[data-test-subj="fieldList-selected"]').should( - 'contain.text', - '_source' - ); - }); - it('check field is removed from available fields and added to selected fields when the field is selected', function () { - // Field present in Available Field Section - cy.get('[data-test-subj="fieldList-unpopular"]') - .find('[data-test-subj="field-host"]') - .should('exist'); - - // Toggle to display the field - cy.get('[data-test-subj="fieldList-unpopular"]') - .find('[data-test-subj="fieldToggle-host"]') - .click(); - - // Check to ensure the field is no longer present in Available Field - cy.get('[data-test-subj="fieldList-unpopular"]') - .find('[data-test-subj="field-host"]') - .should('not.exist'); - // Check the field is present in the Selected Field Secition - cy.get('[data-test-subj="fieldList-selected"]').should( - 'contain.text', - 'host' - ); - - // Reseting the toggled Field - cy.get('[data-test-subj="fieldList-selected"]') - .find('[data-test-subj="fieldToggle-host"]') - .click(); - }); - - it('check collapsablity of left navigation display', function () { - cy.get('[data-test-subj="euiResizableButton"]') - .trigger('click') - .then(() => { - cy.get('[aria-label="Press to toggle this panel"]') - .trigger('click') - .then(() => { - cy.get('[data-test-subj="comboBoxSearchInput"]').should( - 'not.be.visible' - ); - }); - }); - }); - - it('check nested field are available in left navigation pane', function () { - // Create an Index pattern - cy.createIndexPattern( - 'nestedindex', - { - title: 'nestedindex*', - timeFieldName: 'timestamp', - }, - { - securitytenant: ['global'], - } - ); - cy.reload(); - - cy.get('[data-test-subj="comboBoxSearchInput"]') - .type('nestedindex') - .then(() => { - cy.waitForSearch(); - cy.get('[title="nestedindex*"]') - .trigger('click') - .then(() => { - // validate the presence of nested fields in left navigation pane - cy.get('[data-test-subj="fieldList-unpopular"]') - .find('[data-test-subj="field-products.base_price"]') - .should('exist'); - cy.get('[data-test-subj="fieldList-unpopular"]') - .find('[data-test-subj="field-products.quantity"]') - .should('exist'); - cy.get('[data-test-subj="fieldList-unpopular"]') - .find('[data-test-subj="field-products.discount_percentage"]') - .should('exist'); - cy.get('[data-test-subj="fieldList-unpopular"]') - .find('[data-test-subj="field-products.manufacturer"]') - .should('exist'); - }); - }); - }); - }); - - describe('Saved Search in new table', () => { - before(() => { - cy.switchDiscoverTable('new'); - }); - - it('check opening a Saved Search does not cause a page reload', function () { - cy.get('[data-test-subj="superDatePickerstartDatePopoverButton"]') - .invoke('text') - .then((fromDate) => { - cy.get('[data-test-subj="superDatePickerendDatePopoverButton"]') - .invoke('text') - .then((endDate) => { - cy.get('[data-test-subj="discoverOpenButton"]').click(); - cy.get( - '[data-test-subj="savedObjectTitleA-Saved-Search"]' - ).click(); - cy.get('[data-test-subj="superDatePickerstartDatePopoverButton"]') - .invoke('text') - .should('be.eq', fromDate); - cy.get('[data-test-subj="superDatePickerendDatePopoverButton"]') - .invoke('text') - .should('be.eq', endDate); - }); - }); - }); - - after(() => { - // resetting the visited page - miscUtils.visitPage( - `app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))` - ); - cy.waitForSearch(); - cy.switchDiscoverTable('legacy'); - }); - }); - describe('Infinity Scroll in legacy table', () => { before(() => { miscUtils.visitPage( @@ -446,52 +263,6 @@ describe('discover_table', () => { }); }); - after(() => { - miscUtils.visitPage( - `app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))` - ); - cy.waitForSearch(); - }); - }); - describe('New Table', () => { - before(() => { - cy.switchDiscoverTable('new'); - }); - - it('check table Auto Size with change in time range', function () { - cy.get('[aria-label="Inspect document details"]') - .its('length') - .then((noEntries) => { - cy.setTopNavDate( - 'Sep 22, 2015 @ 14:00:00.000', - 'Sep 22, 2015 @ 14:30:00.000' - ); - cy.verifyHitCount('7'); - cy.get('[aria-label="Inspect document details"]') - .its('length') - .should('be.lessThan', noEntries); - }); - }); - - it('check table Auto Size with filter', function () { - cy.get('[aria-label="Inspect document details"]') - .its('length') - .then((noEntries) => { - cy.get('[data-test-subj="field-extension-showDetails"]') - .trigger('click') - .then(() => { - cy.get('[data-test-subj="plus-extension-css"]') - .trigger('click') - .then(() => { - cy.verifyHitCount('4'); - cy.get('[aria-label="Toggle row details"]') - .its('length') - .should('be.lessThan', noEntries); - }); - }); - }); - }); - after(() => { miscUtils.visitPage( `app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))` diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/doc_navigation.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/doc_navigation.spec.js deleted file mode 100644 index 9901acf4e..000000000 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/doc_navigation.spec.js +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { - MiscUtils, - TestFixtureHandler, -} from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; -import { CURRENT_TENANT } from '../../../../../utils/commands'; - -const miscUtils = new MiscUtils(cy); -const testFixtureHandler = new TestFixtureHandler( - cy, - Cypress.env('openSearchUrl') -); -const indexSet = [ - 'logstash-2015.09.22', - 'logstash-2015.09.21', - 'logstash-2015.09.20', -]; - -describe('doc link in discover', () => { - beforeEach(() => { - CURRENT_TENANT.newTenant = 'global'; - // import logstash functional - testFixtureHandler.importJSONDocIfNeeded( - indexSet, - 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/logstash/logstash.mappings.json.txt', - 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/logstash/logstash.json.txt' - ); - - testFixtureHandler.importJSONMapping( - 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/discover/discover.mappings.json.txt' - ); - - testFixtureHandler.importJSONDoc( - 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/discover/discover.json.txt' - ); - - cy.setAdvancedSetting({ - defaultIndex: 'logstash-*', - }); - - miscUtils.visitPage( - `app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))` - ); - cy.waitForLoader(); - cy.switchDiscoverTable('new'); - cy.waitForSearch(); - }); - - after(() => {}); - - it('should open the doc view of the selected document', function () { - cy.getElementByTestId(`docTableExpandToggleColumn-0`) - .should('be.visible') - .click(); - cy.getElementByTestId(`documentDetailFlyOut`).should('be.visible'); - - // Both actions will take to the new tab - cy.getElementByTestId('docTableRowAction-0').should( - 'have.text', - 'View surrounding documents(opens in a new tab or window)' - ); - - cy.getElementByTestId('docTableRowAction-1').should( - 'have.text', - 'View single document(opens in a new tab or window)' - ); - }); - - it('if value is null, add filter should create a non-exist filter', function () { - // Filter out special document - cy.getElementByTestId('addFilter').click(); - cy.getElementByTestId('filterFieldSuggestionList') - .should('be.visible') - .click() - .type(`agent{downArrow}{enter}`) - .trigger('blur', { force: true }); - - cy.getElementByTestId('filterOperatorList') - .should('be.visible') - .click() - .type(`is{downArrow}{enter}`) - .trigger('blur', { force: true }); - - cy.getElementByTestId('filterParams').type('Missing/Fields'); - - cy.getElementByTestId('saveFilter').click({ force: true }); - cy.waitForLoader(); - - cy.waitForSearch(); - - cy.wait(500); - - cy.getElementByTestId(`docTableExpandToggleColumn-0`) - .should('be.visible') - .click(); - cy.getElementByTestId(`documentDetailFlyOut`).should('be.visible'); - - cy.getElementByTestId('tableDocViewRow-referer') - .find(`[data-test-subj="addInclusiveFilterButton"]`) - .click(); - - cy.wait(100); - - // Since the value of referer is null, the filter for value option will add a non-existing filter - cy.get('[data-test-subj~="filter-key-referer"]').should('be.visible'); - cy.get('[data-test-subj~="filter-negated"]').should('be.visible'); - }); -}); diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/doc_table.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/doc_table.spec.js index 8b49c671c..7be66f982 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/doc_table.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/doc_table.spec.js @@ -46,8 +46,6 @@ describe('discover doc table', () => { `app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))` ); cy.waitForLoader(); - cy.switchDiscoverTable('new'); - cy.waitForSearch(); }); after(() => {}); @@ -58,15 +56,13 @@ describe('discover doc table', () => { cy.getElementByTestId('fieldToggle-phpmemory').click({ force: true }); - cy.getElementByTestId('dataGridHeaderCell-phpmemory').should( - 'be.visible' - ); + cy.getElementByTestId('docTableHeader-phpmemory').should('be.visible'); }); it('should remove columns from the table', function () { cy.getElementByTestId('fieldToggle-phpmemory').click({ force: true }); - cy.getElementByTestId('dataGridHeaderCell-phpmemory').should('not.exist'); + cy.getElementByTestId('docTableHeader-phpmemory').should('not.exist'); }); }); }); diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/field_data.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/field_data.spec.js index c042911cc..492146ef6 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/field_data.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/field_data.spec.js @@ -47,7 +47,6 @@ describe('discover tab', () => { ); cy.waitForLoader(); cy.waitForSearch(); - cy.switchDiscoverTable('new'); }); after(() => {}); @@ -60,35 +59,24 @@ describe('discover tab', () => { }); it('the search term should be highlighted in the field data', function () { - cy.getElementByTestId('dataGridWrapper') + cy.getElementByTestId('discoverTable') .get('mark') - .should('have.length', 100); + .should('have.length', 50); }); it('search type:apache should show the correct hit count', () => { - // add this line to address flakiness in Cypress: - // ensures stable switching to the new Discover table format. - cy.switchDiscoverTable('new'); - cy.waitForSearch(); const expectedHitCount = '11,156'; cy.setTopNavQuery('type:apache'); cy.verifyHitCount(expectedHitCount); }); it('doc view should show Time and _source columns', function () { - // add this line to address flakiness in Cypress: - // ensures stable switching to the new Discover table format. - cy.switchDiscoverTable('new'); - cy.getElementByTestId('dataGridHeaderCell-@timestamp').should( - 'be.visible' - ); - cy.getElementByTestId('dataGridHeaderCell-_source').should('be.visible'); + cy.getElementByTestId('docTableHeader-@timestamp').should('be.visible'); + cy.getElementByTestId('docTableHeader-_source').should('be.visible'); }); it('doc view should sort ascending', function () { - cy.getElementByTestId( - 'dataGridHeaderCellActionButton-@timestamp' - ).click(); + cy.getElementByTestId('docTableHeaderFieldSort_@timestamp').click(); }); it('a bad syntax query should show an error message', function () { diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/index_pattern_with_encoded_id.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/index_pattern_with_encoded_id.spec.js deleted file mode 100644 index d101b2897..000000000 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/index_pattern_with_encoded_id.spec.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { - TestFixtureHandler, - MiscUtils, -} from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; -import { - DE_DEFAULT_END_TIME, - DE_DEFAULT_START_TIME, -} from '../../../../../utils/constants'; -import { CURRENT_TENANT } from '../../../../../utils/commands'; - -const miscUtils = new MiscUtils(cy); -const testFixtureHandler = new TestFixtureHandler( - cy, - Cypress.env('openSearchUrl') -); - -describe('index pattern with encoded id', () => { - before(() => { - CURRENT_TENANT.newTenant = 'global'; - testFixtureHandler.importJSONMapping( - 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/index_pattern_with_encoded_id/mappings.json.txt' - ); - - testFixtureHandler.importJSONDoc( - 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/index_pattern_with_encoded_id/data.json.txt' - ); - - cy.setAdvancedSetting({ - defaultIndex: 'with-encoded-id', - }); - - // Go to the Discover page - miscUtils.visitPage('app/data-explorer/discover#/'); - cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); - cy.switchDiscoverTable('new'); - cy.waitForLoader(); - }); - - after(() => { - testFixtureHandler.clearJSONMapping( - 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/index_pattern_with_encoded_id/mappings.json.txt' - ); - }); - - describe('expand a document row', function () { - const rowToInspect = 1; - it('should expand the detail flyout when the toggle icon is clicked', function () { - cy.getElementByTestId(`docTableExpandToggleColumn-${rowToInspect - 1}`) - .should('be.visible') - .click(); - cy.getElementByTestId(`documentDetailFlyOut`).should('be.visible'); - }); - - it('should show the detail panel actions', function () { - cy.get('[data-test-subj^="docTableRowAction"]').should(`have.length`, 2); - }); - }); -}); diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/large_string.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/large_string.spec.js index 9540c0069..f12ec19ef 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/large_string.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/large_string.spec.js @@ -40,12 +40,6 @@ describe('test large strings', () => { }); }); - beforeEach(() => { - cy.window().then((win) => - win.localStorage.setItem('discover:newExpereince', true) - ); - }); - it('verify the large string book present', function () { // Go to the Discover page miscUtils.visitPage('app/data-explorer/discover#/'); @@ -53,7 +47,7 @@ describe('test large strings', () => { const ExpectedDoc = 'Project Gutenberg EBook of Hamlet'; - cy.get('[data-test-subj="dataGridRowCell"]:nth-child(3) span') + cy.get('[data-test-subj="docTableField"]') .invoke('text') .then((text) => { const hasTheText = text.includes(ExpectedDoc); diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/saved_queries.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/saved_queries.spec.js index 315e10f31..19f63496f 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/saved_queries.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/saved_queries.spec.js @@ -54,7 +54,6 @@ describe.skip('saved queries saved objects', () => { // Set time filter cy.setTopNavDate(fromTime, toTime); - cy.switchDiscoverTable('new'); // Set up query and filter cy.setTopNavQuery('response:200'); @@ -64,10 +63,6 @@ describe.skip('saved queries saved objects', () => { }); describe('saved query management component functionality', function () { - beforeEach(() => { - cy.switchDiscoverTable('new'); - }); - it('should show the saved query management component when there are no saved queries', () => { cy.getElementByTestId('saved-query-management-popover-button').click(); cy.getElementByTestId('saved-query-management-popover') diff --git a/cypress/utils/dashboards/data_explorer/commands.js b/cypress/utils/dashboards/data_explorer/commands.js index a0ccff2e2..968558b89 100644 --- a/cypress/utils/dashboards/data_explorer/commands.js +++ b/cypress/utils/dashboards/data_explorer/commands.js @@ -133,38 +133,3 @@ Cypress.Commands.add('deleteSaveQuery', (name) => { }); cy.getElementByTestId('confirmModalConfirmButton').click(); }); - -Cypress.Commands.add('switchDiscoverTable', (name) => { - cy.getElementByTestId('discoverOptionsButton') - .then(($button) => { - cy.wrap($button).click({ force: true }); - - cy.getElementByTestId('discoverOptionsLegacySwitch').then( - ($switchButton) => { - if (name === 'new') { - cy.wrap($switchButton).click({ force: true }); - } - if (name === 'legacy') { - cy.wrap($switchButton).click({ force: true }); - } - cy.waitForLoader(); - } - ); - }) - .then(() => { - checkForElementVisibility(); - }); -}); - -function checkForElementVisibility() { - cy.getElementsByTestIds('queryInput') - .should('be.visible') - .then(($element) => { - if ($element.is(':visible')) { - return; - } else { - cy.wait(500); // Wait for half a second before checking again - checkForElementVisibility(); // Recursive call - } - }); -} diff --git a/cypress/utils/dashboards/data_explorer/index.d.ts b/cypress/utils/dashboards/data_explorer/index.d.ts index 703906af3..beb229886 100644 --- a/cypress/utils/dashboards/data_explorer/index.d.ts +++ b/cypress/utils/dashboards/data_explorer/index.d.ts @@ -16,6 +16,5 @@ declare namespace Cypress { loadSaveQuery(name: string): Chainable; clearSaveQuery(): Chainable; deleteSaveQuery(name: string): Chainable; - switchDiscoverTable(name: string): Chainable; } } \ No newline at end of file