rx-page-objects
Advanced tools
Comparing version 1.20.0 to 1.21.0
@@ -434,3 +434,58 @@ /*jshint node:true*/ | ||
var rxOptionTable = require('./index').rxOptionTable; | ||
/** | ||
* rxOptionTable exercises. | ||
* @exports encore.exercise.rxOptionTable | ||
* @param {Object} [options=] - Test options. Used to build valid tests. | ||
* @param {string} [options.cssSelector=] - Fallback selector string to initialize widget with. | ||
* @param {string} [options.visible=true] - Determines if the option table is visible | ||
* @param {string} [options.empty=false] - Determines if the option table is empty | ||
*/ | ||
exports.rxOptionTable = function (options) { | ||
if (options === undefined) { | ||
options = {}; | ||
} | ||
options = _.defaults(options, { | ||
visible: true, | ||
empty: false | ||
}); | ||
return function () { | ||
var component; | ||
before(function () { | ||
if (options.cssSelector === undefined) { | ||
component = rxOptionTable.main; | ||
} else { | ||
component = rxOptionTable.initialize($(options.cssSelector)); | ||
} | ||
}); | ||
it('should ' + (options.visible ? 'be' : 'not be') + ' visible', function () { | ||
expect(component.isDisplayed()).to.eventually.eq(options.visible); | ||
}); | ||
if (options.empty) { | ||
it('should be empty', function () { | ||
expect(component.isEmpty()).to.eventually.be.true; | ||
}); | ||
it('should have a "table empty" error message', function () { | ||
expect(component.emptyMessage).to.eventually.not.be.null; | ||
}); | ||
} else { | ||
it('should not be empty', function () { | ||
expect(component.isEmpty()).to.eventually.be.false; | ||
}); | ||
it('should not have a "table empty" error message', function () { | ||
expect(component.emptyMessage).to.eventually.be.null; | ||
}); | ||
} | ||
}; | ||
}; | ||
var rxPaginate = require('./index').rxPaginate; | ||
@@ -437,0 +492,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "Midway test page objects for all of the Encore UI components", | ||
"version": "1.20.0", | ||
"version": "1.21.0", | ||
"main": "index.js", | ||
@@ -8,0 +8,0 @@ "license": "Apache License, Version 2.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
301840
4948