|
@@ -13,15 +13,16 @@
|
|
|
* Check the swagger schema:
|
|
|
*
|
|
|
* @param {string} method API Method in swagger doc, "get", "put", "post", "delete"
|
|
|
+ * @param {number} statusCode API status code in swagger doc
|
|
|
* @param {string} path Swagger doc endpoint path, exactly as defined in swagger doc
|
|
|
* @param {*} data The API response data to check against the swagger schema
|
|
|
*/
|
|
|
-Cypress.Commands.add('validateSwaggerSchema', (method, path, data) => {
|
|
|
+Cypress.Commands.add('validateSwaggerSchema', (method, statusCode, path, data) => {
|
|
|
cy.task('validateSwaggerSchema', {
|
|
|
file: Cypress.env('swaggerBase'),
|
|
|
endpoint: path,
|
|
|
method: method,
|
|
|
- statusCode: 200,
|
|
|
+ statusCode: statusCode,
|
|
|
responseSchema: data,
|
|
|
verbose: true
|
|
|
}).should('equal', null);
|
|
@@ -32,10 +33,10 @@ Cypress.Commands.add('getToken', () => {
|
|
|
cy.task('backendApiPost', {
|
|
|
path: '/api/tokens',
|
|
|
data: {
|
|
|
- identity: "[email protected]",
|
|
|
- secret: "changeme"
|
|
|
+ identity: '[email protected]',
|
|
|
+ secret: 'changeme'
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- cy.wrap(res.result.token);
|
|
|
+ cy.wrap(res.token);
|
|
|
});
|
|
|
});
|