Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add the create and delete plugin in drawer #1597

Merged
merged 20 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4a93880
test: add the create and delter plugin in drawer
stu01509 Mar 15, 2021
fc10167
test: add the create and delter plugin in drawer
stu01509 Mar 16, 2021
0fffb5e
Merge remote-tracking branch 'upstream/master' into fix-#1411-add-del…
stu01509 Mar 19, 2021
bf6915f
test: add the create and delter plugin in drawer
stu01509 Mar 19, 2021
9577f51
test: adjust the create and delter plugin in drawer
stu01509 Mar 20, 2021
0054591
test: adjust the create and delter plugin in drawer
stu01509 Mar 20, 2021
053740e
test: adjust the create and delter plugin in drawer
stu01509 Mar 20, 2021
6fe03a2
Merge remote-tracking branch 'upstream/master' into fix-#1411-add-del…
stu01509 Mar 21, 2021
2e49eca
test: adjust the create and delter plugin in drawer
stu01509 Mar 21, 2021
9ec5acb
test: adjust the create and delter plugin in drawer
stu01509 Mar 21, 2021
bb28992
test: adjust the create and delter plugin in drawer
stu01509 Mar 21, 2021
1367477
test: adjust the create and delter plugin in drawer
stu01509 Mar 21, 2021
99a4275
test: adjust the create and delter plugin in drawer
stu01509 Mar 21, 2021
2a561ac
test: adjust the create and delter plugin in drawer
stu01509 Mar 21, 2021
e7d7609
Merge remote-tracking branch 'upstream/master' into fix-#1411-add-del…
stu01509 Mar 21, 2021
b7857f0
test: adjust test data.json and selector.json files
stu01509 Mar 22, 2021
af1f43f
Merge branch 'master' into fix-#1411-add-delete-plugin-in-darwer
LiteSun Mar 22, 2021
8331f4a
Merge branch 'master' into fix-#1411-add-delete-plugin-in-darwer
stu01509 Mar 22, 2021
34b2d85
test: adjust test data.json and selector.json files
stu01509 Mar 22, 2021
9cdd1f2
Merge branch 'fix-#1411-add-delete-plugin-in-darwer' of github.com:st…
stu01509 Mar 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-undef */

context('Create and Delete Plugin List', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
context('Create and Delete Plugin List', () => {
context('Delete Plugin List with the Drawer', () => {

const timeout = 5000;

beforeEach(() => {
cy.login();

cy.fixture('selector.json').as('domSelector');
cy.fixture('data.json').as('data');
});

it('should visit plugin market and create plugin', function () {
cy.visit('/');
cy.contains('Plugin').click();
cy.contains('Create').click();

cy.contains('basic-auth').parents('.ant-card-bordered').within(() => {
cy.get('button').click({ force: true });
});

cy.get('.ant-drawer-content').should('be.visible').within(() => {
cy.get('#disable').click();
cy.get('.ant-switch-checked').should('exist');
});

cy.contains('button', 'Submit').click();
cy.get('.ant-drawer-content', { timeout }).should('not.exist');
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use this.domSelector... and this.data..., refer to other test cases.


it('should delete the plugin in drawer', function () {
cy.visit('/plugin/list');
cy.get(this.domSelector.refresh).click();
cy.contains('button', 'Edit').click();
cy.get('.ant-drawer-footer').contains('button', 'Delete').click({ force: true });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dom element can be moved to public data for other tests use.

cy.contains('button', 'Confirm').click({ force: true });
cy.get(this.domSelector.empty).should('be.visible');
});
});
24 changes: 19 additions & 5 deletions web/cypress/integration/route/create-edit-delete-route.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ context('Create and Delete Route', () => {
const name = `routeName${new Date().valueOf()}`;
const newName = `newName${new Date().valueOf()}`;
const sleepTime = 100;
const timeout = 5000;

beforeEach(() => {
cy.login();
Expand Down Expand Up @@ -72,12 +73,25 @@ context('Create and Delete Route', () => {
});

// config prometheus plugin
cy.contains(this.domSelector.pluginCard, 'prometheus').within(() => {
cy.get('button').first().click({
force: true
});
cy.contains('prometheus').parents('.ant-card-bordered').within(() => {
cy.get('button').click({ force: true });
});

cy.get('.ant-drawer-content').should('be.visible').within(() => {
cy.get('#disable').click();
cy.get('.ant-switch-checked').should('exist');
});

cy.contains('button', 'Submit').click();
cy.get('.ant-drawer-content', { timeout }).should('not.exist');

cy.contains('prometheus').parents('.ant-card-bordered').within(() => {
cy.get('button').click({ force: true });
});
cy.contains('button', 'Cancel').click();

cy.get('.ant-drawer-footer').contains('button', 'Delete').click({ force: true });
cy.contains('button', 'Confirm').click({ force: true });

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also use this.domSelector.. and this.data...
I think another step should be added: check that the plugin was successfully removed after it was deleted.

cy.contains('Next').click();
cy.contains('Submit').click();
cy.contains(this.data.submitSuccess);
Expand Down
22 changes: 22 additions & 0 deletions web/cypress/integration/service/create-edit-delete-service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
/* eslint-disable no-undef */

context('Create and Delete Service ', () => {
const timeout = 5000;

beforeEach(() => {
cy.login();

Expand All @@ -35,6 +37,26 @@ context('Create and Delete Service ', () => {
cy.get(this.domSelector.nodes_0_host).type(this.data.ip1);

cy.contains('Next').click();

cy.contains('prometheus').parents('.ant-card-bordered').within(() => {
cy.get('button').click({ force: true });
});

cy.get('.ant-drawer-content').should('be.visible').within(() => {
cy.get('#disable').click();
cy.get('.ant-switch-checked').should('exist');
});

cy.contains('button', 'Submit').click();
cy.get('.ant-drawer-content', { timeout }).should('not.exist');

cy.contains('prometheus').parents('.ant-card-bordered').within(() => {
cy.get('button').click({ force: true });
});

cy.get('.ant-drawer-footer').contains('button', 'Delete').click({ force: true });
cy.contains('button', 'Confirm').click({ force: true });

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

cy.contains('Next').click();
cy.contains('Submit').click();
cy.get(this.domSelector.notification).should('contain', this.data.createServiceSuccess);
Expand Down