make the bdd style tests run
This commit is contained in:
parent
33d053c9f5
commit
6a18a112b5
|
@ -1,41 +1,55 @@
|
||||||
define(function () {
|
define(function (require) {
|
||||||
return function (bdd, expect, common, settingsPage) {
|
var Common = require('../../../support/pages/Common');
|
||||||
console.log(arguments);
|
var SettingsPage = require('../../../support/pages/SettingsPage');
|
||||||
return function () {
|
var expect = require('intern/dojo/node!expect.js');
|
||||||
bdd.it('something', function () {
|
|
||||||
var testSubName = 'testSettingsInitialState';
|
return function (bdd) {
|
||||||
common.log('we have common stuff');
|
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()
|
return settingsPage.getTimeBasedEventsCheckbox().isSelected()
|
||||||
.then(function (selected) {
|
.then(function (selected) {
|
||||||
expect(selected).to.be.ok();
|
expect(selected).to.be.ok();
|
||||||
})
|
})
|
||||||
.then(function () {
|
});
|
||||||
return settingsPage.getNameIsPatternCheckbox().isSelected()
|
|
||||||
.then(function (nameIsPatternSelected) {
|
bdd.it('should load with name pattern unchecked', function () {
|
||||||
expect(nameIsPatternSelected).to.not.be.ok();
|
return settingsPage.getNameIsPatternCheckbox().isSelected()
|
||||||
});
|
.then(function (selected) {
|
||||||
})
|
expect(selected).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 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) {
|
define(function (require) {
|
||||||
var bdd = require('intern!bdd');
|
var bdd = require('intern!bdd');
|
||||||
var expect = require('intern/dojo/node!expect.js');
|
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 config = require('intern').config;
|
||||||
var url = require('intern/dojo/node!url');
|
var url = require('intern/dojo/node!url');
|
||||||
var _ = require('intern/dojo/node!lodash');
|
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 () {
|
bdd.describe('settings app', function () {
|
||||||
var common;
|
var common;
|
||||||
var settingsPage;
|
|
||||||
var headerPage;
|
|
||||||
var scenarioManager;
|
var scenarioManager;
|
||||||
var remote;
|
var remote;
|
||||||
|
|
||||||
|
@ -23,16 +20,11 @@ define(function (require) {
|
||||||
// that we will use for all the tests
|
// that we will use for all the tests
|
||||||
bdd.before(function () {
|
bdd.before(function () {
|
||||||
common = new Common(this.remote);
|
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));
|
scenarioManager = new ScenarioManager(url.format(config.elasticsearch));
|
||||||
remote = this.remote;
|
remote = this.remote;
|
||||||
console.log('common = ', common);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
bdd.beforeEach(function () {
|
bdd.beforeEach(function () {
|
||||||
|
|
||||||
// start each test with an empty kibana index
|
// start each test with an empty kibana index
|
||||||
return scenarioManager.reload('emptyKibana')
|
return scenarioManager.reload('emptyKibana')
|
||||||
// and load a minimal set of makelogs data
|
// and load a minimal set of makelogs data
|
||||||
|
@ -64,12 +56,7 @@ define(function (require) {
|
||||||
return scenarioManager.unload('makelogs');
|
return scenarioManager.unload('makelogs');
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
require('./_initial_state')(bdd);
|
||||||
** Test the default state of checboxes and the 2 text input fields
|
|
||||||
*/
|
|
||||||
bdd.describe('initial state', function () {
|
|
||||||
initialStateTest(bdd, expect, common, settingsPage);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue