Skip to content

Commit 2ebf140

Browse files
[7.14] [Security Solution] Updates loock-back time on Cypress tests (#110609) (#110697)
* [Security Solution] Updates loock-back time on Cypress tests (#110609) * updates loock-back time * updates loock-back value for 'expectedExportedRule' * fixes failing test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
1 parent c8a970c commit 2ebf140

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

x-pack/plugins/security_solution/cypress/integration/header/navigation.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
ALERTS_URL,
2727
CASES_URL,
2828
HOSTS_URL,
29-
KIBANA_HOME,
3029
ENDPOINTS_URL,
3130
TRUSTED_APPS_URL,
3231
EVENT_FILTERS_URL,
@@ -113,7 +112,7 @@ describe('top-level navigation common to all pages in the Security app', () => {
113112

114113
describe('Kibana navigation to all pages in the Security app ', () => {
115114
before(() => {
116-
loginAndWaitForPage(KIBANA_HOME);
115+
loginAndWaitForPage(TIMELINES_URL);
117116
});
118117
beforeEach(() => {
119118
openKibanaNavigation();

x-pack/plugins/security_solution/cypress/objects/rule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const getRunsEvery = (): Interval => ({
164164
});
165165

166166
const getLookBack = (): Interval => ({
167-
interval: '17520',
167+
interval: '50000',
168168
timeType: 'Hours',
169169
type: 'h',
170170
});
@@ -382,5 +382,5 @@ export const getEditedRule = (): CustomRule => ({
382382
export const expectedExportedRule = (ruleResponse: Cypress.Response): string => {
383383
const jsonrule = ruleResponse.body;
384384

385-
return `{"id":"${jsonrule.id}","updated_at":"${jsonrule.updated_at}","updated_by":"elastic","created_at":"${jsonrule.created_at}","created_by":"elastic","name":"${jsonrule.name}","tags":[],"interval":"100m","enabled":false,"description":"${jsonrule.description}","risk_score":${jsonrule.risk_score},"severity":"${jsonrule.severity}","output_index":".siem-signals-default","author":[],"false_positives":[],"from":"now-17520h","rule_id":"rule_testing","max_signals":100,"risk_score_mapping":[],"severity_mapping":[],"threat":[],"to":"now","references":[],"version":1,"exceptions_list":[],"immutable":false,"type":"query","language":"kuery","index":["exceptions-*"],"query":"${jsonrule.query}","throttle":"no_actions","actions":[]}\n{"exported_count":1,"missing_rules":[],"missing_rules_count":0}\n`;
385+
return `{"id":"${jsonrule.id}","updated_at":"${jsonrule.updated_at}","updated_by":"elastic","created_at":"${jsonrule.created_at}","created_by":"elastic","name":"${jsonrule.name}","tags":[],"interval":"100m","enabled":false,"description":"${jsonrule.description}","risk_score":${jsonrule.risk_score},"severity":"${jsonrule.severity}","output_index":".siem-signals-default","author":[],"false_positives":[],"from":"now-50000h","rule_id":"rule_testing","max_signals":100,"risk_score_mapping":[],"severity_mapping":[],"threat":[],"to":"now","references":[],"version":1,"exceptions_list":[],"immutable":false,"type":"query","language":"kuery","index":["exceptions-*"],"query":"${jsonrule.query}","throttle":"no_actions","actions":[]}\n{"exported_count":1,"missing_rules":[],"missing_rules_count":0}\n`;
386386
};

x-pack/plugins/security_solution/cypress/tasks/api_calls/rules.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const createCustomRule = (rule: CustomRule, ruleId = 'rule_testing', inte
1919
name: rule.name,
2020
severity: rule.severity.toLocaleLowerCase(),
2121
type: 'query',
22-
from: 'now-17520h',
22+
from: 'now-50000h',
2323
index: ['exceptions-*'],
2424
query: rule.customQuery,
2525
language: 'kuery',
@@ -59,7 +59,7 @@ export const createCustomIndicatorRule = (rule: ThreatIndicatorRule, ruleId = 'r
5959
threat_filters: [],
6060
threat_index: rule.indicatorIndexPattern,
6161
threat_indicator_path: '',
62-
from: 'now-17520h',
62+
from: 'now-50000h',
6363
index: rule.index,
6464
query: rule.customQuery || '*:*',
6565
language: 'kuery',
@@ -86,7 +86,7 @@ export const createCustomRuleActivated = (
8686
name: rule.name,
8787
severity: rule.severity.toLocaleLowerCase(),
8888
type: 'query',
89-
from: 'now-17520h',
89+
from: 'now-50000h',
9090
index: rule.index,
9191
query: rule.customQuery,
9292
language: 'kuery',

x-pack/plugins/security_solution/cypress/tasks/kibana_navigation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ export const navigateFromKibanaCollapsibleTo = (page: string) => {
1212
};
1313

1414
export const openKibanaNavigation = () => {
15-
cy.get(KIBANA_NAVIGATION_TOGGLE).click();
15+
cy.get(KIBANA_NAVIGATION_TOGGLE).click({ force: true });
1616
};

0 commit comments

Comments
 (0)