Skip to content

Commit

Permalink
fix cypress actually
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed Dec 2, 2022
1 parent 0298d2d commit 2ff4713
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ export const importSavedQuery = (timelineId: string) => {
cy.get(IMPORT_QUERY_FROM_SAVED_TIMELINE_LINK).click();
cy.get(TIMELINE(timelineId)).click();
cy.get(CUSTOM_QUERY_INPUT).should('not.be.empty');
removeAlertsIndex();
};

export const fillRuleName = (ruleName: string = ruleFields.ruleName) => {
Expand Down Expand Up @@ -347,7 +346,9 @@ const fillCustomQuery = (rule: CustomRule | OverrideRule) => {
cy.get(IMPORT_QUERY_FROM_SAVED_TIMELINE_LINK).click();
cy.get(TIMELINE(rule.timeline.id)).click();
cy.get(CUSTOM_QUERY_INPUT).should('have.value', rule.customQuery);
removeAlertsIndex();
if (rule.dataSource.type === 'indexPatterns') {
removeAlertsIndex();
}
} else {
cy.get(CUSTOM_QUERY_INPUT)
.first()
Expand Down Expand Up @@ -705,20 +706,3 @@ export const checkLoadQueryDynamically = () => {
export const uncheckLoadQueryDynamically = () => {
cy.get(LOAD_QUERY_DYNAMICALLY_CHECKBOX).click({ force: true }).should('not.be.checked');
};

export const defineSection = { importSavedQuery };
export const aboutSection = {
fillRuleName,
fillDescription,
fillSeverity,
fillRiskScore,
fillRuleTags,
expandAdvancedSettings,
fillReferenceUrls,
fillFalsePositiveExamples,
fillThreat,
fillThreatTechnique,
fillThreatSubtechnique,
fillNote,
};
export const scheduleSection = { fillFrom };

0 comments on commit 2ff4713

Please sign in to comment.