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

Updated the Discover Saved Search Tests #1585

Closed
Closed
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 @@ -28,6 +28,9 @@ describe('discover app', { scrollBehavior: false }, () => {
before(() => {
CURRENT_TENANT.newTenant = 'global';
cy.fleshTenantSettings();
// delete all saved searches
cy.deleteSavedObjectByType('search');

// import logstash functional
testFixtureHandler.importJSONDocIfNeeded(
indexSet,
Expand Down Expand Up @@ -61,7 +64,9 @@ describe('discover app', { scrollBehavior: false }, () => {
cy.fleshTenantSettings();
});

after(() => {});
after(() => {
cy.deleteSavedObjectByType('search');
});

describe('filters and queries', () => {
after(() => {
Expand Down Expand Up @@ -126,7 +131,7 @@ describe('discover app', { scrollBehavior: false }, () => {
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';
const expectedHitCount = '12,891';
cy.verifyHitCount(expectedHitCount);
});

Expand Down Expand Up @@ -155,9 +160,23 @@ describe('discover app', { scrollBehavior: false }, () => {

// reset to persisted state
cy.getElementByTestId('resetSavedSearch').click();
const expectedHitCount = '14,004';
const expectedHitCount = '12,891';
cy.verifyHitCount(expectedHitCount);
});

it('after adding a filter to a saved search and reloading the page the added filter should persist', function () {
cy.loadSaveSearch(saveSearch2);
cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME);
cy.submitFilterFromDropDown('@tags.raw', 'is', 'success');
cy.reload();
cy.get('[data-test-subj~="[email protected]"]').should('be.visible');
});

it('reset filters while we create a new search', function () {
cy.get('[data-test-subj~="[email protected]"]').should('be.visible');
cy.get('[data-test-subj="discoverNewButton"]').click({ force: true });
cy.get('[data-test-subj~="[email protected]"]').should('not.exist');
});
});

describe(
Expand Down
Loading