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

feat(FE): update route e2e #1074

Merged
merged 1 commit into from
Dec 19, 2020
Merged
Changes from all commits
Commits
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
Expand Up @@ -17,7 +17,7 @@
/* eslint-disable no-undef */

context('Create and Delete Route', () => {
const root_name = `root_${new Date().valueOf()}`;
const name = `routeName${new Date().valueOf()}`;

beforeEach(() => {
// init login
Expand All @@ -26,12 +26,12 @@ context('Create and Delete Route', () => {

it('create route', () => {
// go to route create page
cy.visit('/routes/create');
cy.visit('/');
cy.contains('Route').click();
cy.contains('Create').click();

// input Name And Description
cy.get('#name').type(root_name);
cy.get('#name').type(name);
cy.get('#desc').type('desc');

// input Request Basic Define
Expand All @@ -48,7 +48,7 @@ context('Create and Delete Route', () => {
cy.contains('Cookie').click();
cy.get('.ant-modal').within(() => {
cy.get('#name').type('modalName');
})
});
cy.get('#operator').click();
cy.contains('Equal').click();
cy.get('#value').type('value');
Expand All @@ -65,9 +65,9 @@ context('Create and Delete Route', () => {
cy.contains('Next').click();

// config prometheus plugin
cy.contains('.ant-card', 'prometheus').within(($form) => {
cy.contains('.ant-card', 'prometheus').within(() => {
cy.get('button').first().click();
})
});
cy.contains('button', 'Cancel').click();

// go to step4
Expand All @@ -82,9 +82,9 @@ context('Create and Delete Route', () => {

it('delete the route', () => {
cy.visit('/routes/list');
cy.get('[title=Name]').type(root_name);
cy.get('[title=Name]').type(name);
cy.contains('查 询').click();
cy.contains(root_name).siblings().contains('Delete').click();
cy.contains(name).siblings().contains('Delete').click();
cy.contains('button', 'Confirm').click();
cy.get('.ant-notification-notice-message').should('contain', 'Delete Route Successfully');
})
Expand Down