Skip to content

Commit

Permalink
updates cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dplumlee committed Nov 18, 2021
1 parent 543a4fd commit dd39c1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class IndexInfo {
this.indexOptions = indexOptions;
this.kibanaVersion = kibanaVersion;
this.baseName = additionalPrefix
? joinWith<string>('')(
? joinWith('')(
additionalPrefix,
joinWithDash(INDEX_PREFIX, `${registrationContext}.${dataset}`)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ export const DEFINE_INDEX_INPUT =

export const EQL_TYPE = '[data-test-subj="eqlRuleType"]';

export const EQL_QUERY_INPUT = '[data-test-subj="eqlQueryBarTextInput"]';
export const PREVIEW_HISTOGRAM = '[data-test-subj="preview-histogram-bar-chart"]';

export const EQL_QUERY_PREVIEW_HISTOGRAM = '[data-test-subj="queryPreviewEqlHistogram"]';
export const EQL_QUERY_INPUT = '[data-test-subj="eqlQueryBarTextInput"]';

export const EQL_QUERY_VALIDATION_SPINNER = '[data-test-subj="eql-validation-loading"]';

Expand Down Expand Up @@ -170,7 +170,7 @@ export const RISK_OVERRIDE =

export const RULES_CREATION_FORM = '[data-test-subj="stepDefineRule"]';

export const RULES_CREATION_PREVIEW = '[data-test-subj="ruleCreationQueryPreview"]';
export const RULES_CREATION_PREVIEW = '[data-test-subj="rule-preview"]';

export const RULE_DESCRIPTION_INPUT =
'[data-test-subj="detectionEngineStepAboutRuleDescription"] [data-test-subj="input"]';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
DEFAULT_RISK_SCORE_INPUT,
DEFINE_CONTINUE_BUTTON,
EQL_QUERY_INPUT,
EQL_QUERY_PREVIEW_HISTOGRAM,
EQL_QUERY_VALIDATION_SPINNER,
EQL_TYPE,
FALSE_POSITIVES_INPUT,
Expand Down Expand Up @@ -92,6 +91,7 @@ import {
EMAIL_CONNECTOR_USER_INPUT,
EMAIL_CONNECTOR_PASSWORD_INPUT,
EMAIL_CONNECTOR_SERVICE_SELECTOR,
PREVIEW_HISTOGRAM,
} from '../screens/create_new_rule';
import { LOADING_INDICATOR } from '../screens/security_header';
import { TOAST_ERROR } from '../screens/shared';
Expand Down Expand Up @@ -325,12 +325,12 @@ export const fillDefineEqlRuleAndContinue = (rule: CustomRule) => {
.find(QUERY_PREVIEW_BUTTON)
.should('not.be.disabled')
.click({ force: true });
cy.get(EQL_QUERY_PREVIEW_HISTOGRAM)
cy.get(PREVIEW_HISTOGRAM)
.invoke('text')
.then((text) => {
if (text !== 'Hits') {
cy.get(RULES_CREATION_PREVIEW).find(QUERY_PREVIEW_BUTTON).click({ force: true });
cy.get(EQL_QUERY_PREVIEW_HISTOGRAM).should('contain.text', 'Hits');
cy.get(PREVIEW_HISTOGRAM).should('contain.text', 'Hits');
}
});
cy.get(TOAST_ERROR).should('not.exist');
Expand Down

0 comments on commit dd39c1e

Please sign in to comment.