There seems to be an intentional failure in the following step test:
Then(/^the 150 button has been deselected$/, function () {
driver.sleep(5000);
var checboxValue = driver.findElement(By.css('#app > div > div > div > div.col-xs-offset-2.col-xs-10 > div > div > div:nth-child(3) > div:nth-child(1) > div:nth-child(6) > div > label:nth-child(2) > input[type="checkbox"]'))
checboxValue.isSelected()
.then((val) => { return assert.equal(val, true) })
})
Despite intentionally failing the above step, the next step fails with the correct error message:
When(/^Date 1 is entered$/, function () {
var dateInput1 = driver.findElement(By.css('#app > div > div > div > div.col-xs-offset-2.col-xs-10 > div > div > div:nth-child(3) > div:nth-child(1) > div:nth-child(5) > div > div:nth-child(1) > input'));
dateInput1.click();
driver.sleep(8000);
return dateInput1.sendKeys('2017-07-13');
})
The command line output looks like this:
(tick)Then the 150 button has been deselected # features\step_definitions\task_2.js:23
× When Date 1 is entered # features\step_definitions\task_2.js:30
AssertionError: false == true
+ expected - actual
-false
+true
It's puzzling why the 'Then' step passed and the 'When' step failed as it should not have been executed due to the previous step failing.
Any insights or explanations would be appreciated.