update cypress rule engine code

update cypress rule engine code

Change-Id: I99c7ee09bd8b30a2985d2de4d4297b7552a9cde0
Issue-ID: DCAEGEN2-746
Signed-off-by: Manor, Yanir (ym903w) <ym903w@intl.att.com>
diff --git a/cypress-docker/test/src/cypress/integration/mocks/newApp/ruleEngine-spec.js b/cypress-docker/test/src/cypress/integration/mocks/newApp/ruleEngine-spec.js
index cca70cf..9be6636 100644
--- a/cypress-docker/test/src/cypress/integration/mocks/newApp/ruleEngine-spec.js
+++ b/cypress-docker/test/src/cypress/integration/mocks/newApp/ruleEngine-spec.js
@@ -16,7 +16,9 @@
     .select(actionType)
     .get('button[data-tests-id="btnAddAction"]')
     .click();
-  cy.get('[data-tests-id="makeCopyOfAction"]').should("not.be.visible");
+  cy
+    .get('[data-tests-id="makeCopyOfAction"]')
+    .should("not.be.visible");
 }
 
 export const selectVersionAndTypeAndAddFirstRule = () => {
@@ -177,6 +179,88 @@
     // .should("have.length", NUMBER_OF_NOT_EXIST_ITEMS); });
   });
 
