Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema committed Nov 27, 2020
1 parent 626c639 commit 537aad6
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
3 changes: 0 additions & 3 deletions x-pack/plugins/security_solution/cypress/cypress.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"baseUrl": "http://localhost:5601",
"defaultCommandTimeout": 120000,
"retries": {
"runMode": 2
},
"screenshotsFolder": "../../../target/kibana-security-solution/cypress/screenshots",
"trashAssetsBeforeRuns": false,
"video": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
activatesRule,
addsException,
addsExceptionFromRuleSettings,
deactivatesRule,
goToAlertsTab,
goToExceptionsTab,
removeException,
Expand Down Expand Up @@ -53,6 +52,8 @@ describe('Exceptions', () => {
waitForAlertsToPopulate();
refreshPage();

cy.screenshot('after-activating-rule');

cy.scrollTo('bottom');
cy.get(SERVER_SIDE_EVENT_COUNT)
.invoke('text')
Expand All @@ -62,7 +63,6 @@ describe('Exceptions', () => {
NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS
);
});
deactivatesRule();
});

afterEach(() => {
Expand All @@ -76,12 +76,14 @@ describe('Exceptions', () => {
goToExceptionsTab();
addsExceptionFromRuleSettings(exception);
esArchiverLoad('auditbeat_for_exceptions2');
activatesRule();
waitForTheRuleToBeExecuted();
goToAlertsTab();
refreshPage();
cy.screenshot('after-adding-exceptions-alert-tab');

cy.scrollTo('bottom');
cy.screenshot('after-adding-exceptions-alert-tab-after-scrolling');

cy.get(SERVER_SIDE_EVENT_COUNT)
.invoke('text')
.then((numberOfAlertsAfterCreatingExceptionText) => {
Expand All @@ -90,8 +92,10 @@ describe('Exceptions', () => {

goToClosedAlerts();
refreshPage();
cy.screenshot('closed-alerts');

cy.scrollTo('bottom');
cy.screenshot('closed-alerts-after-scroll');
cy.get(SERVER_SIDE_EVENT_COUNT)
.invoke('text')
.then((numberOfClosedAlertsAfterCreatingExceptionText) => {
Expand Down Expand Up @@ -139,7 +143,6 @@ describe('Exceptions', () => {
esArchiverLoad('auditbeat_for_exceptions2');

cy.scrollTo('bottom');
activatesRule();
cy.get(SERVER_SIDE_EVENT_COUNT)
.invoke('text')
.then((numberOfAlertsAfterCreatingExceptionText) => {
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/security_solution/cypress/objects/exception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export interface Exception {

export const exception: Exception = {
field: 'host.name',
operator: 'is one of',
values: ['siem-kibana', 'suricata-iowa', 'siem-es', 'jessie', 'siem'],
operator: 'is',
values: ['suricata-iowa'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export const LOADING_SPINNER = '[data-test-subj="loading-spinner"]';
export const OPERATOR_INPUT = '[data-test-subj="operatorAutocompleteComboBox"]';

export const VALUES_INPUT =
'[data-test-subj="valuesAutocompleteMatchAny"] [data-test-subj="comboBoxInput"]';
'[data-test-subj="valuesAutocompleteMatch"] [data-test-subj="comboBoxInput"]';
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const addsExceptionFromRuleSettings = (exception: Exception) => {
cy.get(VALUES_INPUT).type(`${value}{enter}`);
});
cy.get(CLOSE_ALERTS_CHECKBOX).click({ force: true });
cy.screenshot('exceptions-modal-filled');
cy.get(CONFIRM_BTN).click();
cy.get(CONFIRM_BTN).should('have.attr', 'disabled');
cy.get(CONFIRM_BTN).should('not.have.attr', 'disabled');
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/security_solution/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build-graphql-types": "node scripts/generate_types_from_graphql.js",
"cypress:open": "../../../node_modules/.bin/cypress open --config-file ./cypress/cypress.json",
"cypress:open-as-ci": "node ../../../scripts/functional_tests --config ../../test/security_solution_cypress/visual_config.ts",
"cypress:run": "../../../node_modules/.bin/cypress run --browser chrome --headless --spec ./cypress/integration/**/*.spec.ts --config-file ./cypress/cypress.json --reporter ../../../node_modules/cypress-multi-reporters --reporter-options configFile=./cypress/reporter_config.json; status=$?; ../../../node_modules/.bin/mochawesome-merge ../../../target/kibana-security-solution/cypress/results/mochawesome*.json > ../../../target/kibana-security-solution/cypress/results/output.json; ../../../node_modules/.bin/marge ../../../target/kibana-security-solution/cypress/results/output.json --reportDir ../../../target/kibana-security-solution/cypress/results; mkdir -p ../../../target/junit && cp ../../../target/kibana-security-solution/cypress/results/*.xml ../../../target/junit/ && exit $status;",
"cypress:run": "../../../node_modules/.bin/cypress run --browser chrome --headless --spec ./cypress/integration/alerts_detection_exceptions.spec.ts --config-file ./cypress/cypress.json --reporter ../../../node_modules/cypress-multi-reporters --reporter-options configFile=./cypress/reporter_config.json; status=$?; ../../../node_modules/.bin/mochawesome-merge ../../../target/kibana-security-solution/cypress/results/mochawesome*.json > ../../../target/kibana-security-solution/cypress/results/output.json; ../../../node_modules/.bin/marge ../../../target/kibana-security-solution/cypress/results/output.json --reportDir ../../../target/kibana-security-solution/cypress/results; mkdir -p ../../../target/junit && cp ../../../target/kibana-security-solution/cypress/results/*.xml ../../../target/junit/ && exit $status;",
"cypress:run-as-ci": "node --max-old-space-size=2048 ../../../scripts/functional_tests --config ../../test/security_solution_cypress/cli_config.ts",
"test:generate": "node scripts/endpoint/resolver_generator"
}
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit 537aad6

Please sign in to comment.