Unverified Commit 7fabd71a authored by Saturnino Abril's avatar Saturnino Abril Committed by GitHub
Browse files

MM-26075 Standardize Cypress custom commands for "api/system" (#5888)

Automatic Merge
parent fd5dd7c8
......@@ -87,8 +87,8 @@ describe('Verify Accessibility Support in Dropdown Menus', () => {
cy.focused().tab();
// * Verify the accessibility support in the Main Menu Dropdown items
cy.apiGetConfig().then((response) => {
const siteName = response.body.TeamSettings.SiteName;
cy.apiGetConfig().then(({config}) => {
const siteName = config.TeamSettings.SiteName;
const labels = ['Account Settings dialog', 'Invite People dialog', 'Team Settings dialog', 'Manage Members dialog', '', 'Leave Team dialog', '', 'Plugin Marketplace dialog', '', '', '', '', '', `About ${siteName} dialog`, ''];
verifyMenuItems('#sidebarDropdownMenu', labels);
});
......
......@@ -56,7 +56,7 @@ describe('Verify Accessibility Support in different input fields', () => {
before(() => {
// * Check if server has license for Guest Accounts
cy.requireLicenseForFeature('GuestAccounts');
cy.apiRequireLicenseForFeature('GuestAccounts');
cy.apiInitSetup().then(({team}) => {
testTeam = team;
......
......@@ -39,7 +39,7 @@ describe('Verify Accessibility Support in Modals & Dialogs', () => {
before(() => {
// * Check if server has license for Guest Accounts
cy.requireLicenseForFeature('GuestAccounts');
cy.apiRequireLicenseForFeature('GuestAccounts');
cy.apiInitSetup().then(({team, channel, user}) => {
testTeam = team;
......
......@@ -18,7 +18,7 @@ describe('channel groups', () => {
let teamName;
before(() => {
cy.requireLicenseForFeature('LDAP');
cy.apiRequireLicenseForFeature('LDAP');
// # Link 2 groups
cy.apiGetLDAPGroups().then((result) => {
......
......@@ -26,8 +26,8 @@ describe('Email notification', () => {
cy.apiEmailTest();
// # Get config
cy.apiGetConfig().then((response) => {
config = response.body;
cy.apiGetConfig().then((data) => {
({config} = data);
});
cy.apiInitSetup().then(({team, user}) => {
......
......@@ -24,7 +24,7 @@ describe('Autocomplete with Elasticsearch - Channel', () => {
before(() => {
// * Check if server has license for Elasticsearch
cy.requireLicenseForFeature('Elasticsearch');
cy.apiRequireLicenseForFeature('Elasticsearch');
// # Enable Elasticsearch
enableElasticSearch();
......
......@@ -23,7 +23,7 @@ describe('Autocomplete with Elasticsearch - Renaming', () => {
before(() => {
// * Check if server has license for Elasticsearch
cy.requireLicenseForFeature('Elasticsearch');
cy.apiRequireLicenseForFeature('Elasticsearch');
// # Create new team for tests
cy.apiCreateTeam(`elastic-${timestamp}`, `elastic-${timestamp}`).then(({team}) => {
......
......@@ -15,7 +15,7 @@ import * as TIMEOUTS from '../../../fixtures/timeouts';
describe('Elasticsearch system console', () => {
before(() => {
// * Check if server has license for Elasticsearch
cy.requireLicenseForFeature('Elasticsearch');
cy.apiRequireLicenseForFeature('Elasticsearch');
// # Enable Elasticsearch
cy.apiUpdateConfig({
......@@ -93,8 +93,7 @@ describe('Elasticsearch system console', () => {
cy.get('#saveSetting').click();
// * Get config from API and verify that EnableAutocomplete setting is false
cy.apiGetConfig().then((configResponse) => {
const config = configResponse.body;
cy.apiGetConfig().then(({config}) => {
expect(config.ElasticsearchSettings.EnableAutocomplete).to.be.false;
});
});
......
......@@ -18,7 +18,7 @@ describe('Autocomplete with Elasticsearch - Users', () => {
before(() => {
// * Check if server has license for Elasticsearch
cy.requireLicenseForFeature('Elasticsearch');
cy.apiRequireLicenseForFeature('Elasticsearch');
// # Create new team for tests
cy.apiCreateTeam(`elastic-${timestamp}`, `elastic-${timestamp}`).then(({team}) => {
......
......@@ -20,7 +20,7 @@ describe('MM-T2575 Extend Session - Email Login', () => {
before(() => {
// # Check if with license and has matching database
cy.requireLicense();
cy.apiRequireLicense();
cy.requireServerDBToMatch();
cy.apiInitSetup().then(({team, user}) => {
......
......@@ -43,7 +43,7 @@ const saveConfig = (waitUntilConfigSaved = true, clickConfirmationButton = false
describe('MM-T2574 Session Lengths', () => {
before(() => {
cy.requireLicense();
cy.apiRequireLicense();
goToSessionLengths();
});
......@@ -73,8 +73,8 @@ describe('MM-T2574 Session Lengths', () => {
cy.get('#sessionIdleTimeoutInMinutes').should('have.value', '43201');
});
it('Setting "Session Cache (minutes)" should be saved in the server configuration', () => {
cy.apiGetConfig().then((response) => {
const setting = response.body.ServiceSettings.SessionIdleTimeoutInMinutes;
cy.apiGetConfig().then(({config}) => {
const setting = config.ServiceSettings.SessionIdleTimeoutInMinutes;
expect(setting).to.equal(43201);
});
});
......
......@@ -31,7 +31,7 @@ describe('Guest Account - Guest User Experience', () => {
before(() => {
// * Check if server has license for Guest Accounts
cy.requireLicenseForFeature('GuestAccounts');
cy.apiRequireLicenseForFeature('GuestAccounts');
// # Enable Guest Account Settings
cy.apiUpdateConfig({
......
......@@ -22,7 +22,7 @@ describe('MM-18045 Verify Guest User Identification in different screens', () =>
before(() => {
// * Check if server has license for Guest Accounts
cy.requireLicenseForFeature('GuestAccounts');
cy.apiRequireLicenseForFeature('GuestAccounts');
// # Enable Guest Account Settings
cy.apiUpdateConfig({
......
......@@ -111,7 +111,7 @@ describe('Guest Account - Guest User Invitation Flow', () => {
before(() => {
// * Check if server has license for Guest Accounts
cy.requireLicenseForFeature('GuestAccounts');
cy.apiRequireLicenseForFeature('GuestAccounts');
});
beforeEach(() => {
......
......@@ -44,7 +44,7 @@ describe('Guest Account - Guest User Removal Experience', () => {
before(() => {
// * Check if server has license for Guest Accounts
cy.requireLicenseForFeature('GuestAccounts');
cy.apiRequireLicenseForFeature('GuestAccounts');
cy.apiInitSetup().then(({team}) => {
team1 = team;
......
......@@ -88,7 +88,7 @@ describe('Guest Account - Member Invitation Flow', () => {
beforeEach(() => {
// * Check if server has license for Guest Accounts
cy.requireLicenseForFeature('GuestAccounts');
cy.apiRequireLicenseForFeature('GuestAccounts');
// # Enable Guest Account Settings
cy.apiUpdateConfig({
......
......@@ -17,7 +17,7 @@
describe('Guest Account - Verify Guest Access UI', () => {
beforeEach(() => {
// * Check if server has license for Guest Accounts
cy.requireLicenseForFeature('GuestAccounts');
cy.apiRequireLicenseForFeature('GuestAccounts');
// # Enable Guest Account Settings
cy.apiUpdateConfig({
......
......@@ -31,7 +31,7 @@ describe('Guest Account - Verify Manage Guest Users', () => {
before(() => {
// * Check if server has license for Guest Accounts
cy.requireLicenseForFeature('GuestAccounts');
cy.apiRequireLicenseForFeature('GuestAccounts');
// # Enable Guest Account Settings
cy.apiUpdateConfig({
......
......@@ -34,10 +34,10 @@ context('ldap', () => {
describe('LDAP Login flow - Admin Login', () => {
before(() => {
// * Check if server has license for LDAP
cy.requireLicenseForFeature('LDAP');
cy.apiRequireLicenseForFeature('LDAP');
cy.apiGetConfig().then((response) => {
testSettings = setLDAPTestSettings(response.body);
cy.apiGetConfig().then(({config}) => {
testSettings = setLDAPTestSettings(config);
});
});
......
......@@ -15,7 +15,7 @@ describe('Test channel public/private toggle', () => {
before(() => {
// * Check if server has license for LDAP Groups
cy.requireLicenseForFeature('LDAPGroups');
cy.apiRequireLicenseForFeature('LDAPGroups');
// Enable LDAP and LDAP group sync
cy.apiUpdateConfig({
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment