tiborm commented on a change in pull request #1364: METRON-2023 [UI] Covering Grok Parser Creation with Cypress tests URL: https://github.com/apache/metron/pull/1364#discussion_r269104537
########## File path: metron-interface/metron-config/cypress/integration/grok-parser.spec.js ########## @@ -0,0 +1,85 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +describe('Grok Parser Creation', function() { + + beforeEach(function () { + cy.server() + .route('GET', '/api/v1/sensor/parser/config', 'fixture:config.json').as('config') + .route('GET', '/api/v1/sensor/parser/config/list/available', 'fixture:sensor-config-single-parser/config-list-available.json') + .route({ + method: 'GET', + url: '/api/v1/kafka/topic/test-topic', + status: 200, + response: { + name: "bro", + numPartitions: 1, + properties: {}, + replicationFactor: 1, + } + }) + .route({ + method: 'GET', + url: '/api/v1/kafka/topic/test-topic/sample', + status: 200, + response: '"it has length"' + }).as('sample') + .route({ + method: 'POST', + url: '/api/v1/sensor/parser/config/parseMessage', + status: 200, + response: {} + }); + + cy.login(); + }); + + it('should add e2e parser', () => { + cy.get('.metron-add-button.hexa-button').click(); Review comment: At first I wanted to add this test without any production code change and the css selectors in this particular UI seemd pretty short and straight forward. But, after you pointed out to this I changed my mind so I added qe-ids and modified tests as well. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