+  describe("Rule list add filter", () => {
+    beforeEach(() => {
+      cy.httpGenerateMappingRulesFileName();
+      cy.httpGetDDLData();
+      cy.getMCListEmpty();
+      cy.homePage();
+      cy
+        .get('button[data-tests-id="btn-create-mc"]')
+        .click();
+      cy.fillNewMcForm();
+      cy.httpCreateNewMc();
+      cy.getPhases();
+      cy.httpGenerateMappingRulesFileName();
+      cy.httpTargetTree();
+      cy.emptyRuleEngine("Type1");
+      cy
+        .get('button[data-tests-id="createMonitoring"]')
+        .click();
+      cy
+        .get("#ui-tabpanel-1-label")
+        .should("contain", "map")
+        .click();
+      selectVersionAndTypeAndAddFirstRule();
+      fillRuleDescription("newRule");
+      addCopyAction();
+      cy.getLatestMcUuid();
+      cy.doneSaveRule();
+      cy
+        .get('button[data-tests-id="btnDone"]')
+        .click();
+    });
+
+    it("apply filter", () => {
+      cy
+        .get('[data-tests-id="isFilter"]')
+        .click()
+        .get('input[data-tests-id="left"]')
+        .type("ABC")
+        .should("have.value", "ABC");
+
+      cy
+        .get('select[data-tests-id="selectOperator"]')
+        .select("startsWith")
+        .get('input[data-tests-id="right"]')
+        .type("A")
+        .should("have.value", "A");
+    });
+
+    it("Delete filter with checkbox", () => {
+      cy
+        .get('[data-tests-id="isFilter"]')
+        .click()
+        .get('[data-tests-id="removeConditionNode"]')
+        .click();
+      cy
+        .get('input[data-tests-id="left"]')
+        .should("not.be.visible");
+    });
+
+    it("Delete filter with button delete", () => {
+      cy
+        .get('[data-tests-id="isFilter"]')
+        .click()
+        .get('input[data-tests-id="left"]')
+        .type("ABC")
+        .should("have.value", "ABC");
+
+      cy
+        .get('select[data-tests-id="selectOperator"]')
+        .select("startsWith")
+        .get('input[data-tests-id="right"]')
+        .type("A")
+        .should("have.value", "A")
+        .get('[data-tests-id="removeConditionNode"]')
+        .click();
+
+      cy
+        .get('input[data-tests-id="left"]')
+        .should("not.be.visible");
+    });
+  });
+
   describe("Mapping target select", () => {
     beforeEach(() => {
       cy.httpGenerateMappingRulesFileName();
@@ -258,25 +342,25 @@
         .get('button[data-tests-id="btnAddAction"]')
         .click()
         .get('[data-tests-id="searchField"]')
-        .type("searchField")
+        .type("searchField", {force: true})
         .get('[data-tests-id="searchValue"]')
-        .type("searchValue")
+        .type("searchValue", {force: true})
         .get('[data-tests-id="searchLeft"]')
-        .type("searchLeft")
+        .type("searchLeft", {force: true})
         .get('[data-tests-id="searchOperator"]')
-        .select("notEqual")
+        .select("notEqual", {force: true})
         .get('[data-tests-id="searchRight"]')
-        .type("searchRight")
+        .type("searchRight", {force: true})
         .get('[data-tests-id="updatesKey"]')
-        .type("updatesKey")
+        .type("updatesKey", {force: true})
         .get('[data-tests-id="updatesValue"]')
-        .type("updatesValue")
+        .type("updatesValue", {force: true})
         .get('[data-tests-id="radioEnrich"]')
         .click()
         .get('[data-tests-id="searchFieldValue"]')
-        .type("searchFieldValue")
+        .type("searchFieldValue", {force: true})
         .get('[data-tests-id="searchPrefix"]')
-        .type("searchPrefix");
+        .type("searchPrefix", {force: true});
     });
     it("add string transform action ", () => {
       cy
@@ -1142,9 +1226,7 @@
       cy.server();
       cy.route({
         method: "GET",
-        url: `${Cypress.env(
-          "backendUrl"
-        )}/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Type1`,
+        url: `${Cypress.env("backendUrl")}/rule-editor/rule/**/**/**/**`,
         response: "fixture:ruleEngineLoadServerReplaceText"
       });
       cy.httpGenerateMappingRulesFileName();
@@ -1174,9 +1256,7 @@
       cy.server();
       cy.route({
         method: "GET",
-        url: `${Cypress.env(
-          "backendUrl"
-        )}/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Type1`,
+        url: `${Cypress.env("backendUrl")}/rule-editor/rule/**/**/**/**`,
         response: "fixture:ruleEngineLoadServerClear"
       });
       cy.httpGenerateMappingRulesFileName();
@@ -1200,9 +1280,7 @@
       cy.server();
       cy.route({
         method: "GET",
-        url: `${Cypress.env(
-          "backendUrl"
-        )}/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Type1`,
+        url: `${Cypress.env("backendUrl")}/rule-editor/rule/**/**/**/**`,
         response: "fixture:ruleEngineLoadServerCopy"
       });
       cy.httpGenerateMappingRulesFileName();
@@ -1286,7 +1364,7 @@
           .click()
           .get(".toast-container")
           .should("be.visible")
-          .get(".map-setting-list > form > #Type1 > input")
+          .get(".map-setting-list > form > #mappingType > input")
           .should("be.visible")
           .and("have.value", translateValue());
       });
diff --git a/cypress-docker/test/src/cypress/support/ruleEngineCommands.js b/cypress-docker/test/src/cypress/support/ruleEngineCommands.js
index 70f1a4b..db96b84 100644
--- a/cypress-docker/test/src/cypress/support/ruleEngineCommands.js
+++ b/cypress-docker/test/src/cypress/support/ruleEngineCommands.js
@@ -3,9 +3,7 @@
   cy
     .route({
       method: "GET",
-      url: `${Cypress.env(
-        "backendUrl"
-      )}/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/${targetFiled}`,
+      url: `${Cypress.env("backendUrl")}/rule-editor/rule/**/**/**/**`,
       response: "fixture:loadAllActionsForRuleEngine"
     })
     .as("serverWithRuleList");
@@ -16,9 +14,7 @@
   cy
     .route({
       method: "GET",
-      url: `${Cypress.env(
-        "backendUrl"
-      )}/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/${targetFiled}`,
+      url: `${Cypress.env("backendUrl")}/rule-editor/rule/**/**/**/**`,
       response: {}
     })
     .as("serverRuleList")
@@ -35,10 +31,7 @@
   cy
     .route({
       method: "GET",
-      url:
-        Cypress.env("backendUrl") +
-        "/SERVICES/06c7d927-4e2f-47e1-a29d-b6ed229ebc0a/LiavSrv/6d436c07-8006-4335-8c84-d" +
-        "65b4740f8d6/getLatestMcUuid",
+      url: Cypress.env("backendUrl") + "/SERVICES/**/**/**/**/getLatestMcUuid",
       response: {
         uuid: "6d436c07-8006-4335-8c84-d65b4740f8d6"
       }
@@ -51,8 +44,7 @@
   cy
     .route({
       method: "GET",
-      url:
-        Cypress.env("backendUrl") + "/rule-editor/definition/4.1/syslogFields",
+      url: Cypress.env("backendUrl") + "/rule-editor/definition/**/**",
       response: "fixture:syslogTargetTree"
     })
     .as("targetData");
@@ -74,10 +66,7 @@
   cy
     .route({
       method: "POST",
-      url:
-        Cypress.env("backendUrl") +
-        "/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Typ" +
-        "e1",
+      url: Cypress.env("backendUrl") + "/rule-editor/rule/**/**/**/**",
       response: "fixture:doneSaveSimpleCopy"
     })
     .as("doneSaveCopyRule");
@@ -88,10 +77,7 @@
   cy
     .route({
       method: "POST",
-      url:
-        Cypress.env("backendUrl") +
-        "/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Typ" +
-        "e1",
+      url: Cypress.env("backendUrl") + "/rule-editor/rule/**/**/**/**",
       response: "fixture:doneSaveSimpleEditCopy"
     })
     .as("doneSaveCopyRule");
@@ -102,10 +88,7 @@
   cy
     .route({
       method: "DELETE",
-      url:
-        Cypress.env("backendUrl") +
-        "/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Typ" +
-        "e1/f620724b-7170-43e1-8a8b-55e98cabe658",
+      url: Cypress.env("backendUrl") + "/rule-editor/rule/**/**/**/**/**",
       response: "{}"
     })
     .as("deleteCopyRule");
@@ -116,10 +99,7 @@
   cy
     .route({
       method: "POST",
-      url:
-        Cypress.env("backendUrl") +
-        "/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Typ" +
-        "e1",
+      url: Cypress.env("backendUrl") + "/rule-editor/rule/**/**/**/**",
       response: "fixture:doneSaveEditSimpleCopy"
     })
     .as("doneSaveAndEditRule");
@@ -130,10 +110,7 @@
   cy
     .route({
       method: "POST",
-      url:
-        Cypress.env("backendUrl") +
-        "/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Typ" +
-        "e1",
+      url: Cypress.env("backendUrl") + "/rule-editor/rule/**/**/**/**",
       response: "fixture:doneSaveSimpleMap"
     })
     .as("doneSaveMapRule");
@@ -144,10 +121,7 @@
   cy
     .route({
       method: "POST",
-      url:
-        Cypress.env("backendUrl") +
-        "/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Typ" +
-        "e1",
+      url: Cypress.env("backendUrl") + "/rule-editor/rule/**/**/**/**",
       response: "fixture:doneSaveSimpleLogText"
     })
     .as("doneSaveLogTextRule");
@@ -171,8 +145,7 @@
       method: "GET",
       url:
         Cypress.env("backendUrl") +
-        "/rule-editor/getExistingRuleTargets/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1" +
-        "517823219961.0",
+        "/rule-editor/getExistingRuleTargets/**/**/**/**",
       response: ["Type1", "json", "name"]
     })
     .as("TranslateSimpleCopy");