Move /e2e -> /e2e-tests
Этот коммит содержится в:
50
e2e-tests/cypress/tests/support/api/ldap.js
Обычный файл
50
e2e-tests/cypress/tests/support/api/ldap.js
Обычный файл
@@ -0,0 +1,50 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
// *****************************************************************************
|
||||
// LDAP
|
||||
// https://api.mattermost.com/#tag/LDAP
|
||||
// *****************************************************************************
|
||||
|
||||
Cypress.Commands.add('apiLDAPSync', () => {
|
||||
return cy.request({
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
url: '/api/v4/ldap/sync',
|
||||
method: 'POST',
|
||||
}).then((response) => {
|
||||
expect(response.status).to.equal(200);
|
||||
return cy.wrap(response);
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('apiLDAPTest', () => {
|
||||
return cy.request({
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
url: '/api/v4/ldap/test',
|
||||
method: 'POST',
|
||||
}).then((response) => {
|
||||
expect(response.status).to.equal(200);
|
||||
return cy.wrap(response);
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('apiSyncLDAPUser', ({
|
||||
ldapUser = {},
|
||||
bypassTutorial = true,
|
||||
}) => {
|
||||
// # Test LDAP connection and synchronize user
|
||||
cy.apiLDAPTest();
|
||||
cy.apiLDAPSync();
|
||||
|
||||
// # Login to sync LDAP user
|
||||
return cy.apiLogin(ldapUser).then(({user}) => {
|
||||
if (bypassTutorial) {
|
||||
cy.apiAdminLogin();
|
||||
}
|
||||
if (bypassTutorial) {
|
||||
cy.apiSaveTutorialStep(user.id, '999');
|
||||
}
|
||||
|
||||
return cy.wrap(user);
|
||||
});
|
||||
});
|
||||
Ссылка в новой задаче
Block a user