[dashboard] disable toast auto-hiding (#11248)

* [dashboard] disable toast auto-hiding

* [functional/service/kibanaServer] describe disableToastAutohide() method
This commit is contained in:
Spencer 2017-04-15 18:08:24 -07:00 committed by GitHub
parent d6e15a7a1c
commit 0c67890bd9
2 changed files with 21 additions and 0 deletions

View file

@ -2,12 +2,16 @@ import expect from 'expect.js';
export default function ({ getService, getPageObjects }) {
const testSubjects = getService('testSubjects');
const kibanaServer = getService('kibanaServer');
const remote = getService('remote');
const PageObjects = getPageObjects(['dashboard', 'header', 'common', 'visualize']);
const dashboardName = 'Dashboard View Edit Test';
describe('dashboard view edit mode', function viewEditModeTests() {
before(async function () {
await PageObjects.dashboard.initTests();
await kibanaServer.uiSettings.disableToastAutohide();
await remote.refresh();
});
after(async function () {

View file

@ -44,6 +44,23 @@ export class KibanaServerUiSettings {
return defaultIndex;
}
/**
* Sets the auto-hide timeout to 1 hour so that auto-hide is
* effectively disabled. This gives the tests more time to
* interact with the notifications without having to worry about
* them disappearing if the tests are too slow.
*
* @return {Promise<undefined>}
*/
async disableToastAutohide() {
await this.update({
'notifications:lifetime:banner': 360000,
'notifications:lifetime:error': 360000,
'notifications:lifetime:warning': 360000,
'notifications:lifetime:info': 360000,
});
}
async replace(doc) {
const { log, es } = this;
log.debug('updating kibana config doc: %j', doc);