mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
make the bdd style tests run
This commit is contained in:
parent
33d053c9f5
commit
6a18a112b5
2 changed files with 53 additions and 52 deletions
|
@ -1,41 +1,55 @@
|
|||
define(function () {
|
||||
return function (bdd, expect, common, settingsPage) {
|
||||
console.log(arguments);
|
||||
return function () {
|
||||
bdd.it('something', function () {
|
||||
var testSubName = 'testSettingsInitialState';
|
||||
common.log('we have common stuff');
|
||||
define(function (require) {
|
||||
var Common = require('../../../support/pages/Common');
|
||||
var SettingsPage = require('../../../support/pages/SettingsPage');
|
||||
var expect = require('intern/dojo/node!expect.js');
|
||||
|
||||
return function (bdd) {
|
||||
bdd.describe('initial state', function () {
|
||||
var common;
|
||||
var settingsPage;
|
||||
|
||||
bdd.before(function () {
|
||||
common = new Common(this.remote);
|
||||
settingsPage = new SettingsPage(this.remote);
|
||||
});
|
||||
|
||||
bdd.it('should load with time pattern checked', function () {
|
||||
console.log(Object.keys(this));
|
||||
|
||||
return settingsPage.getTimeBasedEventsCheckbox().isSelected()
|
||||
.then(function (selected) {
|
||||
expect(selected).to.be.ok();
|
||||
})
|
||||
.then(function () {
|
||||
return settingsPage.getNameIsPatternCheckbox().isSelected()
|
||||
.then(function (nameIsPatternSelected) {
|
||||
expect(nameIsPatternSelected).to.not.be.ok();
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return settingsPage.getIndexPatternField()
|
||||
.then(function (patternField) {
|
||||
return patternField.getProperty('value')
|
||||
.then(function (pattern) {
|
||||
common.log('patternField value = ' + pattern);
|
||||
expect(pattern).to.be('logstash-*');
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return settingsPage.getTimeFieldNameField().isSelected()
|
||||
.then(function (timeFieldIsSelected) {
|
||||
common.log('timeField isSelected = ' + timeFieldIsSelected);
|
||||
expect(timeFieldIsSelected).to.not.be.ok();
|
||||
});
|
||||
})
|
||||
.catch(function screenshotError(reason) {
|
||||
return common.screenshotError(testSubName, reason);
|
||||
});
|
||||
|
||||
bdd.it('should load with name pattern unchecked', function () {
|
||||
return settingsPage.getNameIsPatternCheckbox().isSelected()
|
||||
.then(function (selected) {
|
||||
expect(selected).to.not.be.ok();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
bdd.it('should contain default index pattern', function () {
|
||||
var defaultPattern = 'logstash-*';
|
||||
|
||||
return settingsPage.getIndexPatternField().getProperty('value')
|
||||
.then(function (pattern) {
|
||||
expect(pattern).to.be(defaultPattern);
|
||||
})
|
||||
});
|
||||
|
||||
bdd.it('should not select the time field', function () {
|
||||
return settingsPage.getTimeFieldNameField().isSelected()
|
||||
.then(function (timeFieldIsSelected) {
|
||||
common.log('timeField isSelected = ' + timeFieldIsSelected);
|
||||
expect(timeFieldIsSelected).to.not.be.ok();
|
||||
});
|
||||
});
|
||||
|
||||
// var testSubName = 'testSettingsInitialState';
|
||||
// function screenshotError(reason) {
|
||||
// return common.screenshotError(testSubName, reason);
|
||||
// }
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
define(function (require) {
|
||||
var bdd = require('intern!bdd');
|
||||
var expect = require('intern/dojo/node!expect.js');
|
||||
var ScenarioManager = require('intern/dojo/node!../../../fixtures/scenarioManager');
|
||||
var pollUntil = require('intern/dojo/node!leadfoot/helpers/pollUntil');
|
||||
var Common = require('../../../support/pages/Common');
|
||||
var SettingsPage = require('../../../support/pages/SettingsPage');
|
||||
var HeaderPage = require('../../../support/pages/HeaderPage');
|
||||
var config = require('intern').config;
|
||||
var url = require('intern/dojo/node!url');
|
||||
var _ = require('intern/dojo/node!lodash');
|
||||
var initialStateTest = require('./_initial_state');
|
||||
|
||||
var Common = require('../../../support/pages/Common');
|
||||
var ScenarioManager = require('intern/dojo/node!../../../fixtures/scenarioManager');
|
||||
// var HeaderPage = require('../../../support/pages/HeaderPage');
|
||||
// var pollUntil = require('intern/dojo/node!leadfoot/helpers/pollUntil');
|
||||
|
||||
bdd.describe('settings app', function () {
|
||||
var common;
|
||||
var settingsPage;
|
||||
var headerPage;
|
||||
var scenarioManager;
|
||||
var remote;
|
||||
|
||||
|
@ -23,16 +20,11 @@ define(function (require) {
|
|||
// that we will use for all the tests
|
||||
bdd.before(function () {
|
||||
common = new Common(this.remote);
|
||||
settingsPage = new SettingsPage(this.remote);
|
||||
common.log('running bdd.before');
|
||||
headerPage = new HeaderPage(this.remote);
|
||||
scenarioManager = new ScenarioManager(url.format(config.elasticsearch));
|
||||
remote = this.remote;
|
||||
console.log('common = ', common);
|
||||
});
|
||||
|
||||
bdd.beforeEach(function () {
|
||||
|
||||
// start each test with an empty kibana index
|
||||
return scenarioManager.reload('emptyKibana')
|
||||
// and load a minimal set of makelogs data
|
||||
|
@ -64,12 +56,7 @@ define(function (require) {
|
|||
return scenarioManager.unload('makelogs');
|
||||
});
|
||||
|
||||
/*
|
||||
** Test the default state of checboxes and the 2 text input fields
|
||||
*/
|
||||
bdd.describe('initial state', function () {
|
||||
initialStateTest(bdd, expect, common, settingsPage);
|
||||
});
|
||||
require('./_initial_state')(bdd);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue