snapshot of https://github.com/mattermost/mattermost.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Nightly Race / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 1s
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Nightly Race / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 1s
This commit is contained in:
@@ -0,0 +1,156 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
// ***************************************************************
|
||||
// - [#] indicates a test step (e.g. # Go to a page)
|
||||
// - [*] indicates an assertion (e.g. * Check the title)
|
||||
// - Use element ID when selecting an element. Create one if none.
|
||||
// ***************************************************************
|
||||
|
||||
// Stage: @prod
|
||||
// Group: @channels @enterprise @system_console
|
||||
|
||||
import * as TIMEOUTS from '@/fixtures/timeouts';
|
||||
import {hexToRgbArray, rgbArrayToString} from '@/utils';
|
||||
|
||||
describe('System Console OpenId Connect', () => {
|
||||
const FAKE_SETTING = '********************************';
|
||||
const SERVICE_PROVIDER_LABEL = 'Select service provider:';
|
||||
const DISCOVERY_ENDPOINT_LABEL = 'Discovery Endpoint:';
|
||||
const CLIENT_ID_LABEL = 'Client ID:';
|
||||
const CLIENT_SECRET_LABEL = 'Client Secret:';
|
||||
const OPENID_LINK_NAME = 'OpenID Connect';
|
||||
const SAVE_BUTTON_NAME = 'Save';
|
||||
|
||||
before(() => {
|
||||
// * Check if server has license
|
||||
cy.apiRequireLicense();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
// # Go to the System Scheme page as System Admin
|
||||
cy.apiAdminLogin();
|
||||
cy.visit('/admin_console');
|
||||
});
|
||||
|
||||
it('MM-T3623 - Set to Generic OpenId', () => {
|
||||
cy.findByRole('link', {name: OPENID_LINK_NAME}).click();
|
||||
|
||||
// # Click the OpenId header dropdown
|
||||
cy.wait(TIMEOUTS.FIVE_SEC);
|
||||
|
||||
cy.findByLabelText(SERVICE_PROVIDER_LABEL).select('openid').wait(TIMEOUTS.ONE_SEC);
|
||||
|
||||
cy.findByLabelText('Button Name:').clear().type('TestButtonTest');
|
||||
|
||||
cy.get('#OpenIdSettings\\.ButtonColor-inputColorValue').clear().type('#c02222');
|
||||
|
||||
cy.findByLabelText(DISCOVERY_ENDPOINT_LABEL).clear().type('http://test.com/.well-known/openid-configuration');
|
||||
cy.findByLabelText(CLIENT_ID_LABEL).clear().type('OpenIdId');
|
||||
cy.findByLabelText(CLIENT_SECRET_LABEL).clear().type('OpenIdSecret');
|
||||
|
||||
cy.findByRole('button', {name: SAVE_BUTTON_NAME}).click().wait(TIMEOUTS.ONE_SEC);
|
||||
|
||||
// * Get config from API
|
||||
cy.apiGetConfig().then(({config}) => {
|
||||
expect(config.OpenIdSettings.Secret).to.equal(FAKE_SETTING);
|
||||
expect(config.OpenIdSettings.Id).to.equal('OpenIdId');
|
||||
expect(config.OpenIdSettings.DiscoveryEndpoint).to.equal('http://test.com/.well-known/openid-configuration');
|
||||
});
|
||||
|
||||
verifyOAuthLogin('TestButtonTest', '#c02222', Cypress.config('baseUrl') + '/oauth/openid/login');
|
||||
});
|
||||
|
||||
it('MM-T3620 - Set to Google OpenId', () => {
|
||||
cy.findByRole('link', {name: OPENID_LINK_NAME}).click();
|
||||
|
||||
// # Click the OpenId header dropdown
|
||||
cy.wait(TIMEOUTS.FIVE_SEC);
|
||||
|
||||
cy.findByLabelText(SERVICE_PROVIDER_LABEL).select('google').wait(TIMEOUTS.ONE_SEC);
|
||||
|
||||
cy.findByLabelText(CLIENT_ID_LABEL).clear().type('GoogleId');
|
||||
cy.findByLabelText(CLIENT_SECRET_LABEL).clear().type('GoogleSecret');
|
||||
|
||||
cy.findByRole('button', {name: SAVE_BUTTON_NAME}).click().wait(TIMEOUTS.ONE_SEC);
|
||||
|
||||
// * Get config from API
|
||||
cy.apiGetConfig().then(({config}) => {
|
||||
expect(config.GoogleSettings.Secret).to.equal(FAKE_SETTING);
|
||||
expect(config.GoogleSettings.Id).to.equal('GoogleId');
|
||||
expect(config.GoogleSettings.DiscoveryEndpoint).to.equal('https://accounts.google.com/.well-known/openid-configuration');
|
||||
});
|
||||
|
||||
verifyOAuthLogin('Google', '', Cypress.config('baseUrl') + '/oauth/google/login');
|
||||
});
|
||||
|
||||
it('MM-T3621 - Set to Gitlab OpenId', () => {
|
||||
cy.findByRole('link', {name: OPENID_LINK_NAME}).click();
|
||||
|
||||
// # Click the OpenId header dropdown
|
||||
cy.wait(TIMEOUTS.FIVE_SEC);
|
||||
cy.findByLabelText(SERVICE_PROVIDER_LABEL).select('gitlab').wait(TIMEOUTS.ONE_SEC);
|
||||
|
||||
cy.findByLabelText('GitLab Site URL:').clear().type('https://gitlab.com');
|
||||
cy.findByLabelText(CLIENT_ID_LABEL).clear().type('GitlabId');
|
||||
cy.findByLabelText(CLIENT_SECRET_LABEL).clear().type('GitlabSecret');
|
||||
|
||||
cy.findByRole('button', {name: SAVE_BUTTON_NAME}).click().wait(TIMEOUTS.ONE_SEC);
|
||||
|
||||
// * Get config from API
|
||||
cy.apiGetConfig().then(({config}) => {
|
||||
expect(config.GitLabSettings.Secret).to.equal(FAKE_SETTING);
|
||||
expect(config.GitLabSettings.Id).to.equal('GitlabId');
|
||||
expect(config.GitLabSettings.DiscoveryEndpoint).to.equal('https://gitlab.com/.well-known/openid-configuration');
|
||||
});
|
||||
|
||||
verifyOAuthLogin('GitLab', '', Cypress.config('baseUrl') + '/oauth/gitlab/login');
|
||||
});
|
||||
|
||||
it('MM-T3622 - Set to Exchange OpenId', () => {
|
||||
cy.findByRole('link', {name: OPENID_LINK_NAME}).click();
|
||||
|
||||
// # Click the OpenId header dropdown
|
||||
cy.wait(TIMEOUTS.FIVE_SEC);
|
||||
cy.findByLabelText(SERVICE_PROVIDER_LABEL).select('office365').wait(TIMEOUTS.ONE_SEC);
|
||||
|
||||
cy.findByLabelText('Directory (tenant) ID:').clear().type('common');
|
||||
cy.findByLabelText(CLIENT_ID_LABEL).clear().type('Office365Id');
|
||||
cy.findByLabelText(CLIENT_SECRET_LABEL).clear().type('Office365Secret');
|
||||
|
||||
cy.findByRole('button', {name: SAVE_BUTTON_NAME}).click().wait(TIMEOUTS.ONE_SEC);
|
||||
|
||||
// * Get config from API
|
||||
cy.apiGetConfig().then(({config}) => {
|
||||
expect(config.Office365Settings.Secret).to.equal(FAKE_SETTING);
|
||||
expect(config.Office365Settings.Id).to.equal('Office365Id');
|
||||
expect(config.Office365Settings.DiscoveryEndpoint).to.equal('https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration');
|
||||
});
|
||||
verifyOAuthLogin('Entra ID', '', Cypress.config('baseUrl') + '/oauth/office365/login');
|
||||
});
|
||||
});
|
||||
|
||||
const verifyOAuthLogin = (text, color, href) => {
|
||||
cy.uiOpenSystemConsoleMainMenu('Log Out');
|
||||
|
||||
cy.waitUntil(() => cy.url().then((url) => {
|
||||
return url.includes('/login');
|
||||
}));
|
||||
|
||||
cy.url().then((url) => {
|
||||
const withExtra = url.includes('?extra=expired') ? '?extra=expired' : '';
|
||||
|
||||
// * Verify oauth login link
|
||||
cy.get('.external-login-button').then((btn) => {
|
||||
expect(btn.prop('href')).equal(`${href}${withExtra}`);
|
||||
|
||||
if (color) {
|
||||
const rbgArr = hexToRgbArray(color);
|
||||
expect(btn[0].style.color).equal(rgbArrayToString(rbgArr));
|
||||
expect(btn[0].style.borderColor).equal(rgbArrayToString(rbgArr));
|
||||
}
|
||||
|
||||
cy.get('.external-login-button-label').should('contain', text);
|
||||
});
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user