@nathapp/na-cli 1.0.0-rc.4 → 1.0.0-rc.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +135 -0
- package/Makefile +16 -9
- package/README.md +18 -2
- package/alias-script.sh +30 -0
- package/dist/index.js +106 -128
- package/dist/index.js.map +1 -1
- package/dist/templates/db-schema/.gitignore-rename +1 -0
- package/dist/templates/db-schema/.gitlab-ci.yml +139 -0
- package/dist/templates/db-schema/001_Schema.sql +1 -0
- package/dist/templates/db-schema/DEV_MODE.txt +1 -0
- package/dist/templates/db-schema/Dockerfile +3 -0
- package/dist/templates/db-schema/Email-Templates/Individual/README.md +1 -0
- package/dist/templates/db-schema/GET_VERSION.sql +47 -0
- package/dist/templates/db-schema/Makefile +885 -0
- package/dist/templates/db-schema/README.md +117 -0
- package/dist/templates/db-schema/SET_VERSION.sql +5 -0
- package/dist/templates/db-schema/docker-compose.yaml +47 -0
- package/dist/templates/db-schema/package.json +3 -0
- package/dist/templates/db-schema/push.sh +0 -0
- package/dist/templates/db-schema/samples/899_DB_Grant_User.sql +9 -0
- package/dist/templates/db-schema/samples/990_SAMPLE_Init_Data.sql +27 -0
- package/dist/templates/k8s-deployment/.gitignore-rename +1 -0
- package/dist/templates/k8s-deployment/.gitlab-ci.yml +128 -0
- package/dist/templates/k8s-deployment/.helmignore +23 -0
- package/dist/templates/k8s-deployment/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/Makefile +196 -0
- package/dist/templates/k8s-deployment/README.md +32 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/script/Makefile +12 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/job.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/values.yaml +51 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/deployment.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/ingress.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/job.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/pv.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/pvc.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/sc.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/service.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/templates/statefulset.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/values.yaml +15 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/script/Makefile +8 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/job.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/values.yaml +42 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/deployment.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/ingress.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/job.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/pv.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/pvc.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/sc.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/service.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/templates/statefulset.yaml +1 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/values.yaml +12 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/script/Makefile +49 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/script/_env.yaml +2 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/job.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/values.yaml +36 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/cluster-role-binding.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/cronjob.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/deployment.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/ingress.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/pv.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/pvc.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/sc.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/service-account.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/service.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/templates/statefulset.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/sample-nginx/values.yaml +47 -0
- package/dist/templates/k8s-deployment/services/charts/tests/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/Makefile +9 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/fixtures/index.json +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/login/login-spec.js +47 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/login/loginEmailWrong-spec.js +14 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/login/loginPasswordWrong-spec.js +14 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/profile/updatePassword-spec.js +15 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/profile/updateProfile-spec.js +25 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/integration/test-script.spec.js +9 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/plugins/index.js +22 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/support/commands.js +258 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/support/index.js +35 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress/support/misc.js +8 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/cypress.json +4 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/pod.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/values.yaml +70 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/.helmignore +2 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/Chart.yaml +23 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/script/Makefile +14 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/pod.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/secret.yaml +1 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/_t-0100-readiness-liveness.ts +84 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/hub.ts +372 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contact.ts +158 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contract.ts +328 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-kyc.ts +304 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-app.ts +823 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-web.ts +493 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-profile.ts +277 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-whitelist.ts +133 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/resources/live.jpg +0 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/resources/mykad_front.jpg +0 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/resources/profile.jpg +0 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/t-0200-start.ts +172 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/values.yaml +59 -0
- package/dist/templates/k8s-deployment/templates/_cluster-role-binding.tpl +20 -0
- package/dist/templates/k8s-deployment/templates/_configmap.tpl +37 -0
- package/dist/templates/k8s-deployment/templates/_cronjob.tpl +225 -0
- package/dist/templates/k8s-deployment/templates/_deployment.tpl +246 -0
- package/dist/templates/k8s-deployment/templates/_helpers.tpl +31 -0
- package/dist/templates/k8s-deployment/templates/_ingress.tpl +77 -0
- package/dist/templates/k8s-deployment/templates/_job.tpl +233 -0
- package/dist/templates/k8s-deployment/templates/_pod.tpl +214 -0
- package/dist/templates/k8s-deployment/templates/_pv.tpl +42 -0
- package/dist/templates/k8s-deployment/templates/_pvc.tpl +27 -0
- package/dist/templates/k8s-deployment/templates/_root.tpl +314 -0
- package/dist/templates/k8s-deployment/templates/_sc.tpl +19 -0
- package/dist/templates/k8s-deployment/templates/_secret.tpl +15 -0
- package/dist/templates/k8s-deployment/templates/_service-account.tpl +8 -0
- package/dist/templates/k8s-deployment/templates/_service.tpl +40 -0
- package/dist/templates/k8s-deployment/templates/_statefulset.tpl +244 -0
- package/dist/templates/k8s-deployment/templates/root-cm.yaml +10 -0
- package/dist/templates/k8s-deployment/templates/root-pull-secret.yaml +11 -0
- package/dist/templates/k8s-deployment/templates/root-secret.yaml +24 -0
- package/dist/templates/k8s-deployment/values.yaml +38 -0
- package/dist/templates/k8s-helm-chart/Chart.yaml +23 -0
- package/dist/templates/k8s-helm-chart/templates/_helpers.tpl +62 -0
- package/dist/templates/k8s-helm-chart/templates/cluster-role-binding.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/configmap.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/cronjob.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/deployment.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/ingress.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/pv.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/pvc.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/sc.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/secret.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/service-account.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/service.yaml +1 -0
- package/dist/templates/k8s-helm-chart/templates/statefulset.yaml +1 -0
- package/dist/templates/k8s-helm-chart/values.yaml +41 -0
- package/dist/templates/mxw-base-api-express/.dockerignore +2 -0
- package/dist/templates/mxw-base-api-express/.env +10 -0
- package/dist/templates/mxw-base-api-express/.gitignore-rename +3 -0
- package/dist/templates/mxw-base-api-express/.gitlab-ci.yml +174 -0
- package/dist/templates/mxw-base-api-express/.nvmrc +1 -0
- package/dist/templates/mxw-base-api-express/Dockerfile +14 -0
- package/dist/templates/mxw-base-api-express/Makefile +84 -0
- package/dist/templates/mxw-base-api-express/README.md +71 -0
- package/dist/templates/mxw-base-api-express/package.json +55 -0
- package/dist/templates/mxw-base-api-express/src/app-service.test.ts +94 -0
- package/dist/templates/mxw-base-api-express/src/app-service.ts +498 -0
- package/dist/templates/mxw-base-api-express/src/auth/auth-user.test.ts +215 -0
- package/dist/templates/mxw-base-api-express/src/auth/auth-user.ts +86 -0
- package/dist/templates/mxw-base-api-express/src/auth/auth.ts +81 -0
- package/dist/templates/mxw-base-api-express/src/core-service.ts +72 -0
- package/dist/templates/mxw-base-api-express/src/crud.ts +84 -0
- package/dist/templates/mxw-base-api-express/src/http-handler.ts +71 -0
- package/dist/templates/mxw-base-api-express/src/server.ts +54 -0
- package/dist/templates/mxw-base-api-express/src/test.ts +38 -0
- package/dist/templates/mxw-base-api-express/src/utils/api-utilities.ts +52 -0
- package/dist/templates/mxw-base-api-express/src/utils/file-utilities.ts +55 -0
- package/dist/templates/mxw-base-api-express/tsconfig.json +32 -0
- package/dist/templates/nestjs-api/.dockerignore +2 -0
- package/dist/templates/nestjs-api/.env +12 -0
- package/dist/templates/nestjs-api/.eslintrc.js +25 -0
- package/dist/templates/nestjs-api/.gitignore-rename +35 -0
- package/dist/templates/nestjs-api/.gitlab-ci.yml +174 -0
- package/dist/templates/nestjs-api/.nvmrc +1 -0
- package/dist/templates/nestjs-api/.prettierrc +4 -0
- package/dist/templates/nestjs-api/Dockerfile +19 -0
- package/dist/templates/nestjs-api/Makefile +84 -0
- package/dist/templates/nestjs-api/README.md +67 -0
- package/dist/templates/nestjs-api/nest-cli.json +8 -0
- package/dist/templates/nestjs-api/package.json +75 -0
- package/dist/templates/nestjs-api/src/app.controller.spec.ts +22 -0
- package/dist/templates/nestjs-api/src/app.controller.ts +27 -0
- package/dist/templates/nestjs-api/src/app.module.ts +10 -0
- package/dist/templates/nestjs-api/src/app.service.ts +12 -0
- package/dist/templates/nestjs-api/src/main.ts +31 -0
- package/dist/templates/nestjs-api/test/app.e2e-spec.ts +24 -0
- package/dist/templates/nestjs-api/test/jest-e2e.json +9 -0
- package/dist/templates/nestjs-api/tsconfig.build.json +4 -0
- package/dist/templates/nestjs-api/tsconfig.json +22 -0
- package/dist/templates/nestjs-library/.eslintrc.js +24 -0
- package/dist/templates/nestjs-library/.gitignore-rename +39 -0
- package/dist/templates/nestjs-library/.gitlab-ci.yml +135 -0
- package/dist/templates/nestjs-library/.npmignore-rename +30 -0
- package/dist/templates/nestjs-library/.prettierrc +6 -0
- package/dist/templates/nestjs-library/LICENSE +21 -0
- package/dist/templates/nestjs-library/Makefile +60 -0
- package/dist/templates/nestjs-library/README.md +3 -0
- package/dist/templates/nestjs-library/index.d.ts +1 -0
- package/dist/templates/nestjs-library/index.js +6 -0
- package/dist/templates/nestjs-library/index.ts +1 -0
- package/dist/templates/nestjs-library/lib/index.ts +2 -0
- package/dist/templates/nestjs-library/package.json +43 -0
- package/dist/templates/nestjs-library/tsconfig.build.json +4 -0
- package/dist/templates/nestjs-library/tsconfig.json +18 -0
- package/dist/templates/ts-library/.dockerignore +2 -0
- package/dist/templates/ts-library/.eslintrc.js +24 -0
- package/dist/templates/ts-library/.gitignore-rename +37 -0
- package/dist/templates/ts-library/.gitlab-ci.yml +135 -0
- package/dist/templates/ts-library/.npmignore-rename +30 -0
- package/dist/templates/ts-library/.prettierrc +6 -0
- package/dist/templates/ts-library/LICENSE +21 -0
- package/dist/templates/ts-library/Makefile +58 -0
- package/dist/templates/ts-library/README.md +1 -0
- package/dist/templates/ts-library/index.d.ts +1 -0
- package/dist/templates/ts-library/index.js +6 -0
- package/dist/templates/ts-library/index.ts +1 -0
- package/dist/templates/ts-library/lib/index.ts +1 -0
- package/dist/templates/ts-library/lib/samples/index.ts +5 -0
- package/dist/templates/ts-library/lib/samples/samples-function.ts +3 -0
- package/dist/templates/ts-library/package.json +34 -0
- package/dist/templates/ts-library/test/jest-e2e.json +9 -0
- package/dist/templates/ts-library/test/sample.e2e-spec.ts +10 -0
- package/dist/templates/ts-library/tsconfig.build.json +4 -0
- package/dist/templates/ts-library/tsconfig.json +18 -0
- package/dist/utils/env.js +146 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/template.js +362 -1
- package/dist/utils/template.js.map +1 -1
- package/package.json +9 -5
- package/src/index.ts +0 -182
- package/src/utils/template.ts +0 -9
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
// ***********************************************
|
|
3
|
+
// This example commands.js shows you how to
|
|
4
|
+
// create various custom commands and overwrite
|
|
5
|
+
// existing commands.
|
|
6
|
+
//
|
|
7
|
+
// For more comprehensive examples of custom
|
|
8
|
+
// commands please read more here:
|
|
9
|
+
// https://on.cypress.io/custom-commands
|
|
10
|
+
// ***********************************************
|
|
11
|
+
//
|
|
12
|
+
//
|
|
13
|
+
// -- This is a parent command --
|
|
14
|
+
// Cypress.Commands.add("login", (email, password) => { ... })
|
|
15
|
+
//
|
|
16
|
+
//
|
|
17
|
+
// -- This is a child command --
|
|
18
|
+
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
|
|
19
|
+
//
|
|
20
|
+
//
|
|
21
|
+
// -- This is a dual command --
|
|
22
|
+
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
|
|
23
|
+
//
|
|
24
|
+
//
|
|
25
|
+
// -- This will overwrite an existing command --
|
|
26
|
+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
|
27
|
+
import 'cypress-file-upload';
|
|
28
|
+
import { intGenerator } from './misc.js';
|
|
29
|
+
|
|
30
|
+
//Normal type
|
|
31
|
+
Cypress.Commands.add('vType', (target, text, id = 0) => {
|
|
32
|
+
cy.get('[data-cy=text-' + target + ']')
|
|
33
|
+
.eq(id)
|
|
34
|
+
.children()
|
|
35
|
+
.type(text);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
//Check Error on text
|
|
39
|
+
Cypress.Commands.add('vCheckError', target => {
|
|
40
|
+
cy.get('[data-cy=text-' + target + ']')
|
|
41
|
+
.children()
|
|
42
|
+
.children()
|
|
43
|
+
.should('have.class', 'error--text');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
//Check Error on select
|
|
47
|
+
Cypress.Commands.add('vCheckSelectError', target => {
|
|
48
|
+
cy.get('[data-cy=select-' + target + ']')
|
|
49
|
+
.children()
|
|
50
|
+
.should('have.class', 'error--text');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
//Purposely Insert wrong type into field, expect error
|
|
54
|
+
Cypress.Commands.add('vErrorText', (target, text, id = 0) => {
|
|
55
|
+
cy.get('[data-cy=text-' + target + ']')
|
|
56
|
+
.eq(id)
|
|
57
|
+
.children()
|
|
58
|
+
.type(text);
|
|
59
|
+
cy.get('[data-cy=text-' + target + ']').should('have.class', 'error--text');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
//Select empty on select
|
|
63
|
+
Cypress.Commands.add('vErrorSelect', target => {
|
|
64
|
+
cy.get('[data-cy=select-' + target + ']').click();
|
|
65
|
+
cy.get(
|
|
66
|
+
'[data-cy=select-' +
|
|
67
|
+
target +
|
|
68
|
+
'] > .v-input > .v-input__control > .v-input__slot > .v-select__slot > .v-input__append-inner > .v-input__icon > .v-icon'
|
|
69
|
+
).click({ force: true });
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
//Clear Text
|
|
73
|
+
Cypress.Commands.add('vClear', (target, id = 0) => {
|
|
74
|
+
cy.get('[data-cy=text-' + target + ']')
|
|
75
|
+
.eq(id)
|
|
76
|
+
.children()
|
|
77
|
+
.clear();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
//Add Date Range
|
|
81
|
+
Cypress.Commands.add('vSelectDateRange', (target, id = 0) => {
|
|
82
|
+
cy.get('[data-cy=text-' + target + ']')
|
|
83
|
+
.children()
|
|
84
|
+
.children()
|
|
85
|
+
.children()
|
|
86
|
+
.eq(id)
|
|
87
|
+
.type('2020-01-01~2020-12-31', { force: true });
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
//Type in random number
|
|
91
|
+
Cypress.Commands.add('vTypeRndNumber', (target, digits = 5, id = 0) => {
|
|
92
|
+
var num = intGenerator(digits);
|
|
93
|
+
cy.get('[data-cy=text-' + target + ']')
|
|
94
|
+
.eq(id)
|
|
95
|
+
.children()
|
|
96
|
+
.type(num);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
//Type in Email
|
|
100
|
+
Cypress.Commands.add('vTypeEmail', (target, id = 0) => {
|
|
101
|
+
cy.get('[data-cy=text-' + target + ']')
|
|
102
|
+
.eq(id)
|
|
103
|
+
.children()
|
|
104
|
+
.type('aa@aa.aa');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
//Type in Text Area
|
|
108
|
+
Cypress.Commands.add('fillupTextArea', (target, text, id = 0) => {
|
|
109
|
+
cy.get('[data-cy=text-' + target + ']')
|
|
110
|
+
.eq(id)
|
|
111
|
+
.children()
|
|
112
|
+
.type(text);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
//V Select
|
|
116
|
+
Cypress.Commands.add('vSelect', (target, value) => {
|
|
117
|
+
cy.get('[data-cy=select-' + target + ']')
|
|
118
|
+
.children()
|
|
119
|
+
.type(value + '{enter}');
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
//Upload Component
|
|
123
|
+
Cypress.Commands.add('upload', target => {
|
|
124
|
+
cy.fixture('WALLPAPER.jpg').then(fileContent => {
|
|
125
|
+
cy.get('[data-cy=file-' + target + ']').attachFile({
|
|
126
|
+
fileContent: fileContent.toString(),
|
|
127
|
+
fileName: 'WALLPAPER.jpg',
|
|
128
|
+
mimeType: 'image/png',
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
//File Selector
|
|
134
|
+
Cypress.Commands.add(
|
|
135
|
+
'attach_file',
|
|
136
|
+
{
|
|
137
|
+
prevSubject: 'element',
|
|
138
|
+
},
|
|
139
|
+
(input, fileName, fileType) => {
|
|
140
|
+
console.log('Here');
|
|
141
|
+
cy.fixture(fileName)
|
|
142
|
+
.then(content => Cypress.Blob.base64StringToBlob(content, fileType))
|
|
143
|
+
.then(blob => {
|
|
144
|
+
const testFile = new File([blob], fileName);
|
|
145
|
+
const dataTransfer = new DataTransfer();
|
|
146
|
+
|
|
147
|
+
dataTransfer.items.add(testFile);
|
|
148
|
+
input[0].files = dataTransfer.files;
|
|
149
|
+
return input;
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
//Check checkbox
|
|
155
|
+
Cypress.Commands.add('vCheck', target => {
|
|
156
|
+
cy.get('[data-cy=checkbox-' + target + ']').check({ force: true });
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
//Check radio
|
|
160
|
+
Cypress.Commands.add('vRadio', (target, id = 0) => {
|
|
161
|
+
cy.get('[data-cy=radio-' + target + ']')
|
|
162
|
+
.eq(id)
|
|
163
|
+
.check({ force: true });
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
//Click Button
|
|
167
|
+
Cypress.Commands.add('vClickBtn', (target, id = 0) => {
|
|
168
|
+
cy.get('[data-cy=btn-' + target + ']')
|
|
169
|
+
.eq(id)
|
|
170
|
+
.click({ force: true });
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
//Click Tab
|
|
174
|
+
Cypress.Commands.add('vClickTab', target => {
|
|
175
|
+
cy.get('[data-cy=tab-' + target + ']').click();
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
//Click Tab
|
|
179
|
+
Cypress.Commands.add('vClickNestTab', (target, id = 0) => {
|
|
180
|
+
cy.get('[data-cy=tab-' + target + ']')
|
|
181
|
+
.children()
|
|
182
|
+
.children()
|
|
183
|
+
.eq(1)
|
|
184
|
+
.children()
|
|
185
|
+
.children()
|
|
186
|
+
.eq(id)
|
|
187
|
+
.click();
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
//Click Button
|
|
191
|
+
Cypress.Commands.add('vClickTable', (target, id = 0) => {
|
|
192
|
+
cy.get('[data-cy=table-' + target + ']')
|
|
193
|
+
.children()
|
|
194
|
+
.children()
|
|
195
|
+
.children()
|
|
196
|
+
.eq(2)
|
|
197
|
+
.children()
|
|
198
|
+
.eq(id)
|
|
199
|
+
.click({ force: true });
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
//Check Url
|
|
203
|
+
Cypress.Commands.add('vCheckUrl', url => {
|
|
204
|
+
cy.url().should('have', url);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
//Check box with id
|
|
208
|
+
Cypress.Commands.add('vCheckboxes', (target, id = 0) => {
|
|
209
|
+
cy.get('[data-cy=checkboxes-' + target + ']')
|
|
210
|
+
.children()
|
|
211
|
+
.eq(id)
|
|
212
|
+
.children()
|
|
213
|
+
.children()
|
|
214
|
+
.children()
|
|
215
|
+
.eq(0)
|
|
216
|
+
.click({ force: true });
|
|
217
|
+
});
|
|
218
|
+
//Check last checkbox
|
|
219
|
+
Cypress.Commands.add('vCheckboxesLast', target => {
|
|
220
|
+
cy.get('[data-cy=checkboxes-' + target + ']')
|
|
221
|
+
.children()
|
|
222
|
+
.eq(-2)
|
|
223
|
+
.children()
|
|
224
|
+
.children()
|
|
225
|
+
.children()
|
|
226
|
+
.eq(0)
|
|
227
|
+
.click({ force: true });
|
|
228
|
+
cy.get('[data-cy=checkboxes-' + target + ']')
|
|
229
|
+
.children()
|
|
230
|
+
.last()
|
|
231
|
+
.type('automated by bot');
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// Get from list
|
|
235
|
+
Cypress.Commands.add('vList', (target, id = 0) => {
|
|
236
|
+
cy.get('[data-cy=list-' + target + ']')
|
|
237
|
+
.children()
|
|
238
|
+
.children()
|
|
239
|
+
.eq(id)
|
|
240
|
+
.children()
|
|
241
|
+
.click({ force: true });
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
Cypress.Commands.add('login',()=>{
|
|
246
|
+
cy.server({
|
|
247
|
+
onAnyRequest: (route, proxy) => {
|
|
248
|
+
proxy.xhr.setRequestHeader("no-captcha", true);
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
cy.visit("/login");
|
|
252
|
+
cy.vTypeEmail("email");
|
|
253
|
+
cy.vClickBtn("submit");
|
|
254
|
+
cy.vType("password", "234234Ab.");
|
|
255
|
+
cy.vClickBtn("submit");
|
|
256
|
+
cy.wait(1000);
|
|
257
|
+
})
|
|
258
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
// ***********************************************************
|
|
3
|
+
// This example support/index.js is processed and
|
|
4
|
+
// loaded automatically before your test files.
|
|
5
|
+
//
|
|
6
|
+
// This is a great place to put global configuration and
|
|
7
|
+
// behavior that modifies Cypress.
|
|
8
|
+
//
|
|
9
|
+
// You can change the location of this file or turn off
|
|
10
|
+
// automatically serving support files with the
|
|
11
|
+
// 'supportFile' configuration option.
|
|
12
|
+
//
|
|
13
|
+
// You can read more here:
|
|
14
|
+
// https://on.cypress.io/configuration
|
|
15
|
+
// ***********************************************************
|
|
16
|
+
|
|
17
|
+
// Import commands.js using ES2015 syntax:
|
|
18
|
+
import './commands';
|
|
19
|
+
import './misc';
|
|
20
|
+
|
|
21
|
+
// Alternatively you can use CommonJS syntax:
|
|
22
|
+
// require('./commands')
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
// beforeEach(()=>{
|
|
26
|
+
// cy.request('POST', 'https://dev-hk-service.usdp.io/bdss/auth-web/api/login',{
|
|
27
|
+
// username: 'aa@aa.aa',
|
|
28
|
+
// pwd:'6aa95819c4b4b093d2e034d52d175164',
|
|
29
|
+
// 'no-captcha': true,
|
|
30
|
+
// }).then(res =>{
|
|
31
|
+
// window.localStorage.setItem('s-token', res.body.data.token);
|
|
32
|
+
// })
|
|
33
|
+
|
|
34
|
+
// // window.localStorage.setItem('s-token', 'hacking420');
|
|
35
|
+
// })
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{{/*
|
|
2
|
+
Expand the name of the chart.
|
|
3
|
+
*/}}
|
|
4
|
+
{{- define "e2e-test-cypress.name" -}}
|
|
5
|
+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
|
6
|
+
{{- end }}
|
|
7
|
+
|
|
8
|
+
{{/*
|
|
9
|
+
Create a default fully qualified app name.
|
|
10
|
+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
11
|
+
If release name contains chart name it will be used as a full name.
|
|
12
|
+
*/}}
|
|
13
|
+
{{- define "e2e-test-cypress.fullname" -}}
|
|
14
|
+
{{- if .Values.fullnameOverride }}
|
|
15
|
+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
|
16
|
+
{{- else }}
|
|
17
|
+
{{- $name := default .Chart.Name .Values.nameOverride }}
|
|
18
|
+
{{- if contains $name .Release.Name }}
|
|
19
|
+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
|
20
|
+
{{- else }}
|
|
21
|
+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
|
22
|
+
{{- end }}
|
|
23
|
+
{{- end }}
|
|
24
|
+
{{- end }}
|
|
25
|
+
|
|
26
|
+
{{/*
|
|
27
|
+
Create chart name and version as used by the chart label.
|
|
28
|
+
*/}}
|
|
29
|
+
{{- define "e2e-test-cypress.chart" -}}
|
|
30
|
+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
|
31
|
+
{{- end }}
|
|
32
|
+
|
|
33
|
+
{{/*
|
|
34
|
+
Common labels
|
|
35
|
+
*/}}
|
|
36
|
+
{{- define "e2e-test-cypress.labels" -}}
|
|
37
|
+
helm.sh/chart: {{ include "e2e-test-cypress.chart" . }}
|
|
38
|
+
{{ include "e2e-test-cypress.selectorLabels" . }}
|
|
39
|
+
{{- if .Chart.AppVersion }}
|
|
40
|
+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
41
|
+
{{- end }}
|
|
42
|
+
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
43
|
+
{{- end }}
|
|
44
|
+
|
|
45
|
+
{{/*
|
|
46
|
+
Selector labels
|
|
47
|
+
*/}}
|
|
48
|
+
{{- define "e2e-test-cypress.selectorLabels" -}}
|
|
49
|
+
app.kubernetes.io/name: {{ include "e2e-test-cypress.name" . }}
|
|
50
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
51
|
+
{{- end }}
|
|
52
|
+
|
|
53
|
+
{{/*
|
|
54
|
+
Create the name of the service account to use
|
|
55
|
+
*/}}
|
|
56
|
+
{{- define "e2e-test-cypress.serviceAccountName" -}}
|
|
57
|
+
{{- if .Values.serviceAccount.create }}
|
|
58
|
+
{{- default (include "e2e-test-cypress.fullname" .) .Values.serviceAccount.name }}
|
|
59
|
+
{{- else }}
|
|
60
|
+
{{- default "default" .Values.serviceAccount.name }}
|
|
61
|
+
{{- end }}
|
|
62
|
+
{{- end }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{- include "root.configmap" $ }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{- include "root.pod" $ }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{- include "root.secret" $ }}
|
package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/values.yaml
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
enabled: false
|
|
2
|
+
kind: Pod
|
|
3
|
+
|
|
4
|
+
annotations:
|
|
5
|
+
"helm.sh/hook-weight": "11"
|
|
6
|
+
"helm.sh/hook": test-success
|
|
7
|
+
|
|
8
|
+
image:
|
|
9
|
+
repository: registry-intl.cn-hongkong.aliyuncs.com/d_mxw/cypress-base
|
|
10
|
+
tag: "0.0.1-rc.0"
|
|
11
|
+
pullPolicy: IfNotPresent
|
|
12
|
+
|
|
13
|
+
restartPolicy: Never
|
|
14
|
+
|
|
15
|
+
# command:
|
|
16
|
+
# - sleep
|
|
17
|
+
# - 365d
|
|
18
|
+
|
|
19
|
+
env:
|
|
20
|
+
CLUSTER_NAMESPACE: "{{CLUSTER_NAMESPACE}}"
|
|
21
|
+
CLUSTER_DOMAIN: "{{CLUSTER_DOMAIN}}"
|
|
22
|
+
CLUSTER_SERVICE_BASE_DOMAIN: "{{CLUSTER_NAMESPACE}}.svc.{{CLUSTER_DOMAIN}}"
|
|
23
|
+
|
|
24
|
+
configFiles:
|
|
25
|
+
- name: fixtures
|
|
26
|
+
files:
|
|
27
|
+
- "cypress/fixtures/*"
|
|
28
|
+
- name: integration
|
|
29
|
+
files:
|
|
30
|
+
- "cypress/integration/*"
|
|
31
|
+
- name: plugins
|
|
32
|
+
files:
|
|
33
|
+
- "cypress/plugins/*"
|
|
34
|
+
- name: support
|
|
35
|
+
files:
|
|
36
|
+
- "cypress/support/*"
|
|
37
|
+
- name: config
|
|
38
|
+
files:
|
|
39
|
+
- "cypress.json"
|
|
40
|
+
|
|
41
|
+
volumeMounts:
|
|
42
|
+
- name: fixtures-volume
|
|
43
|
+
mountPath: /cypress/fixtures
|
|
44
|
+
- name: integration-volume
|
|
45
|
+
mountPath: /cypress/integration
|
|
46
|
+
- name: plugins-volume
|
|
47
|
+
mountPath: /cypress/plugins
|
|
48
|
+
- name: support-volume
|
|
49
|
+
mountPath: /cypress/support
|
|
50
|
+
- name: config-volume
|
|
51
|
+
mountPath: /cypress.json
|
|
52
|
+
subPath: cypress.json
|
|
53
|
+
readOnly: true
|
|
54
|
+
|
|
55
|
+
volumes:
|
|
56
|
+
- name: fixtures-volume
|
|
57
|
+
configMap:
|
|
58
|
+
name: "{{Release.Name}}-{{Chart.Name}}-fixtures"
|
|
59
|
+
- name: integration-volume
|
|
60
|
+
configMap:
|
|
61
|
+
name: "{{Release.Name}}-{{Chart.Name}}-integration"
|
|
62
|
+
- name: plugins-volume
|
|
63
|
+
configMap:
|
|
64
|
+
name: "{{Release.Name}}-{{Chart.Name}}-plugins"
|
|
65
|
+
- name: support-volume
|
|
66
|
+
configMap:
|
|
67
|
+
name: "{{Release.Name}}-{{Chart.Name}}-support"
|
|
68
|
+
- name: config-volume
|
|
69
|
+
configMap:
|
|
70
|
+
name: "{{Release.Name}}-{{Chart.Name}}-config"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
apiVersion: v2
|
|
2
|
+
name: e2e-test-js
|
|
3
|
+
description: End To End Test - JavaScript
|
|
4
|
+
|
|
5
|
+
# A chart can be either an 'application' or a 'library' chart.
|
|
6
|
+
#
|
|
7
|
+
# Application charts are a collection of templates that can be packaged into versioned archives
|
|
8
|
+
# to be deployed.
|
|
9
|
+
#
|
|
10
|
+
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
|
11
|
+
# a dependency of application charts to inject those utilities and functions into the rendering
|
|
12
|
+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
|
13
|
+
type: application
|
|
14
|
+
|
|
15
|
+
# This is the chart version. This version number should be incremented each time you make changes
|
|
16
|
+
# to the chart and its templates, including the app version.
|
|
17
|
+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
|
18
|
+
version: 1.0.0-rc.0
|
|
19
|
+
|
|
20
|
+
# This is the version number of the application being deployed. This version number should be
|
|
21
|
+
# incremented each time you make changes to the application. Versions are not expected to
|
|
22
|
+
# follow Semantic Versioning. They should reflect the version the application is using.
|
|
23
|
+
appVersion: 1.16.0
|
package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/script/Makefile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|
2
|
+
ROOT_PATH := $(shell pwd)
|
|
3
|
+
|
|
4
|
+
.PHONY:
|
|
5
|
+
|
|
6
|
+
start:
|
|
7
|
+
@getent hosts $(SERVICE_BASE_INGRESS) | awk '{ \
|
|
8
|
+
printf("%s %s\n%s %s\n%s %s\n", \
|
|
9
|
+
$$1, ENVIRON["SERVICE_BASE_DOMAIN"], \
|
|
10
|
+
$$1, ENVIRON["MXW_SERVICE_BASE_DOMAIN"], \
|
|
11
|
+
$$1, ENVIRON["EMAIL_SERVER_DOMAIN"] \
|
|
12
|
+
); \
|
|
13
|
+
}' >> /etc/hosts
|
|
14
|
+
@npm -s run test
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{{/*
|
|
2
|
+
Expand the name of the chart.
|
|
3
|
+
*/}}
|
|
4
|
+
{{- define "e2e-test-js.name" -}}
|
|
5
|
+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
|
6
|
+
{{- end }}
|
|
7
|
+
|
|
8
|
+
{{/*
|
|
9
|
+
Create a default fully qualified app name.
|
|
10
|
+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
11
|
+
If release name contains chart name it will be used as a full name.
|
|
12
|
+
*/}}
|
|
13
|
+
{{- define "e2e-test-js.fullname" -}}
|
|
14
|
+
{{- if .Values.fullnameOverride }}
|
|
15
|
+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
|
16
|
+
{{- else }}
|
|
17
|
+
{{- $name := default .Chart.Name .Values.nameOverride }}
|
|
18
|
+
{{- if contains $name .Release.Name }}
|
|
19
|
+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
|
20
|
+
{{- else }}
|
|
21
|
+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
|
22
|
+
{{- end }}
|
|
23
|
+
{{- end }}
|
|
24
|
+
{{- end }}
|
|
25
|
+
|
|
26
|
+
{{/*
|
|
27
|
+
Create chart name and version as used by the chart label.
|
|
28
|
+
*/}}
|
|
29
|
+
{{- define "e2e-test-js.chart" -}}
|
|
30
|
+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
|
31
|
+
{{- end }}
|
|
32
|
+
|
|
33
|
+
{{/*
|
|
34
|
+
Common labels
|
|
35
|
+
*/}}
|
|
36
|
+
{{- define "e2e-test-js.labels" -}}
|
|
37
|
+
helm.sh/chart: {{ include "e2e-test-js.chart" . }}
|
|
38
|
+
{{ include "e2e-test-js.selectorLabels" . }}
|
|
39
|
+
{{- if .Chart.AppVersion }}
|
|
40
|
+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
41
|
+
{{- end }}
|
|
42
|
+
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
43
|
+
{{- end }}
|
|
44
|
+
|
|
45
|
+
{{/*
|
|
46
|
+
Selector labels
|
|
47
|
+
*/}}
|
|
48
|
+
{{- define "e2e-test-js.selectorLabels" -}}
|
|
49
|
+
app.kubernetes.io/name: {{ include "e2e-test-js.name" . }}
|
|
50
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
51
|
+
{{- end }}
|
|
52
|
+
|
|
53
|
+
{{/*
|
|
54
|
+
Create the name of the service account to use
|
|
55
|
+
*/}}
|
|
56
|
+
{{- define "e2e-test-js.serviceAccountName" -}}
|
|
57
|
+
{{- if .Values.serviceAccount.create }}
|
|
58
|
+
{{- default (include "e2e-test-js.fullname" .) .Values.serviceAccount.name }}
|
|
59
|
+
{{- else }}
|
|
60
|
+
{{- default "default" .Values.serviceAccount.name }}
|
|
61
|
+
{{- end }}
|
|
62
|
+
{{- end }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{- include "root.configmap" $ }}
|
package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/pod.yaml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{- include "root.pod" $ }}
|
package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/templates/secret.yaml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{- include "root.secret" $ }}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import { describe, it } from 'mocha';
|
|
4
|
+
import chai, { expect } from 'chai';
|
|
5
|
+
import chaihttp from 'chai-http';
|
|
6
|
+
|
|
7
|
+
chai.use(chaihttp);
|
|
8
|
+
|
|
9
|
+
let debug = (process.env.CI_DEBUG === "true");
|
|
10
|
+
|
|
11
|
+
describe('Suite: Initialize', function () {
|
|
12
|
+
if (debug) {
|
|
13
|
+
process.env.SERVICE_BASE_SCHEMA = "https";
|
|
14
|
+
process.env.SERVICE_BASE_DOMAIN = "dev-hk-service.usdp.io";
|
|
15
|
+
process.env.SERVICE_BASE_NAME = "bdss";
|
|
16
|
+
|
|
17
|
+
process.env.MXW_SERVICE_BASE_SCHEMA = "https";
|
|
18
|
+
process.env.MXW_SERVICE_BASE_DOMAIN = "dev-hk-service.usdp.io";
|
|
19
|
+
process.env.MXW_SERVICE_BASE_NAME = "mxw";
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe('Suite: Readiness & Liveness', function () {
|
|
24
|
+
let services: {
|
|
25
|
+
title: string,
|
|
26
|
+
name: string,
|
|
27
|
+
resolve: Function,
|
|
28
|
+
path: string
|
|
29
|
+
}[] = [
|
|
30
|
+
{ title: "Auth", name: "auth-api", resolve: serviceUrl, path: "/auth/api" },
|
|
31
|
+
{ title: "Auth Web", name: "auth-web-api", resolve: serviceUrl, path: "" },
|
|
32
|
+
{ title: "Captcha", name: "captcha-api", resolve: serviceUrl, path: "/auth-web/api" },
|
|
33
|
+
{ title: "NFS Storage", name: "nfs-storage-api", resolve: serviceUrl, path: "/nfs/storage/api" },
|
|
34
|
+
{ title: "Storage Doc", name: "storage-doc-api", resolve: serviceUrl, path: "/storage/local/doc/api" },
|
|
35
|
+
{ title: "Storage Doc Auth", name: "storage-doc-auth-api", resolve: serviceUrl, path: "" },
|
|
36
|
+
{ title: "Storage Public", name: "storage-pub-api", resolve: serviceUrl, path: "/storage/local/pub/api" },
|
|
37
|
+
{ title: "Storage Public Auth", name: "storage-pub-auth-api", resolve: serviceUrl, path: "" },
|
|
38
|
+
{ title: "RT", name: "rt-api", resolve: serviceUrl, path: "/rt" },
|
|
39
|
+
{ title: "RT Gateway", name: "rt-gateway-api", resolve: serviceUrl, path: "" },
|
|
40
|
+
{ title: "Push Notify App Firebase", name: "push-notify-app-firebase-api", resolve: serviceUrl, path: "/notify/firebase/push-service" },
|
|
41
|
+
{ title: "Push Notify Firebase", name: "push-notify-firebase-api", resolve: serviceUrl, path: "" },
|
|
42
|
+
|
|
43
|
+
{ title: "Contract", name: "contract-api", resolve: serviceUrl, path: "/contract/api" },
|
|
44
|
+
{ title: "Signature", name: "signature-api", resolve: serviceUrl, path: "/signature/api" },
|
|
45
|
+
{ title: "User", name: "user-api", resolve: serviceUrl, path: "/user/api" },
|
|
46
|
+
{ title: "Workflow", name: "workflow-api", resolve: serviceUrl, path: "" },
|
|
47
|
+
{ title: "Object", name: "dms-object-api", resolve: serviceUrl, path: "/object/api" },
|
|
48
|
+
|
|
49
|
+
{ title: "KYC Provider", name: "mxw-kyc-provider-api", resolve: mxwServiceUrl, path: "/provider/kyc/v2" },
|
|
50
|
+
{ title: "Wallet", name: "mxw-wallet-api", resolve: mxwServiceUrl, path: "/wallet/api" }
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
for (let service of services) {
|
|
54
|
+
it(service.title + " - " + service.name, function () {
|
|
55
|
+
let url = service.resolve(service.name, service.path);
|
|
56
|
+
|
|
57
|
+
if (url) {
|
|
58
|
+
return chai.request(url).get("/readiness")
|
|
59
|
+
.then((res) => {
|
|
60
|
+
expect(res).to.have.status(200);
|
|
61
|
+
expect(res.body).is.empty;
|
|
62
|
+
|
|
63
|
+
return chai.request(url).get("/liveness")
|
|
64
|
+
.then((res) => {
|
|
65
|
+
expect(res).to.have.status(200);
|
|
66
|
+
expect(res.body).is.empty;
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
function serviceUrl(name: string, path: string) {
|
|
75
|
+
if (path) {
|
|
76
|
+
return process.env.SERVICE_BASE_SCHEMA + "://" + process.env.SERVICE_BASE_DOMAIN + "/" + process.env.SERVICE_BASE_NAME + path;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function mxwServiceUrl(name: string, path: string) {
|
|
81
|
+
if (path) {
|
|
82
|
+
return process.env.MXW_SERVICE_BASE_SCHEMA + "://" + process.env.MXW_SERVICE_BASE_DOMAIN + "/" + process.env.MXW_SERVICE_BASE_NAME + path;
|
|
83
|
+
}
|
|
84
|
+
}
|