Assert.equal not returning properly
Hi @DavertMik!
Since updating to v0.3.0 I am having problems with assert.equal when the assert fails:
Here a little code snippet to show what I mean:
Before((I) => {
I.amOnPage('/');
});
Scenario.only(
'Navigating to prev week check date picker value',
function* prev(I, actionBarTop, appointmentPage) {
assert.equal(true, false);
});
Navigation --
Navigating to prev week check date picker value
• I am on page "https://www.test.com"
and after that the test just finishes, without failing properly
On the otherhand with assert.equal(true, true) the tests passes
Is there some problem with assert?
UPDATE:
I have got the impression that is has to do with your new handling of errors in the scenario.js:
Line 22: recorder.add(() => done(err), true);
Might be the issue?
I have got the impression that is has to do with your new handling of errors in the scenario.js
That maybe it. It was important to make promise-based assertions work, didn't check for non-promises
This is pretty rare case, as if you
a) not using generator function
b) use yield before performing assertion
everything works fine. Anyway, going to fix that
Also hitting this. It seems worse than this description, though: no assertions work after the 1st yield. So it doesn't work under any circumstance where you've queried the page for data and need to assert its value.
I've had similar symptoms with custom helpers. The when the test passes the message is OK, if it fails I get no feedback with errors.
Tested in v0.6.3
Before((I, authPage) => {
I.amOnPage(authPage.url);
});
Scenario.only('foo test', function*(I) {
var bla = yield I.grabTextFrom('//button')
assert.equal(bla, 'foo');
});
'Enter' == 'foo'
+ expected - actual
-Enter
+foo
Everything works as expected. Closing this issue