From 47ff1a94dfb33e22068dcffdc97337bda9b6f271 Mon Sep 17 00:00:00 2001 From: LiangXiang Shen Date: Fri, 15 Dec 2023 02:59:12 +0000 Subject: [PATCH] chore: Apply suggestion from code review. --- .../route/create-edit-route-with-redirect-plugin.spec.js | 8 +++++--- .../create-edit-route-with-redirect-regex-plugin.spec.js | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/web/cypress/integration/route/create-edit-route-with-redirect-plugin.spec.js b/web/cypress/integration/route/create-edit-route-with-redirect-plugin.spec.js index 26baf87ecb..1ce31bee6f 100644 --- a/web/cypress/integration/route/create-edit-route-with-redirect-plugin.spec.js +++ b/web/cypress/integration/route/create-edit-route-with-redirect-plugin.spec.js @@ -17,8 +17,8 @@ /* eslint-disable no-undef */ context('Create Edit and Delete Route with redirect plugin', () => { - const name = `${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDay()}`; - const newName = `${new Date().getFullYear()}*${new Date().getMonth() + 1}*${new Date().getDay()}`; + const name = 'name'; + const newName = 'newName'; const selector = { empty: '.ant-empty-normal', @@ -51,11 +51,12 @@ context('Create Edit and Delete Route with redirect plugin', () => { it('should create route with custom redirect plugin', function () { 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(name); cy.get(selector.redirect).click(); - cy.contains('Custom').click({ force: true }); + cy.contains('Custom').click(); // after choose Custom option, Custom Redirect form field should be visible cy.get(selector.customRedirectLabel).should('be.visible'); cy.get(selector.customRedirectUrI).should('be.visible'); @@ -98,6 +99,7 @@ context('Create Edit and Delete Route with redirect plugin', () => { cy.contains(data.submitSuccess); cy.contains('Goto List').click(); cy.url().should('contains', 'routes/list'); + cy.contains(newName).should('be.visible'); }); it('should delete the route', function () { diff --git a/web/cypress/integration/route/create-edit-route-with-redirect-regex-plugin.spec.js b/web/cypress/integration/route/create-edit-route-with-redirect-regex-plugin.spec.js index 81d3402215..f66d087bcb 100644 --- a/web/cypress/integration/route/create-edit-route-with-redirect-regex-plugin.spec.js +++ b/web/cypress/integration/route/create-edit-route-with-redirect-regex-plugin.spec.js @@ -17,8 +17,8 @@ /* eslint-disable no-undef */ context('Create Edit and Delete Route with redirect plugin', () => { - const name = `${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDay()}`; - const newName = `${new Date().getFullYear()}*${new Date().getMonth() + 1}*${new Date().getDay()}`; + const name = 'name'; + const newName = 'newName'; const selector = { empty: '.ant-empty-normal', @@ -54,6 +54,7 @@ context('Create Edit and Delete Route with redirect plugin', () => { it('should create route with custom redirect plugin', function () { 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(name); @@ -105,6 +106,7 @@ context('Create Edit and Delete Route with redirect plugin', () => { cy.contains(data.submitSuccess); cy.contains('Goto List').click(); cy.url().should('contains', 'routes/list'); + cy.contains(newName).should('be.visible'); }); it('should delete the route', function () {