-
Notifications
You must be signed in to change notification settings - Fork 534
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
Changes from 15 commits
4a93880
fc10167
0fffb5e
bf6915f
9577f51
0054591
053740e
6fe03a2
2e49eca
9ec5acb
bb28992
1367477
99a4275
2a561ac
e7d7609
b7857f0
af1f43f
8331f4a
34b2d85
9cdd1f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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', () => { | ||
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'); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use |
||
|
||
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 }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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'); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(); | ||
|
@@ -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 }); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also use |
||
cy.contains('Next').click(); | ||
cy.contains('Submit').click(); | ||
cy.contains(this.data.submitSuccess); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ | |
/* eslint-disable no-undef */ | ||
|
||
context('Create and Delete Service ', () => { | ||
const timeout = 5000; | ||
|
||
beforeEach(() => { | ||
cy.login(); | ||
|
||
|
@@ -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 }); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.