Hi,
I have a protractor test in which I would like to check the count of select
boxes.
I am using chai as promised: (see also link
here: https://angular.github.io/protractor/#/frameworks)
The problem is that I don't want to resolve the promise manually like below
(see (2) ).
I am using mocha, chai by the way.
Could you please help me?
*// Page Object*
var ProductDetailPO = function () {
// ...
};
ProductDetailPO.prototype = Object.create({}, {
selectBoxesNumber: {
get: function () {
*return element.all(by.css('.dropdownSelect')).count();*
}
}
});
module.exports = ProductDetailPO;
*// productDetail.spec.js*
var po = new ProductDetailPO();
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
var expect = chai.expect;
*// Doesn't work like that (1)*
it('only one select should be enabled "',
function () {
expect(po.selectBoxesCount).to.be.above(5);
});
*// The following would work: (2)*
po.selectBoxesCount.then(function (number) {
expect(number).to.equal(5);
});
greetings
jens
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.