You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by su...@apache.org on 2021/05/17 01:39:12 UTC
[apisix-dashboard] branch master updated: chore: refactored test
ssl-smoketest.spec.js (#1878)
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 f1ce606 chore: refactored test ssl-smoketest.spec.js (#1878)
f1ce606 is described below
commit f1ce6064bf785d463fd210ab4c1b6d268b326cef
Author: Ayush das <ay...@gmail.com>
AuthorDate: Mon May 17 07:09:05 2021 +0530
chore: refactored test ssl-smoketest.spec.js (#1878)
---
web/cypress/integration/ssl/ssl-smoketest.spec.js | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/web/cypress/integration/ssl/ssl-smoketest.spec.js b/web/cypress/integration/ssl/ssl-smoketest.spec.js
index 1e35a80..b07bc34 100644
--- a/web/cypress/integration/ssl/ssl-smoketest.spec.js
+++ b/web/cypress/integration/ssl/ssl-smoketest.spec.js
@@ -17,12 +17,19 @@
/* eslint-disable no-undef */
context('ssl smoke test', () => {
+ const selector = {
+ notificationMessage: '.ant-notification-notice-message',
+ notificationDesc: '.ant-notification-notice-description',
+ };
+
+ const data = {
+ deleteSSLSuccess: 'Remove target SSL successfully',
+ sslErrorAlert: "key and cert don't match",
+ };
+
beforeEach(() => {
cy.login();
-
cy.fixture('certificate.json').as('certificate');
- cy.fixture('selector.json').as('domSelector');
- cy.fixture('data.json').as('data');
});
it('should set match certificate and key by input', function () {
@@ -48,7 +55,7 @@ context('ssl smoke test', () => {
const sni = this.certificate.valid.sni;
cy.contains(sni).parents().contains('Delete').click();
cy.contains('button', 'Confirm').click();
- cy.get(this.domSelector.notificationMessage).should('contain', this.data.deleteSSLSuccess);
+ cy.get(selector.notificationMessage).should('contain', data.deleteSSLSuccess);
});
it('should set unmatch certificate and key by input', function () {
@@ -63,6 +70,6 @@ context('ssl smoke test', () => {
cy.get('#key').type(invalidKey);
cy.contains('Next').click();
- cy.get(this.domSelector.notificationDesc).should('contain', this.data.sslErrorAlert);
+ cy.get(selector.notificationDesc).should('contain', data.sslErrorAlert);
});
});