diff --git a/Jenkinsfile b/Jenkinsfile
index 7575794..9b29ee9 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -127,6 +127,11 @@ pipeline {
junit 'test/results/junit/*'
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
}
+ unstable {
+ dir(path: 'testing/results') {
+ archiveArtifacts(allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml')
+ }
+ }
}
}
stage('Test Mysql') {
@@ -155,6 +160,11 @@ pipeline {
junit 'test/results/junit/*'
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
}
+ unstable {
+ dir(path: 'testing/results') {
+ archiveArtifacts(allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml')
+ }
+ }
}
}
stage('MultiArch Build') {
diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml
index 4cdb1e9..e7f9bcb 100644
--- a/docker/docker-compose.dev.yml
+++ b/docker/docker-compose.dev.yml
@@ -1,7 +1,7 @@
# WARNING: This is a DEVELOPMENT docker-compose file, it should not be used for production.
services:
- npm:
+ fullstack:
image: nginxproxymanager:dev
container_name: npm_core
build:
@@ -67,7 +67,7 @@ services:
URL: "http://npm:81/api/schema"
PORT: '80'
depends_on:
- - npm
+ - fullstack
squid:
image: ubuntu/squid
diff --git a/test/cypress/config/ci.js b/test/cypress/config/ci.js
index 873330d..dc968db 100644
--- a/test/cypress/config/ci.js
+++ b/test/cypress/config/ci.js
@@ -15,7 +15,7 @@ module.exports = defineConfig({
return require("../plugins/index.js")(on, config);
},
env: {
- swaggerBase: 'http://fullstack:81/api/schema',
+ swaggerBase: '{{baseUrl}}/api/schema?ts=' + Date.now(),
},
baseUrl: 'http://fullstack:81',
}
diff --git a/test/cypress/config/dev.js b/test/cypress/config/dev.js
deleted file mode 100644
index f3c9f6d..0000000
--- a/test/cypress/config/dev.js
+++ /dev/null
@@ -1,22 +0,0 @@
-const { defineConfig } = require('cypress');
-
-module.exports = defineConfig({
- requestTimeout: 30000,
- defaultCommandTimeout: 20000,
- reporter: 'cypress-multi-reporters',
- reporterOptions: {
- configFile: 'multi-reporter.json'
- },
- video: false,
- videosFolder: 'results/videos',
- screenshotsFolder: 'results/screenshots',
- e2e: {
- setupNodeEvents(on, config) {
- return require("../plugins/index.js")(on, config);
- },
- env: {
- swaggerBase: 'http://npm:81/api/schema',
- },
- baseUrl: 'http://npm:81',
- }
-});
diff --git a/test/cypress/e2e/api/Certificates.cy.js b/test/cypress/e2e/api/Certificates.cy.js
index 687d09e..1e8a6fe 100644
--- a/test/cypress/e2e/api/Certificates.cy.js
+++ b/test/cypress/e2e/api/Certificates.cy.js
@@ -1,4 +1,4 @@
-///
+///
describe('Certificates endpoints', () => {
let token;
@@ -26,6 +26,7 @@ describe('Certificates endpoints', () => {
});
it('Custom certificate lifecycle', function() {
+ // Create custom cert
cy.task('backendApiPost', {
token: token,
path: '/api/nginx/certificates',
@@ -38,6 +39,7 @@ describe('Certificates endpoints', () => {
expect(data).to.have.property('id');
certID = data.id;
+ // Upload files
cy.task('backendApiPostFiles', {
token: token,
path: `/api/nginx/certificates/${certID}/upload`,
@@ -46,31 +48,31 @@ describe('Certificates endpoints', () => {
certificate_key: 'test.example.com-key.pem',
},
}).then((data) => {
- cy.validateSwaggerSchema('post', 201, '/nginx/certificates/upload', data);
+ cy.validateSwaggerSchema('post', 200, '/nginx/certificates/{certID}/upload', data);
expect(data).to.have.property('certificate');
expect(data).to.have.property('certificate_key');
- cy.task('backendApiDelete', {
+ // Get all certs
+ cy.task('backendApiGet', {
token: token,
- path: `/api/nginx/certificates/${certID}`
+ path: '/api/nginx/certificates?expand=owner'
}).then((data) => {
- cy.validateSwaggerSchema('delete', 200, '/nginx/certificates/{certID}', data);
- expect(data).to.be.equal(true);
+ cy.validateSwaggerSchema('get', 200, '/nginx/certificates', data);
+ expect(data.length).to.be.greaterThan(0);
+
+ // Delete cert
+ cy.task('backendApiDelete', {
+ token: token,
+ path: `/api/nginx/certificates/${certID}`
+ }).then((data) => {
+ cy.validateSwaggerSchema('delete', 200, '/nginx/certificates/{certID}', data);
+ expect(data).to.be.equal(true);
+ });
});
});
});
});
- it('Should be able to get all certs', function() {
- cy.task('backendApiGet', {
- token: token,
- path: '/api/nginx/certificates?expand=owner'
- }).then((data) => {
- cy.validateSwaggerSchema('get', 200, '/nginx/certificates', data);
- expect(data.length).to.be.greaterThan(0);
- });
- });
-
it('Request Certificate - CVE-2024-46256/CVE-2024-46257', function() {
cy.task('backendApiPost', {
token: token,
diff --git a/test/cypress/e2e/api/Health.cy.js b/test/cypress/e2e/api/Health.cy.js
index f765c99..49881e9 100644
--- a/test/cypress/e2e/api/Health.cy.js
+++ b/test/cypress/e2e/api/Health.cy.js
@@ -1,4 +1,4 @@
-///
+///
describe('Basic API checks', () => {
it('Should return a valid health payload', function () {
@@ -12,7 +12,7 @@ describe('Basic API checks', () => {
it('Should return a valid schema payload', function () {
cy.task('backendApiGet', {
- path: '/api/schema',
+ path: '/api/schema?ts=' + Date.now(),
}).then((data) => {
expect(data.openapi).to.be.equal('3.1.0');
});
diff --git a/test/cypress/e2e/api/Hosts.cy.js b/test/cypress/e2e/api/Hosts.cy.js
index 62b9581..75d732c 100644
--- a/test/cypress/e2e/api/Hosts.cy.js
+++ b/test/cypress/e2e/api/Hosts.cy.js
@@ -1,4 +1,4 @@
-///
+///
describe('Hosts endpoints', () => {
let token;
diff --git a/test/cypress/e2e/api/Users.cy.js b/test/cypress/e2e/api/Users.cy.js
index 43303d4..06b1831 100644
--- a/test/cypress/e2e/api/Users.cy.js
+++ b/test/cypress/e2e/api/Users.cy.js
@@ -1,4 +1,4 @@
-///
+///
describe('Users endpoints', () => {
let token;
diff --git a/test/cypress/plugins/backendApi/client.js b/test/cypress/plugins/backendApi/client.js
index e7c0c43..ba28e3a 100644
--- a/test/cypress/plugins/backendApi/client.js
+++ b/test/cypress/plugins/backendApi/client.js
@@ -80,7 +80,7 @@ BackendApi.prototype._handleError = function(err, resolve, reject, returnOnError
* @returns {Promise