Этот коммит содержится в:
Mario Vitale
2023-03-27 16:28:42 +02:00
родитель da7a6825ce
Коммит ba6b97fb62
1142 изменённых файлов: 44 добавлений и 44 удалений

Просмотреть файл

@@ -0,0 +1,35 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// *****************************************************************************
// Webhooks
// https://api.mattermost.com/#tag/webhooks
// *****************************************************************************
Cypress.Commands.add('apiGetIncomingWebhook', (hookId) => {
const options = {
url: `api/v4/hooks/incoming/${hookId}`,
headers: {'X-Requested-With': 'XMLHttpRequest'},
method: 'GET',
failOnStatusCode: false,
};
return cy.request(options).then((response) => {
const {body, status} = response;
return cy.wrap({webhook: body, status});
});
});
Cypress.Commands.add('apiGetOutgoingWebhook', (hookId) => {
const options = {
url: `api/v4/hooks/outgoing/${hookId}`,
headers: {'X-Requested-With': 'XMLHttpRequest'},
method: 'GET',
failOnStatusCode: false,
};
return cy.request(options).then((response) => {
const {body, status} = response;
return cy.wrap({webhook: body, status});
});
});