Skip to content

Commit

Permalink
Add functional tests confirming that document titles updated
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Aug 10, 2020
1 parent 5d75916 commit 2b7bba5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/functional/services/common/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
});
Expand Down

0 comments on commit 2b7bba5

Please sign in to comment.