Skip to content

Commit

Permalink
Merge remote-tracking branch 'apisix/master' into fix-inconsistent-di…
Browse files Browse the repository at this point in the history
…splayname
  • Loading branch information
ericsyh committed Apr 12, 2021
2 parents 2c17d82 + eede893 commit 405f3cc
Show file tree
Hide file tree
Showing 50 changed files with 1,985 additions and 705 deletions.
12 changes: 2 additions & 10 deletions api/test/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,7 @@ services:

apisix:
hostname: apisix_server1
build:
context: ../../
dockerfile: test/docker/Dockerfile-apisix
args:
- APISIX_VERSION=2.4
image: apache/apisix:2.4-alpine
restart: always
volumes:
- ./apisix_config.yaml:/usr/local/apisix/conf/config.yaml:ro
Expand All @@ -152,11 +148,7 @@ services:

apisix2:
hostname: apisix_server2
build:
context: ../../
dockerfile: test/docker/Dockerfile-apisix
args:
- APISIX_VERSION=2.4
image: apache/apisix:2.4-alpine
restart: always
volumes:
- ./apisix_config2.yaml:/usr/local/apisix/conf/config.yaml:ro
Expand Down
5 changes: 5 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
from = "/apisix/*"
to = "http://139.217.190.60/apisix/:splat"
status = 200

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
7 changes: 5 additions & 2 deletions web/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"viewportHeight": 1080,
"baseUrl": "http://localhost:8000",
"video": true,
"numTestsKeptInMemory": 0,
"videoUploadOnPasses": false
"videoUploadOnPasses": false,
"retries": {
"runMode": 3,
"openMode": 0
}
}
6 changes: 3 additions & 3 deletions web/cypress/fixtures/export-route-dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
"weight": 1
}
],
"retries": 1,
"timeout": {
"connect": 6,
"read": 6,
"send": 6
},
"type": "roundrobin",
"scheme": "http",
"pass_host": "pass"
}
}
Expand Down Expand Up @@ -90,13 +90,13 @@
"weight": 1
}
],
"retries": 1,
"timeout": {
"connect": 6,
"read": 6,
"send": 6
},
"type": "roundrobin",
"scheme": "http",
"pass_host": "pass"
}
}
Expand Down Expand Up @@ -141,13 +141,13 @@
"weight": 1
}
],
"retries": 1,
"timeout": {
"connect": 6,
"read": 6,
"send": 6
},
"type": "roundrobin",
"scheme": "http",
"pass_host": "pass"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ context('Create Configure and Delete PluginTemplate', () => {

cy.get(this.domSelector.description).type(this.data.pluginTemplateName);
cy.contains('Next').click();

// should not see proxy-rewrite plugin in the step2
cy.contains('proxy-rewrite').should('not.exist');

cy.contains('Enable').click({
force: true
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ context('Create PluginTemplate Binding To Route', () => {

cy.visit('/routes/list');
cy.contains('Create').click();
cy.get(this.domSelector.empty).should('be.visible');
cy.get(this.domSelector.name).click();

// NOTE: make sure all components rerender done
cy.contains('Next').click().click();
cy.get(this.domSelector.name).type(this.data.routeName);
cy.contains('Next').click();
cy.get(this.domSelector.nodes_0_host).type(this.data.ip1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ context('Create and Delete Route', () => {
cy.get(this.domSelector.name).type('modalName');
});
cy.get(this.domSelector.operator).click();
cy.contains('Equal').click();
cy.get('[title=Equal]').should('be.visible').click();
cy.get(this.domSelector.value).type('value');
cy.contains('Confirm').click();

Expand Down Expand Up @@ -139,7 +139,8 @@ context('Create and Delete Route', () => {
cy.contains('Search').click();
cy.contains(name).siblings().contains('Configure').click();

cy.wait(500);
// NOTE: make sure all components rerender done
cy.get('#status').should('have.class', 'ant-switch-checked');
cy.get(this.domSelector.name).clear().type(newName);
cy.get(this.domSelector.description).clear().type(this.data.description2);
cy.contains('Next').click();
Expand All @@ -166,13 +167,15 @@ context('Create and Delete Route', () => {
it('should duplicate the route', function () {
cy.visit('/');
cy.contains('Route').click();
cy.reload();

cy.get(this.domSelector.nameSelector).type(newName);
cy.contains('Search').click();
cy.contains(newName).siblings().contains('More').click();
cy.contains('Duplicate').click();

cy.wait(500);
// NOTE: make sure all components rerender done
cy.get('#status').should('have.class', 'ant-switch-checked');
cy.get(this.domSelector.name).clear().type(duplicateNewName);
cy.get(this.domSelector.description).clear().type(this.data.description2);
cy.contains('Next').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ context('create route with proxy-rewrite plugin', () => {
cy.get(this.domSelector.nameSelector).type(this.data.routeName);
cy.contains('Search').click();
cy.contains(this.data.routeName).siblings().contains('Configure').click();
cy.wait(500);

// NOTE: make sure all components rerender done
cy.get('#status').should('have.class', 'ant-switch-checked');
cy.get(this.domSelector.name).type(this.data.routeName);

cy.contains(routeLocaleUS['page.route.form.itemLabel.newPath']).should('be.visible');
Expand Down
3 changes: 1 addition & 2 deletions web/cypress/integration/route/search-route.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ context('Create and Search Route', () => {
});

it('should search the route with labels', function () {
cy.visit('/routes/list');
// search one label
cy.contains(data.test0).should('exist');
cy.reload();
cy.get(this.domSelector.labelSelect_0).click({ timeout });
cy.get(this.domSelector.dropdown).contains(data.value0).should('be.visible').click();
cy.contains('Search').click();
Expand Down
11 changes: 11 additions & 0 deletions web/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ Cypress.Commands.add('configurePlugins', (cases) => {
});
});

cy.get(domSelector.codeMirrorMode).invoke('text').then(text => {
if (text === 'Form') {
// FIXME: https://github.com/cypress-io/cypress/issues/7306
cy.wait(5000);
cy.get(domSelector.codeMirrorMode).should('be.visible');
cy.get(domSelector.codeMirrorMode).click();
cy.get(domSelector.selectDropdown).should('be.visible');
cy.get(domSelector.selectJSON).click();
}
});

cy.window().then(({ codemirror }) => {
if (codemirror) {
codemirror.setValue(JSON.stringify(data));
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/Plugin/UI/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/
import React from 'react';
import { FormInstance } from 'antd/es/form';
import type { FormInstance } from 'antd/es/form';
import { Empty } from 'antd';
import { useIntl } from 'umi';

Expand Down
Loading

0 comments on commit 405f3cc

Please sign in to comment.