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: enhanced test stability #1645

Merged
merged 3 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -25,10 +25,9 @@ context('Create and Delete Consumer', () => {
});

it('creates consumer with key-auth', function () {
cy.visit('/');
cy.contains('Consumer').click();
cy.visit('/consumer/list');
LiteSun marked this conversation as resolved.
Show resolved Hide resolved
cy.get(this.domSelector.empty).should('be.visible');
cy.contains('Create').click();

// basic information
cy.get(this.domSelector.username).type(this.data.consumerName);
cy.get(this.domSelector.description).type(this.data.description);
Expand Down Expand Up @@ -59,8 +58,7 @@ context('Create and Delete Consumer', () => {
});

it('should view the consumer', function () {
cy.visit('/');
cy.contains('Consumer').click();
cy.visit('/consumer/list');

cy.get(this.domSelector.nameSelector).type(this.data.consumerName);
cy.contains('Search').click();
Expand All @@ -74,17 +72,14 @@ context('Create and Delete Consumer', () => {
});

it('delete the consumer', function () {
cy.visit('/');
cy.contains('Consumer').click();
cy.contains(this.data.consumerName).siblings().contains('Delete').click();
cy.visit('/consumer/list');
cy.contains(this.data.consumerName).should('be.visible').siblings().contains('Delete').click();
cy.contains('button', 'Confirm').click();
cy.get(this.domSelector.notification).should('contain', this.data.deleteConsumerSuccess);
});

it('creates consumer with wrong json', function () {
// go to consumer create page
cy.visit('/');
cy.contains('Consumer').click();
cy.visit('/consumer/list');
cy.contains('Create').click();
// basic information
cy.get(this.domSelector.username).type(this.data.consumerName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ context('Create Edit and Delete PluginTemplate', () => {
});

it('should create pluginTemplate', function () {
cy.visit('/');
cy.contains('Route').click();
cy.contains('Plugin Template Config').click();
cy.visit('/routes/list');
cy.contains('Plugin Template Config').should('be.visible').click();
cy.get(this.domSelector.empty).should('be.visible');
cy.contains('Create').click();

cy.get(this.domSelector.description).type(this.data.pluginTemplateName);
Expand All @@ -52,7 +52,6 @@ context('Create Edit and Delete PluginTemplate', () => {

it('should edit the pluginTemplate', function () {
cy.visit('plugin-template/list');

cy.get(this.domSelector.refresh).click();
cy.get(this.domSelector.descriptionSelector).type(this.data.pluginTemplateName);
cy.contains('button', 'Search').click();
Expand All @@ -68,7 +67,6 @@ context('Create Edit and Delete PluginTemplate', () => {

it('should delete pluginTemplate', function () {
cy.visit('plugin-template/list');

cy.get(this.domSelector.refresh).click();
cy.get(this.domSelector.descriptionSelector).type(this.data.pluginTemplateName);
cy.contains('button', 'Search').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ context('Create PluginTemplate Binding To Route', () => {
});

it('should create test pluginTemplate', function () {
cy.visit('/');
cy.contains('Route').click();
cy.contains('Plugin Template Config').click();
cy.visit('/routes/list');
cy.contains('Plugin Template Config').should('be.visible').click();
cy.get(this.domSelector.empty).should('be.visible');
cy.contains('Create').click();
cy.get(this.domSelector.description).type(this.data.pluginTemplateName);
cy.contains('Next').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ context('Create and Delete Route', () => {
});

it('should create route', function () {
cy.visit('/');
cy.contains('Route').click();
cy.visit('/routes/list');
cy.get(this.domSelector.empty).should('be.visible');
cy.contains('Create').click();
cy.get(this.domSelector.name).type(name);
cy.get(this.domSelector.description).type(this.data.description);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ context('Edit Service with Upstream', () => {
});

it('should create a test upstream', function () {
cy.visit('/');
cy.contains('Upstream').click();
cy.visit('/upstream/list');
liuxiran marked this conversation as resolved.
Show resolved Hide resolved
cy.get(this.domSelector.empty).should('be.visible');
cy.contains('Create').click();

cy.get(this.domSelector.name).type(this.data.upstreamName);
cy.get(this.domSelector.nodes_0_host).type(this.data.ip1);
cy.contains('Next').click();
Expand All @@ -38,8 +37,8 @@ context('Edit Service with Upstream', () => {
});

it('should create a test service', function () {
cy.visit('/');
cy.contains('Service').click();
cy.visit('/service/list');
cy.get(this.domSelector.empty).should('be.visible');
cy.contains('Create').click();
cy.get(this.domSelector.name).type(this.data.serviceName);
cy.get(this.domSelector.description).type(this.data.description);
Expand All @@ -54,8 +53,7 @@ context('Edit Service with Upstream', () => {
});

it('should edit the service', function () {
cy.visit('/');
cy.contains('Service').click();
cy.visit('/service/list');

cy.get(this.domSelector.nameSearch).type(this.data.serviceName);
cy.contains('Search').click();
Expand Down