unskip sourcerer tests (#178318)

## Unskip sourcerer tests

The last 3 flaky test runs, with 100 ESS and 100 serverless tests per
run were without sourcerer-related errors.


Fix in sourcerer timeline file address situation, when fleet setup takes
longer than test execution and some data view not present in the
sourcerer on the moment of the test.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Khristinin Nikita 2024-04-09 09:59:36 +02:00 committed by GitHub
parent 97c0e1d445
commit 42e92d8749
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 4 deletions

View file

@ -33,7 +33,7 @@ const siemDataViewTitle = 'Security Default Data View';
const dataViews = ['auditbeat-*,fakebeat-*', 'auditbeat-*,*beat*,siem-read*,.kibana*,fakebeat-*'];
// FLAKY: https://github.com/elastic/kibana/issues/177080
describe.skip('Sourcerer', { tags: ['@ess', '@serverless'] }, () => {
describe('Sourcerer', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
dataViews.forEach((dataView: string) => postDataView(dataView));
});
@ -53,7 +53,7 @@ describe.skip('Sourcerer', { tags: ['@ess', '@serverless'] }, () => {
});
// FLAKY: https://github.com/elastic/kibana/issues/177586
describe.skip('Modified badge', () => {
describe('Modified badge', () => {
it('Selecting new data view does not add a modified badge', () => {
cy.get(SOURCERER.badgeModified).should(`not.exist`);
openSourcerer();

View file

@ -31,6 +31,7 @@ import {
saveSourcerer,
} from '../../../../tasks/sourcerer';
import { openTimelineUsingToggle } from '../../../../tasks/security_main';
import { waitForFleetSetup } from '../../../../tasks/fleet_integrations';
import { SOURCERER } from '../../../../screens/sourcerer';
import { createTimeline, deleteTimelines } from '../../../../tasks/api_calls/timelines';
import { getTimelineModifiedSourcerer } from '../../../../objects/timeline';
@ -40,6 +41,10 @@ const siemDataViewTitle = 'Security Default Data View';
const dataViews = ['logs-*', 'metrics-*', '.kibana-event-log-*'];
describe('Timeline scope', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => {
before(() => {
waitForFleetSetup();
});
beforeEach(() => {
cy.clearLocalStorage();
login();
@ -58,7 +63,7 @@ describe('Timeline scope', { tags: ['@ess', '@serverless', '@skipInServerless']
});
// FLAKY: https://github.com/elastic/kibana/issues/173854
describe.skip('Modified badge', () => {
describe('Modified badge', () => {
it('Selecting new data view does not add a modified badge', () => {
openTimelineUsingToggle();
cy.get(SOURCERER.badgeModified).should(`not.exist`);

View file

@ -9,6 +9,8 @@ import {
GET_INSTALLED_INTEGRATIONS_URL,
InstalledIntegration,
} from '@kbn/security-solution-plugin/common/api/detection_engine';
import { login } from './login';
import { visitGetStartedPage } from './navigation';
export const mockFleetInstalledIntegrations = (integrations: InstalledIntegration[] = []) => {
cy.intercept('GET', `${GET_INSTALLED_INTEGRATIONS_URL}*`, {
@ -18,3 +20,11 @@ export const mockFleetInstalledIntegrations = (integrations: InstalledIntegratio
},
}).as('installedIntegrations');
};
export const waitForFleetSetup = () => {
cy.intercept('POST', '/api/fleet/epm/packages/_bulk?prerelease=true').as('fleetSetup');
cy.clearLocalStorage();
login();
visitGetStartedPage();
cy.wait('@fleetSetup');
};

View file

@ -46,7 +46,8 @@ export const isDataViewSelection = (dataView: string) => {
return cy.get(SOURCERER.selectActiveOption).should('contain', dataView);
};
export const openDataViewSelection = () => cy.get(SOURCERER.selectActiveOption).click();
export const openDataViewSelection = () =>
cy.get(SOURCERER.selectActiveOption).click({ force: true });
export const isKibanaDataViewOption = (dataViews: string[]) => {
return dataViews.every((dataView) => {
return cy.get(SOURCERER.selectListOption).should(`contain`, dataView);