You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/08/09 08:45:32 UTC
[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #2046: fix: support uri/host/remote_addr
LiteSun commented on a change in pull request #2046:
URL: https://github.com/apache/apisix-dashboard/pull/2046#discussion_r685013910
##########
File path: web/cypress/integration/route/create-route-both-use-uri-uris.spec.js
##########
@@ -0,0 +1,171 @@
+/*
+ * 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.
+ */
+/* eslint-disable no-undef */
+
+context('Create Route Both use uri and uris', () => {
+ const selector = {
+ empty: '.ant-empty-normal',
+ name: '#name',
+ description: '#desc',
+ hosts_0: '#hosts_0',
+ hosts_1: '#hosts_1',
+ uris_0: '#uris_0',
+ uris_1: '#uris_1',
+ remote_addrs_0: '#remote_addrs_0',
+ remote_addrs_1: '#remote_addrs_1',
+ nodes_0_host: '#nodes_0_host',
+ nodes_0_port: '#nodes_0_port',
+ nodes_0_weight: '#nodes_0_weight',
+ nameSelector: '[title=Name]',
+ drawer: '.ant-drawer-content',
+ monacoScroll: '.monaco-scrollable-element',
+ addHost: '[data-cy=addHost]',
+ addUri: '[data-cy=addUri]',
+ addRemoteAddr: '[data-cy=addRemoteAddr]',
+ deleteAlert: '.ant-modal-body',
+ notificationCloseIcon: '.ant-notification-close-icon',
+ notification: '.ant-notification-notice-message',
+ };
+
+ const data = {
+ name: 'test_route',
+ description: 'desc_by_autotest',
+ host: '12.12.12.12',
+ port: '80',
+ weight: 1,
+ host_0: '0.0.0.0',
+ uri_0: '/test',
+ remote_addr_0: '192.168.1.0',
+ host_1: '1.1.1.1',
+ uri_1: '/test1',
+ remote_addr_1: '192.168.1.1',
+ submitSuccess: 'Submit Successfully',
+ deleteRouteSuccess: 'Delete Route Successfully',
+ };
+
+ beforeEach(() => {
+ cy.login();
+ });
+
+ it('should create route with uri/host/remote_addr', () => {
+ cy.visit('/');
+ cy.contains('Route').click();
+ cy.get(selector.empty).should('be.visible');
+ cy.contains('Create').click();
+ cy.contains('Next').click().click();
+ cy.get(selector.name).type(data.name);
+ cy.get(selector.description).type(data.description);
+
+ cy.get(selector.hosts_0).type(data.host_0);
+ cy.get(selector.uris_0).type(data.uri_0);
+ cy.get(selector.remote_addrs_0).type(data.remote_addr_0);
+
+ cy.contains('Next').click();
+ cy.get(selector.nodes_0_host).type(data.host);
+ cy.get(selector.nodes_0_port).type(data.port);
+ cy.get(selector.nodes_0_weight).type(data.weight);
+ cy.contains('Next').click();
+
+ cy.contains('Next').click();
+ cy.contains('Submit').click();
+ cy.contains(data.submitSuccess);
+
+ // back to route list page
+ cy.contains('Goto List').click();
+ cy.url().should('contains', 'routes/list');
+ });
+
+ it('Raw Data should have uri/host/remote_addr', () => {
+ cy.visit('/');
+ cy.contains('Route').click();
+
+ cy.get(selector.nameSelector).type(data.name);
+ cy.contains('Search').click();
+ cy.contains(data.name).siblings().contains('More').click();
+ cy.contains('View').click();
+ cy.get(selector.drawer).should('be.visible');
+
+ cy.get(selector.monacoScroll).within(() => {
+ cy.contains('uri').should('exist');
Review comment:
It would be better to verify the corresponding values are correct
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org