mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-12-06 08:16:51 +00:00
Tweaks to cypress suite
All checks were successful
Close stale issues and PRs / stale (push) Successful in 20s
All checks were successful
Close stale issues and PRs / stale (push) Successful in 20s
This commit is contained in:
@@ -22,7 +22,25 @@ Cypress.Commands.add('randomString', (length) => {
|
||||
});
|
||||
|
||||
/**
|
||||
* Check the swagger schema:
|
||||
* Check the swagger schema file:
|
||||
*
|
||||
* @param {string} url
|
||||
* @param {string} savePath
|
||||
*/
|
||||
Cypress.Commands.add("validateSwaggerFile", (url, savePath) => {
|
||||
cy.task('log', `validateSwaggerFile: ${url} -- ${savePath}`)
|
||||
.then(() => {
|
||||
return cy
|
||||
.request(url)
|
||||
.then((response) => cy.writeFile(savePath, response.body, { log: false }))
|
||||
.then(() => cy.exec(`yarn swagger-lint '${savePath}'`, { failOnNonZeroExit: false }))
|
||||
.then((result) => cy.task('log', `Swagger Vacuum Results:\n${result.stdout || ''}`)
|
||||
.then(() => expect(result.code).to.eq(0)));
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Check the swagger schema for a specific endpoint:
|
||||
*
|
||||
* @param {string} method API Method in swagger doc, "get", "put", "post", "delete"
|
||||
* @param {integer} code Swagger doc endpoint response code, exactly as defined in swagger doc
|
||||
|
||||
Reference in New Issue
Block a user