This is an automated email from the ASF dual-hosted git repository.
sunyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new 9c27b57 test: enhanced test stability (#1645)
9c27b57 is described below
commit 9c27b57dc5d2549706a8348f1a036743246f0337
Author: guoqqqi <[email protected]>
AuthorDate: Tue Mar 23 15:26:53 2021 +0800
test: enhanced test stability (#1645)
---
.../consumer/create_and_delete_consumer.spec.js | 14 +++++---------
.../create-edit-delete-plugin-template.spec.js | 6 +++---
.../create-plugin-template-with-route.spec.js | 4 +++-
.../integration/route/create-edit-delete-route.spec.js | 1 +
.../integration/service/edit-service-with-upstream.spec.js | 9 ++++-----
5 files changed, 16 insertions(+), 18 deletions(-)
diff --git
a/web/cypress/integration/consumer/create_and_delete_consumer.spec.js
b/web/cypress/integration/consumer/create_and_delete_consumer.spec.js
index 59a2340..46e88ea 100644
--- a/web/cypress/integration/consumer/create_and_delete_consumer.spec.js
+++ b/web/cypress/integration/consumer/create_and_delete_consumer.spec.js
@@ -27,8 +27,8 @@ context('Create and Delete Consumer', () => {
it('creates consumer with key-auth', function () {
cy.visit('/');
cy.contains('Consumer').click();
+ 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);
@@ -59,8 +59,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();
@@ -74,17 +73,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);
diff --git
a/web/cypress/integration/pluginTemplate/create-edit-delete-plugin-template.spec.js
b/web/cypress/integration/pluginTemplate/create-edit-delete-plugin-template.spec.js
index 1294c6c..c3be23f 100644
---
a/web/cypress/integration/pluginTemplate/create-edit-delete-plugin-template.spec.js
+++
b/web/cypress/integration/pluginTemplate/create-edit-delete-plugin-template.spec.js
@@ -28,7 +28,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.get(this.domSelector.empty).should('be.visible');
+ 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);
@@ -52,7 +54,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();
@@ -68,7 +69,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();
diff --git
a/web/cypress/integration/pluginTemplate/create-plugin-template-with-route.spec.js
b/web/cypress/integration/pluginTemplate/create-plugin-template-with-route.spec.js
index 4adf6a0..c516532 100644
---
a/web/cypress/integration/pluginTemplate/create-plugin-template-with-route.spec.js
+++
b/web/cypress/integration/pluginTemplate/create-plugin-template-with-route.spec.js
@@ -27,7 +27,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.get(this.domSelector.empty).should('be.visible');
+ 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();
diff --git a/web/cypress/integration/route/create-edit-delete-route.spec.js
b/web/cypress/integration/route/create-edit-delete-route.spec.js
index d0f4e83..1549b52 100644
--- a/web/cypress/integration/route/create-edit-delete-route.spec.js
+++ b/web/cypress/integration/route/create-edit-delete-route.spec.js
@@ -32,6 +32,7 @@ context('Create and Delete Route', () => {
it('should create route', function () {
cy.visit('/');
cy.contains('Route').click();
+ 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);
diff --git a/web/cypress/integration/service/edit-service-with-upstream.spec.js
b/web/cypress/integration/service/edit-service-with-upstream.spec.js
index b4f773f..490cde7 100644
--- a/web/cypress/integration/service/edit-service-with-upstream.spec.js
+++ b/web/cypress/integration/service/edit-service-with-upstream.spec.js
@@ -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');
+ 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();
@@ -40,6 +39,7 @@ context('Edit Service with Upstream', () => {
it('should create a test service', function () {
cy.visit('/');
cy.contains('Service').click();
+ 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);
@@ -54,8 +54,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();