Skip to content

Commit a25344d

Browse files
committed
Fixing the unit test for expect not visible
1 parent 8e342aa commit a25344d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/api/expect/visible.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ VisibleAssertion.prototype.executeCommand = function(callback) {
3030
};
3131

3232
VisibleAssertion.prototype.elementFound = function() {
33-
this.passed = this.negate ? !this.resultValue : this.resultValue;
33+
this.passed = this.negate ? this.resultValue === false : this.resultValue;
3434
this.expected = this.negate ? 'not visible' : 'visible';
3535
this.actual = this.resultValue ? 'visible' : 'not visible';
3636

test/src/api/expect/testExpectVisible.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ module.exports = {
157157
},
158158

159159
'to not be visible with waitFor [FAILED]': function (done) {
160-
this.client.api.globals.waitForConditionPollInterval = 10;
160+
this.client.api.globals.waitForConditionPollInterval = 15;
161161

162-
Nocks.elementFound().visible().visible().visible();
162+
Nocks.elementFound().visible().visible();
163163

164164
var expect = this.client.api.expect.element('#weblogin').to.not.be.visible.before(25);
165165
this.client.once('nightwatch:finished', function (results, errors) {
166166
assert.equal(expect.assertion.waitForMs, 25);
167-
assert.equal(expect.assertion.passed, false);
168167
assert.equal(expect.assertion.message, 'Expected element <#weblogin> to not be visible in 25ms');
168+
assert.equal(expect.assertion.passed, false);
169169
done();
170170
});
171171

0 commit comments

Comments
 (0)