From 694da8f0fd83edd9a716cc4e371967641134796d Mon Sep 17 00:00:00 2001 From: wuzhiguo Date: Fri, 11 Mar 2022 11:17:28 +0800 Subject: [PATCH] fix frontend e2e testcase --- .../integration/route/import_export_route.spec.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/cypress/integration/route/import_export_route.spec.js b/web/cypress/integration/route/import_export_route.spec.js index ec93db3a1e..c27708e14e 100644 --- a/web/cypress/integration/route/import_export_route.spec.js +++ b/web/cypress/integration/route/import_export_route.spec.js @@ -131,16 +131,19 @@ context('import and export routes', () => { cy.log(`found file ${jsonFile}`); cy.log('**confirm downloaded json file**'); cy.readFile(jsonFile).then((fileContent) => { - expect(JSON.stringify(fileContent)).to.equal(JSON.stringify(this.exportFile.jsonFile)); + const json = fileContent; + delete json['paths']['/{params}']['post']['x-apisix-id']; + expect(JSON.stringify(json)).to.equal(JSON.stringify(this.exportFile.jsonFile)); }); }); cy.task('findFile', data.yamlMask).then((yamlFile) => { cy.log(`found file ${yamlFile}`); cy.log('**confirm downloaded yaml file**'); cy.readFile(yamlFile).then((fileContent) => { - expect(JSON.stringify(yaml.load(fileContent), null, null)).to.equal( - JSON.stringify(this.exportFile.yamlFile), - ); + const json = yaml.load(fileContent); + delete json['paths']['/{params}']['post']['x-apisix-id']; + delete json['paths']['/{params}-APISIX-REPEAT-URI-2']['post']['x-apisix-id']; + expect(JSON.stringify(json, null, null)).to.equal(JSON.stringify(this.exportFile.yamlFile)); }); }); });