Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Flaky Discover Tests #1548

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ 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,
});
Expand All @@ -335,8 +337,6 @@ describe('discover_advanced_setting', () => {
'doc_table:highlight': true,
});
cy.reload();
cy.switchDiscoverTable('new');
cy.get('mark').should('exist');
});

it('check legacy table respects doc_table:highlight setting', function () {
Expand All @@ -354,6 +354,12 @@ describe('discover_advanced_setting', () => {
'doc_table:highlight': true,
});
cy.reload();
cy.get('[data-test-subj="fieldToggle-index"]')
.click()
.then(() => {
cy.get('[data-test-subj="field-index-showDetails"]').click();
cy.get('[data-test-subj="plus-index-logstash-2015.09.22"]').click();
});

cy.get('mark').should('exist');
});
Expand Down Expand Up @@ -435,78 +441,78 @@ describe('discover_advanced_setting', () => {
});
});

describe('modifyColumnsOnSwitch advanced setting', () => {
before(() => {
CURRENT_TENANT.newTenant = 'global';
cy.fleshTenantSettings();
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': false,
});
});

it.skip('check columns still available after switching data sources 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'))`
);
cy.waitForSearch();
cy.get('[data-test-subj="fieldToggle-agent"]').click();

// Now switching the data sources
cy.get('[data-test-subj="comboBoxSearchInput"]')
.type('nestedindex')
.then(() => {
cy.get('[title="nestedindex*"]')
.trigger('click')
.then(() => {
cy.wait(300);
cy.get('[data-test-subj="docTableHeader-agent"]').should(
'be.visible'
);
cy.get('[data-test-subj="docTableField"]')
.contains('-')
.should('exist');
});
});
after(() => {});
});

/*
*/
describe('modifyColumnsOnSwitch advanced setting', () => {
before(() => {
CURRENT_TENANT.newTenant = 'global';
cy.fleshTenantSettings();
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': false,
});
});

it('check columns still available after switching data sources 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="fieldToggle-agent"]').click();
it.skip('check columns still available after switching data sources 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'))`
);
cy.waitForSearch();
cy.get('[data-test-subj="fieldToggle-agent"]').click();

// Now switching the data sources
cy.get('[data-test-subj="comboBoxSearchInput"]')
.type('nestedindex')
.then(() => {
cy.get('[title="nestedindex*"]')
.trigger('click')
.then(() => {
cy.wait(300);
cy.get('[data-test-subj="docTableHeader-agent"]').should(
'be.visible'
);
cy.get('[data-test-subj="docTableField"]')
.contains('-')
.should('exist');
});
});

// 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.get('[data-test-subj="dataGridRowCell"]')
.contains('-')
.should('exist');
});
});
});
/*
*/
});

after(() => {
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': true,
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.deleteIndexPattern('nestedindex');
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': true,
});
cy.deleteSavedObjectByType('index-pattern');
});
});
Loading