Skip to content

Commit b478866

Browse files
authored
remove/refactor tests related to the "new" discover table (#1754)
1 parent 5fe4c27 commit b478866

13 files changed

+18
-639
lines changed

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos.spec.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ describe('date_nanos', () => {
3737

3838
cy.setTopNavDate(fromTime, toTime);
3939
cy.waitForSearch();
40-
cy.switchDiscoverTable('new');
4140
});
4241

4342
after(() => {
@@ -48,8 +47,8 @@ describe('date_nanos', () => {
4847

4948
it('should show a timestamp with nanoseconds in the first result row', function () {
5049
cy.verifyTimeConfig(fromTime, toTime);
51-
cy.get(`[data-test-subj="dataGridRowCell"]`)
52-
.eq(1)
50+
cy.get(`[data-test-subj="osdDocTableCellDataField"]`)
51+
.eq(0)
5352
.contains('Sep 22, 2019 @ 16:50:13.253123345');
5453
});
5554
});

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos_mixed.spec.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ describe('date_nanos_mixed', () => {
3636
const toTime = 'Jan 1, 2019 @ 23:59:59.999';
3737
cy.setTopNavDate(fromTime, toTime);
3838
cy.waitForSearch();
39-
cy.switchDiscoverTable('new');
4039
});
4140

4241
after(() => {
@@ -46,20 +45,20 @@ describe('date_nanos_mixed', () => {
4645
});
4746

4847
it('shows a list of records of indices with date & date_nanos fields in the right order', function () {
49-
cy.get(`[data-test-subj="dataGridRowCell"]`)
50-
.eq(1)
48+
cy.get(`[data-test-subj="osdDocTableCellDataField"]`)
49+
.eq(0)
5150
.contains('Jan 1, 2019 @ 04:10:30.124000000');
5251

53-
cy.get(`[data-test-subj="dataGridRowCell"]`)
54-
.eq(4)
52+
cy.get(`[data-test-subj="osdDocTableCellDataField"]`)
53+
.eq(1)
5554
.contains('Jan 1, 2019 @ 04:10:30.123498765');
5655

57-
cy.get(`[data-test-subj="dataGridRowCell"]`)
58-
.eq(7)
56+
cy.get(`[data-test-subj="osdDocTableCellDataField"]`)
57+
.eq(2)
5958
.contains('Jan 1, 2019 @ 04:10:30.123456789');
6059

61-
cy.get(`[data-test-subj="dataGridRowCell"]`)
62-
.eq(10)
60+
cy.get(`[data-test-subj="osdDocTableCellDataField"]`)
61+
.eq(3)
6362
.contains('Jan 1, 2019 @ 04:10:30.123000000');
6463
});
6564
});

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js

-23
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ describe('discover app', { scrollBehavior: false }, () => {
5353
);
5454
cy.waitForLoader();
5555
cy.waitForSearch();
56-
cy.switchDiscoverTable('new');
5756
});
5857

5958
beforeEach(() => {
@@ -67,7 +66,6 @@ describe('discover app', { scrollBehavior: false }, () => {
6766
after(() => {
6867
cy.get('[data-test-subj~="filter-key-extension.raw"]').click();
6968
cy.getElementByTestId(`deleteFilter`).click();
70-
cy.switchDiscoverTable('legacy');
7169
});
7270
it('should persist across refresh', function () {
7371
// Set up query and filter
@@ -79,15 +77,6 @@ describe('discover app', { scrollBehavior: false }, () => {
7977
'be.visible'
8078
);
8179
});
82-
83-
it('should persist across switching table', function () {
84-
cy.switchDiscoverTable('new');
85-
cy.getElementByTestId(`queryInput`).should('have.text', 'response:200');
86-
cy.get('[data-test-subj~="filter-key-extension.raw"]').should(
87-
'be.visible'
88-
);
89-
cy.clearTopNavQuery();
90-
});
9180
});
9281

9382
describe('save search', () => {
@@ -124,13 +113,6 @@ describe('discover app', { scrollBehavior: false }, () => {
124113
.should('have.text', saveSearch2);
125114
});
126115

127-
it('should show the correct hit count', function () {
128-
cy.loadSaveSearch(saveSearch2);
129-
cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME);
130-
const expectedHitCount = '14,004';
131-
cy.verifyHitCount(expectedHitCount);
132-
});
133-
134116
it('should show correct time range string in chart', function () {
135117
cy.getElementByTestId('discoverIntervalDateRange').should(
136118
'have.text',
@@ -171,7 +153,6 @@ describe('discover app', { scrollBehavior: false }, () => {
171153
before(() => {
172154
CURRENT_TENANT.newTenant = 'global';
173155
cy.fleshTenantSettings();
174-
cy.switchDiscoverTable('new');
175156
cy.setTopNavDate(fromTime, toTime);
176157
});
177158

@@ -285,10 +266,6 @@ describe('discover app', { scrollBehavior: false }, () => {
285266
});
286267

287268
describe('refresh interval', function () {
288-
beforeEach(() => {
289-
cy.switchDiscoverTable('new');
290-
});
291-
292269
it('should refetch when autofresh is enabled', () => {
293270
cy.getElementByTestId('openInspectorButton').click();
294271
cy.getElementByTestId('inspectorPanel')

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js

-129
Original file line numberDiff line numberDiff line change
@@ -100,52 +100,6 @@ describe('discover_advanced_setting', () => {
100100
});
101101

102102
describe('Default Sort Order advanced setting', () => {
103-
it('check Default Sort Order Descending is respected in new table', function () {
104-
cy.setAdvancedSetting({
105-
'discover:sort:defaultOrder': 'desc',
106-
});
107-
cy.reload();
108-
cy.switchDiscoverTable('new');
109-
cy.wait(2000); // Intentional Wait to account for low performant env
110-
111-
cy.get('.euiDataGridRowCell--date')
112-
.eq(0)
113-
.invoke('text')
114-
.then((date1) => {
115-
cy.get('.euiDataGridRowCell--date')
116-
.eq(99)
117-
.invoke('text')
118-
.then((date2) => {
119-
expect(new Date(date1.slice(0, -18))).greaterThan(
120-
new Date(date2.slice(0, -20))
121-
);
122-
});
123-
});
124-
});
125-
126-
it('check Default Sort Order Ascending is respected in new table', function () {
127-
cy.setAdvancedSetting({
128-
'discover:sort:defaultOrder': 'asc',
129-
});
130-
cy.reload();
131-
cy.switchDiscoverTable('new');
132-
cy.wait(2000); // Intentional Wait to account for low performant env
133-
134-
cy.get('.euiDataGridRowCell--date')
135-
.eq(0)
136-
.invoke('text')
137-
.then((date1) => {
138-
cy.get('.euiDataGridRowCell--date')
139-
.eq(99)
140-
.invoke('text')
141-
.then((date2) => {
142-
expect(new Date(date1.slice(0, -18))).lessThan(
143-
new Date(date2.slice(0, -20))
144-
);
145-
});
146-
});
147-
});
148-
149103
it('check Default Sort Order Descending is respected in legacy table', function () {
150104
cy.setAdvancedSetting({
151105
'discover:sort:defaultOrder': 'desc',
@@ -202,19 +156,10 @@ describe('discover_advanced_setting', () => {
202156
'discover:sampleSize': 5,
203157
});
204158
cy.reload();
205-
cy.switchDiscoverTable('new');
206159
cy.wait(2000); // Intentional Wait to account for low performant env
207160
});
208161

209-
it('check new table respects Number of rows setting', function () {
210-
cy.get('[aria-label="Inspect document details"]').should(
211-
'have.length',
212-
5
213-
);
214-
});
215-
216162
it('check legacy table respects Number of rows setting', function () {
217-
cy.switchDiscoverTable('legacy');
218163
cy.wait(2000); // Intentional Wait to account for low performant env
219164
cy.get('[aria-label="Toggle row details"]').should('have.length', 5);
220165
});
@@ -266,22 +211,6 @@ describe('discover_advanced_setting', () => {
266211
});
267212
});
268213

269-
it('check time is not added on removing last column when hideTimeColumn is true in new table', function () {
270-
miscUtils.visitPage(
271-
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
272-
);
273-
cy.waitForSearch();
274-
cy.switchDiscoverTable('new');
275-
cy.get('[data-test-subj="dataGridHeaderCell-@timestamp"]').should(
276-
'not.exist'
277-
);
278-
cy.get('[data-test-subj="fieldToggle-agent"]').click();
279-
cy.get('[data-test-subj="fieldToggle-agent"]').click();
280-
cy.get('[data-test-subj="dataGridHeaderCell-@timestamp"]').should(
281-
'not.exist'
282-
);
283-
});
284-
285214
it('check time is not added on removing last column when hideTimeColumn is true in legacy table', function () {
286215
miscUtils.visitPage(
287216
`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', () => {
321250
});
322251
});
323252

324-
it('check new table respects doc_table:highlight setting', function () {
325-
// check if we have highlighted fields
326-
cy.get('mark').should('exist');
327-
328-
cy.setAdvancedSetting({
329-
'doc_table:highlight': false,
330-
});
331-
cy.reload();
332-
cy.switchDiscoverTable('new');
333-
cy.get('mark').should('not.exist');
334-
335-
// reset the setting to default value
336-
cy.setAdvancedSetting({
337-
'doc_table:highlight': true,
338-
});
339-
cy.reload();
340-
});
341-
342253
it('check legacy table respects doc_table:highlight setting', function () {
343254
// check if we have highlighted fields
344255
cy.setAdvancedSetting({
@@ -384,18 +295,6 @@ describe('discover_advanced_setting', () => {
384295
});
385296
});
386297

387-
it('check defaultcolumns setting is respected in new table', function () {
388-
cy.setAdvancedSetting({
389-
defaultColumns: ['host', 'agent'],
390-
});
391-
cy.reload();
392-
cy.switchDiscoverTable('new');
393-
cy.get('[data-test-subj="dataGridHeaderCell-agent"]').should(
394-
'be.visible'
395-
);
396-
cy.get('[data-test-subj="dataGridHeaderCell-host"]').should('be.visible');
397-
});
398-
399298
it('check defaultcolumns setting is respected in legacy table', function () {
400299
cy.setAdvancedSetting({
401300
defaultColumns: ['host', 'agent'],
@@ -481,34 +380,6 @@ describe('modifyColumnsOnSwitch advanced setting', () => {
481380
*/
482381
});
483382

484-
it('check columns still available after switching data sources in new table', function () {
485-
miscUtils.visitPage(
486-
`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'))`
487-
);
488-
cy.waitForSearch();
489-
cy.switchDiscoverTable('new');
490-
491-
cy.get('[data-test-subj="fieldToggle-agent"]').click();
492-
493-
// Now switching the data sources
494-
cy.get('[data-test-subj="comboBoxSearchInput"]')
495-
.type('nestedindex')
496-
.then(() => {
497-
cy.waitForSearch();
498-
cy.get('[title="nestedindex*"]')
499-
.trigger('click')
500-
.then(() => {
501-
cy.get('[data-test-subj="dataGridHeaderCell-agent"]').should(
502-
'be.visible'
503-
);
504-
cy.wait(2000);
505-
cy.get('[data-test-subj="dataGridRowCell"]')
506-
.contains('-')
507-
.should('exist');
508-
});
509-
});
510-
});
511-
512383
after(() => {
513384
cy.setAdvancedSetting({
514385
'discover:modifyColumnsOnSwitch': true,

0 commit comments

Comments
 (0)