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/04/02 01:09:13 UTC

[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1558: feat:Support duplicate one existing Route

juzhiyuan commented on a change in pull request #1558:
URL: https://github.com/apache/apisix-dashboard/pull/1558#discussion_r606023355



##########
File path: web/cypress/integration/route/create-edit-duplicate-delete-route.spec.js
##########
@@ -153,12 +154,46 @@ context('Create and Delete Route', () => {
     });
   });
 
-  it('should delete the route', function () {
-    cy.visit('/routes/list');
+
+  it('should duplicate the route', function () {
+    cy.visit('/');
+    cy.contains('Route').click();
+
     cy.get(this.domSelector.nameSelector).type(newName);
     cy.contains('Search').click();
-    cy.contains(newName).siblings().contains('Delete').click();
-    cy.contains('button', 'Confirm').click();
-    cy.get(this.domSelector.notification).should('contain', this.data.deleteRouteSuccess);
+    cy.contains(newName).siblings().contains('Duplicate').click();
+
+    cy.get(this.domSelector.name).clear().type(duplicateNewName);
+    cy.get(this.domSelector.description).clear().type(this.data.description2);
+    cy.contains('Next').click();
+    cy.contains('Next').click();
+    cy.contains('Next').click();
+    cy.contains('Submit').click();
+    cy.contains(this.data.submitSuccess);
+    cy.contains('Goto List').click();
+    cy.url().should('contains', 'routes/list');
+    cy.contains(duplicateNewName).siblings().should('contain', this.data.description2);
+
+    // test view
+    cy.contains(duplicateNewName).siblings().contains('View').click();
+    cy.get(this.domSelector.drawer).should('be.visible');
+
+    cy.get(this.domSelector.codemirrorScroll).within(() => {
+      cy.contains('upstream').should("exist");
+      cy.contains(duplicateNewName).should('exist');
+    });
+  });
+
+  it('should delete the route', function () {
+    cy.visit('/routes/list');

Review comment:
       @LiteSun Do we need to visit this page by clicking Sidebar Menu?




-- 
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:
users@infra.apache.org