Skip to content

Commit

Permalink
feat(FE): update route e2e (#1074)
Browse files Browse the repository at this point in the history
  • Loading branch information
LiteSun authored Dec 19, 2020
1 parent 4f12ae6 commit cb1377c
Showing 1 changed file with 8 additions and 8 deletions.
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

0 comments on commit cb1377c

Please sign in to comment.