-
-
-
-
+ {this.renderBrandingEnabledOrDisabledLogo()}
+
-
+
diff --git a/src/plugins/home/public/application/opensearch_dashboards_services.ts b/src/plugins/home/public/application/opensearch_dashboards_services.ts
index a5b9fe616a24..7a7dc60a3d1d 100644
--- a/src/plugins/home/public/application/opensearch_dashboards_services.ts
+++ b/src/plugins/home/public/application/opensearch_dashboards_services.ts
@@ -68,6 +68,14 @@ export interface HomeOpenSearchDashboardsServices {
environmentService: EnvironmentService;
telemetry?: TelemetryPluginStart;
tutorialService: TutorialService;
+ injectedMetadata: {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+ getBranding: () => {
+ logoUrl?: string;
+ smallLogoUrl?: string;
+ title: string;
+ };
+ };
}
let services: HomeOpenSearchDashboardsServices | null = null;
diff --git a/src/plugins/home/public/plugin.ts b/src/plugins/home/public/plugin.ts
index eef92ea8ec99..c0ef1c2b56ff 100644
--- a/src/plugins/home/public/plugin.ts
+++ b/src/plugins/home/public/plugin.ts
@@ -119,6 +119,7 @@ export class HomePublicPlugin
homeConfig: this.initializerContext.config.get(),
tutorialService: this.tutorialService,
featureCatalogue: this.featuresCatalogueRegistry,
+ injectedMetadata: coreStart.injectedMetadata,
});
coreStart.chrome.docTitle.change(
i18n.translate('home.pageTitle', { defaultMessage: 'Home' })
diff --git a/test/common/config.js b/test/common/config.js
index be5baaa5d055..05432914a95b 100644
--- a/test/common/config.js
+++ b/test/common/config.js
@@ -60,7 +60,7 @@ export default function () {
`--opensearch.hosts=${formatUrl(servers.opensearch)}`,
`--opensearch.username=${opensearchDashboardsServerTestUser.username}`,
`--opensearch.password=${opensearchDashboardsServerTestUser.password}`,
- `--home.disableWelcomeScreen=true`,
+ `--home.disableWelcomeScreen=false`,
// Needed for async search functional tests to introduce a delay
`--data.search.aggs.shardDelay.enabled=true`,
//`--security.showInsecureClusterWarning=false`,
@@ -76,6 +76,8 @@ export default function () {
// `--newsfeed.service.pathTemplate=/api/_newsfeed-FTS-external-service-simulators/opensearch-dashboards/v{VERSION}.json`,
// Custom branding config
`--opensearchDashboards.branding.logoUrl=https://opensearch.org/assets/brand/SVG/Logo/opensearch_logo_darkmode.svg`,
+ `--opensearchDashboards.branding.smallLogoUrl=https://opensearch.org/assets/brand/SVG/Logo/opensearch_logo_darkmode.svg`,
+ `--opensearchDashboards.branding.title=OpenSearch`,
],
},
services,
diff --git a/test/functional/apps/visualize/_custom_branding.js b/test/functional/apps/visualize/_custom_branding.js
index b783a3e5acab..1263914dbb36 100644
--- a/test/functional/apps/visualize/_custom_branding.js
+++ b/test/functional/apps/visualize/_custom_branding.js
@@ -30,29 +30,82 @@
* GitHub history for details.
*/
import expect from '@osd/expect';
+import { UI_SETTINGS } from '../../../../src/plugins/data/common';
export default function ({ getService, getPageObjects }) {
const browser = getService('browser');
const globalNav = getService('globalNav');
+ const opensearchArchiver = getService('opensearchArchiver');
+ const opensearchDashboardsServer = getService('opensearchDashboardsServer');
const PageObjects = getPageObjects(['common', 'home', 'header']);
+ const testSubjects = getService('testSubjects');
- describe('OpenSearch Dashboards branding configuration', function customLogo() {
- this.tags('includeFirefox');
- const expectedUrl = 'https://opensearch.org/assets/brand/SVG/Logo/opensearch_logo_darkmode.svg';
- before(async function () {
- await PageObjects.common.navigateToApp('home');
- });
+ describe('OpenSearch Dashboards branding configuration', function customHomeBranding() {
+ describe('should render welcome page', async () => {
+ this.tags('includeFirefox');
+ const expectedWelcomeLogo =
+ 'https://opensearch.org/assets/brand/SVG/Logo/opensearch_logo_darkmode.svg';
+ const expectedWelcomeMessage = 'Welcome to OpenSearch';
+
+ //unloading any pre-existing settings so the welcome page will appear
+ before(async function () {
+ await opensearchArchiver.unload('logstash_functional');
+ await opensearchArchiver.unload('long_window_logstash');
+ await opensearchArchiver.unload('visualize');
+ await PageObjects.common.navigateToApp('home');
+ });
+
+ //loading the settings again for
+ after(async function () {
+ await browser.setWindowSize(1280, 800);
+ await opensearchArchiver.loadIfNeeded('logstash_functional');
+ await opensearchArchiver.loadIfNeeded('long_window_logstash');
+ await opensearchArchiver.load('visualize');
+ await opensearchDashboardsServer.uiSettings.replace({
+ defaultIndex: 'logstash-*',
+ [UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b',
+ });
+ });
+
+ it('with customized logo', async () => {
+ await testSubjects.existOrFail('welcomeCustomLogo');
+ const actualLabel = await testSubjects.getAttribute(
+ 'welcomeCustomLogo',
+ 'data-test-image-url'
+ );
+ expect(actualLabel.toUpperCase()).to.equal(expectedWelcomeLogo.toUpperCase());
+ });
- it('should show customized logo in Navbar on the main page', async () => {
- await globalNav.logoExistsOrFail(expectedUrl);
+ it('with customized title', async () => {
+ await testSubjects.existOrFail('welcomeCustomTitle');
+ const actualLabel = await testSubjects.getAttribute(
+ 'welcomeCustomTitle',
+ 'data-test-title-message'
+ );
+ expect(actualLabel.toUpperCase()).to.equal(expectedWelcomeMessage.toUpperCase());
+ });
});
- it('should show a customized logo that can take to home page', async () => {
- await PageObjects.common.navigateToApp('settings');
- await globalNav.clickLogo();
- await PageObjects.header.waitUntilLoadingHasFinished();
- const url = await browser.getCurrentUrl();
- expect(url.includes('/app/home')).to.be(true);
+ describe('should render home page', async () => {
+ this.tags('includeFirefox');
+ const expectedUrl =
+ 'https://opensearch.org/assets/brand/SVG/Logo/opensearch_logo_darkmode.svg';
+
+ before(async function () {
+ await PageObjects.common.navigateToApp('home');
+ });
+
+ it('with customized logo in Navbar', async () => {
+ await globalNav.logoExistsOrFail(expectedUrl);
+ });
+
+ it('with customized logo that can take back to home page', async () => {
+ await PageObjects.common.navigateToApp('settings');
+ await globalNav.clickLogo();
+ await PageObjects.header.waitUntilLoadingHasFinished();
+ const url = await browser.getCurrentUrl();
+ expect(url.includes('/app/home')).to.be(true);
+ });
});
});
}
diff --git a/test/functional/page_objects/common_page.ts b/test/functional/page_objects/common_page.ts
index d6a018c96b50..57ff47e81cf7 100644
--- a/test/functional/page_objects/common_page.ts
+++ b/test/functional/page_objects/common_page.ts
@@ -68,8 +68,9 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
// Disable the welcome screen. This is relevant for environments
// which don't allow to use the yml setting, e.g. cloud production.
// It is done here so it applies to logins but also to a login re-use.
- await browser.setLocalStorageItem('home:welcome:show', 'false');
+ // Update: Enable the welcome screen for functional tests on the welcome screen.
+ await browser.setLocalStorageItem('home:welcome:show', 'true');
let currentUrl = await browser.getCurrentUrl();
log.debug(`currentUrl = ${currentUrl}\n appUrl = ${appUrl}`);
await testSubjects.find('opensearchDashboardsChrome', 6 * defaultFindTimeout); // 60 sec waiting