Skip to content

Commit

Permalink
fix frontend e2e testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
wuzhiguo committed Mar 11, 2022
1 parent 44a16dd commit 694da8f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions web/cypress/integration/route/import_export_route.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
});
});
Expand Down

0 comments on commit 694da8f

Please sign in to comment.