From 86c5438dee5c9e5c37e69f771d7064854339e31d Mon Sep 17 00:00:00 2001 From: Vladimir Lebedev Date: Mon, 16 Dec 2019 09:19:26 +0300 Subject: [PATCH] MM-20339 add E2E for "Can change Enable Custom Branding setting" (#4391) * MM-20339 add E2E for "Can change Enable Custom Branding setting" * fix current issues * make sure test have right initial setup * fix the indentation * Fixing wrongly added spaces on resolve conflict --- .../ui_and_api/customization_spec.js | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/e2e/cypress/integration/system_console/ui_and_api/customization_spec.js b/e2e/cypress/integration/system_console/ui_and_api/customization_spec.js index 9edfd7907983..2215e118fc85 100644 --- a/e2e/cypress/integration/system_console/ui_and_api/customization_spec.js +++ b/e2e/cypress/integration/system_console/ui_and_api/customization_spec.js @@ -24,6 +24,7 @@ describe('Customization', () => { }, TeamSettings: { SiteName: config.TeamSettings.SiteName, + EnableCustomBrand: config.TeamSettings.EnableCustomBrand, }, NativeAppSettings: { AppDownloadLink: config.NativeAppSettings.AppDownloadLink, @@ -305,4 +306,41 @@ describe('Customization', () => { expect(config.SupportSettings.TermsOfServiceLink).to.eq(newValue); }); }); + + it('SC20339 - Can change Enable Custom Branding setting', () => { + // # Make sure necessary field is false + cy.apiUpdateConfigBasic({TeamSettings: {EnableCustomBrand: false}}); + cy.reload(); + + cy.findByTestId('TeamSettings.EnableCustomBrand').should('be.visible').within(() => { + // * Verify that setting is visible and matches text content + cy.get('label:first').should('be.visible').and('have.text', 'Enable Custom Branding: '); + + // * Verify that help setting is visible and matches text content + const content = 'Enable custom branding to show an image of your choice, uploaded below, and some help text, written below, on the login page.'; + cy.get('.help-text').should('be.visible').and('have.text', content); + + // # Set Enable Custom Branding to true + cy.findByTestId('TeamSettings.EnableCustomBrandtrue').check(); + }); + + // # Click Save button + cy.get('#saveSetting').click(); + + // * Verify that the value is save, directly via REST API + cy.apiGetConfig().then((response) => { + expect(response.body.TeamSettings.EnableCustomBrand).to.equal(true); + }); + + // # Set Enable Custom Branding to false + cy.findByTestId('TeamSettings.EnableCustomBrandfalse').check(); + + // # Click Save button + cy.get('#saveSetting').click(); + + // * Verify that the value is save, directly via REST API + cy.apiGetConfig().then((response) => { + expect(response.body.TeamSettings.EnableCustomBrand).to.equal(false); + }); + }); });