-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added E2E test for plugins (#1214)
* fix(FE): delete global plugin failed (#1170) * fix: delete global plugin failed * fix: filter disable plugins * fix: update online debug api protocol validation and error msg (#1166) * fix: update validation and msg * Update api/internal/handler/route_online_debug/route_online_debug.go * fix: update refer to code review Co-authored-by: 琚致远 <juzhiyuan@apache.org> * feat(cli): Show GitHash for manager-api in branch v2.3 (backport #1162) (#1181) * fix: correct Version and GitHash output for manager-api command (#1162) * bug: fix Version and add GitHash for manager-api command Signed-off-by: imjoey <majunjiev@gmail.com> * feat: git hash support generating .githash for apache release Signed-off-by: imjoey <majunjiev@gmail.com> * feat: Add testcase for the new githash info Signed-off-by: imjoey <majunjiev@gmail.com> * feat: add test case for .githash content validation Signed-off-by: imjoey <majunjiev@gmail.com> * feat: Remove git command dependency for getting git hash Signed-off-by: imjoey <majunjiev@gmail.com> * feat: set VERSION to 2.3 in branch v2.3 Signed-off-by: imjoey <majunjiev@gmail.com> * fix(fe): route search with status (#1205) * fix(fe): route search with status * fix: version and status select box allowclear * fix: remove console * fix: set create_time/update_time as omitempty (#1203) Signed-off-by: imjoey <majunjiev@gmail.com> * fix(FE): service issues (#1209) * fix: omit checks when empty * fix: desc search * fix: omit checks when empty * feat: remove desc search * feat: add create service e2e test * feat: update code * feat: update code * chore: sync json schema from Apache APISIX 2.2 (#1177) * chore: sync json schema from Apache APISIX 2.2 * fix: remove schema of plugins that not enable by default * fix test cases for plugin skywalking which is not enable by default * chore: expose port for control API * fix: control API config * fix yaml format * fix CI failed * fix: log path * fix: log path Co-authored-by: 琚致远 <juzhiyuan@apache.org> * fix: well handle with malformed auth token in request header (#1206) (#1210) * fix: not panic if auth token is invalid Signed-off-by: imjoey <majunjiev@gmail.com> * do not record the false in log Signed-off-by: imjoey <majunjiev@gmail.com> Co-authored-by: Joey <majunjiev@gmail.com> * fix: route list search query string (#1197) * fix: route list search qurey string * fix: well handle with malformed auth token in request header (#1206) * fix: not panic if auth token is invalid Signed-off-by: imjoey <majunjiev@gmail.com> * do not record the false in log Signed-off-by: imjoey <majunjiev@gmail.com> * feat: add search lables e2e * feat: add search route labels testcase * feat: update code * Update selector.json * Update search-route.spec.js Co-authored-by: Joey <majunjiev@gmail.com> Co-authored-by: 琚致远 <juzhiyuan@apache.org> * feat: init cypress with plugin * style: codes format * feat: added come testcases * feat: use the correct api version * feat: added tip * feat: added tip * feat: added test cases * feat: added disable * feat: added disable * feat: added disable * style: codes format * feat: added ajv formats * feat: remove useless codes Co-authored-by: litesun <sunyi@apache.org> Co-authored-by: liuxiran <belovedxixi@126.com> Co-authored-by: Joey <majunjiev@gmail.com> Co-authored-by: nic-chen <johz@163.com> Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com>
- Loading branch information
1 parent
3f8060e
commit 50fb547
Showing
19 changed files
with
1,566 additions
and
75 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/* eslint-disable no-undef */ | ||
|
||
context('smoke test for plugin schema', () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
|
||
cy.fixture('selector.json').as('selector'); | ||
cy.fixture('plugin-dataset.json').as('cases'); | ||
}); | ||
|
||
it('should visit plugin market', function () { | ||
cy.visit('/'); | ||
cy.contains('Plugin').click(); | ||
cy.contains('Create').click(); | ||
|
||
const nameSelector = '[data-cy-plugin-name]'; | ||
cy.get(nameSelector).then(function (cards) { | ||
[...cards].forEach((card) => { | ||
const name = card.innerText; | ||
const cases = this.cases[name] || []; | ||
cases.forEach(({ shouldValid, data, type = '' }) => { | ||
/** | ||
* NOTE: This test is mainly for GlobalPlugin, which is using non-consumer-type schema. | ||
*/ | ||
if (type === 'consumer') { | ||
return true; | ||
} | ||
|
||
cy.contains(name) | ||
.parents('.ant-card-bordered') | ||
.within(() => { | ||
cy.contains('Enable').click({ | ||
force: true, | ||
}); | ||
}); | ||
|
||
// NOTE: wait for the Drawer to appear on the DOM | ||
cy.wait(800); | ||
const switchSelector = '#disable'; | ||
cy.get(switchSelector).click(); | ||
|
||
cy.window().then(({ codemirror }) => { | ||
if (codemirror) { | ||
codemirror.setValue(JSON.stringify(data)); | ||
} | ||
}); | ||
|
||
cy.contains('Submit').click(); | ||
|
||
// NOTE: wait for the HTTP call | ||
cy.wait(500); | ||
if (shouldValid) { | ||
const drawerSelector = '.ant-drawer-content'; | ||
cy.get(drawerSelector).should('not.exist'); | ||
} else { | ||
cy.get(this.selector.notification).should('contain', 'Invalid plugin data'); | ||
|
||
cy.get('.anticon-close').click({ | ||
multiple: true, | ||
}); | ||
cy.contains('Cancel').click({ | ||
force: true, | ||
}); | ||
} | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.