mirror of
				https://github.com/NginxProxyManager/nginx-proxy-manager.git
				synced 2025-11-04 09:25:15 +00:00 
			
		
		
		
	Cypress fixes
This commit is contained in:
		@@ -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: "admin@example.com",
 | 
			
		||||
			secret: "changeme"
 | 
			
		||||
			identity: 'admin@example.com',
 | 
			
		||||
			secret:   'changeme'
 | 
			
		||||
		}
 | 
			
		||||
	}).then(res => {
 | 
			
		||||
		cy.wrap(res.result.token);
 | 
			
		||||
		cy.wrap(res.token);
 | 
			
		||||
	});
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user