From 2b7bba593b4f158ce2c2063dc3db9d4830942817 Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Thu, 6 Aug 2020 09:03:47 -0700 Subject: [PATCH] Add functional tests confirming that document titles updated --- test/functional/services/common/browser.ts | 8 ++++++++ .../with_host_configured/app_search/engines.ts | 3 +++ .../without_host_configured/app_search/setup_guide.ts | 3 +++ .../workplace_search/setup_guide.ts | 3 +++ 4 files changed, 17 insertions(+) diff --git a/test/functional/services/common/browser.ts b/test/functional/services/common/browser.ts index c38ac771e41625..b0eec5e24f635a 100644 --- a/test/functional/services/common/browser.ts +++ b/test/functional/services/common/browser.ts @@ -163,6 +163,14 @@ export async function BrowserProvider({ getService }: FtrProviderContext) { return currentWithoutTime; } + /** + * Gets the page/document title of the focused window/frame. + * https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/chrome_exports_Driver.html#getTitle + */ + public async getTitle() { + return await driver.getTitle(); + } + /** * Navigates the focused window/frame to a new URL. * https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/chrome_exports_Driver.html#get diff --git a/x-pack/test/functional_enterprise_search/apps/enterprise_search/with_host_configured/app_search/engines.ts b/x-pack/test/functional_enterprise_search/apps/enterprise_search/with_host_configured/app_search/engines.ts index 1742ed443984ba..85ae4d77b828ff 100644 --- a/x-pack/test/functional_enterprise_search/apps/enterprise_search/with_host_configured/app_search/engines.ts +++ b/x-pack/test/functional_enterprise_search/apps/enterprise_search/with_host_configured/app_search/engines.ts @@ -52,6 +52,9 @@ export default function enterpriseSearchSetupEnginesTests({ await retry.try(async function () { const currentUrl = await browser.getCurrentUrl(); expect(currentUrl).to.contain('/app_search'); + + const documentTitle = await browser.getTitle(); + expect(documentTitle).to.contain('App Search - Elastic'); }); }); diff --git a/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/app_search/setup_guide.ts b/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/app_search/setup_guide.ts index 76a47cc4a7e105..86c35db504eaba 100644 --- a/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/app_search/setup_guide.ts +++ b/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/app_search/setup_guide.ts @@ -29,6 +29,9 @@ export default function enterpriseSearchSetupGuideTests({ await retry.try(async function () { const currentUrl = await browser.getCurrentUrl(); expect(currentUrl).to.contain('/app_search/setup_guide'); + + const documentTitle = await browser.getTitle(); + expect(documentTitle).to.contain('Setup Guide - App Search - Elastic'); }); }); }); diff --git a/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/workplace_search/setup_guide.ts b/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/workplace_search/setup_guide.ts index 20145306b21c8e..81d600952cd438 100644 --- a/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/workplace_search/setup_guide.ts +++ b/x-pack/test/functional_enterprise_search/apps/enterprise_search/without_host_configured/workplace_search/setup_guide.ts @@ -29,6 +29,9 @@ export default function enterpriseSearchSetupGuideTests({ await retry.try(async function () { const currentUrl = await browser.getCurrentUrl(); expect(currentUrl).to.contain('/workplace_search/setup_guide'); + + const documentTitle = await browser.getTitle(); + expect(documentTitle).to.contain('Setup Guide - Workplace Search - Elastic'); }); }); });