liuxiran commented on a change in pull request #1372:
URL: https://github.com/apache/apisix-dashboard/pull/1372#discussion_r565781911
##########
File path: web/cypress/integration/plugin/create-edit-delete-plugin.spec.js
##########
@@ -36,14 +41,30 @@ context('Create and Delete Plugin List', () => {
cy.contains('Create').click();
// add test plugins
- cy.configurePlugins(this.cases);
+ cy.get('@cases').then((cases) => {
+ cy.configurePlugins(cases);
+ })
+ });
+
+ it('should edit the plugin', () => {
+ cy.visit('/plugin/list');
+ cy.get(domSelector.refresh).click();
+ cy.contains(data.name).should('exist').siblings().contains('Edit').click({
+ force: true,
+ });
+ cy.get(domSelector.codemirror)
+ .first()
+ .then(() => {
+ cy.get(domSelector.switch).click();
+ cy.contains('button', 'Submit').click();
+ });
+ cy.contains(data.name).should('not.exist');
});
it('should delete plugin list', () => {
- cy.visit('/');
- cy.contains('Plugin').click();
- cy.get(domSelectors.refresh).click();
- cy.get(domSelectors.tableCell).then(function (rows) {
+ cy.visit('/plugin/list');
+ cy.get(domSelector.refresh).click();
+ cy.get(domSelector.tableCell, { timeout }).should('exist').then(function
(rows) {
Review comment:
when I rerun this test locally, I found that sometimes there are some
plugins can be deleted. this will not disturb ci actually,
may be we can try
`cy.get('.ant-btn-dangerous').should('exist')` instead of
`cy.get(domSelector.refresh).click();` to enure that the route list has already
shown to make it better ^_^
----------------------------------------------------------------
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:
[email protected]