First-off, thanks for the chai-smoothie!
I've been trying to polish some of the test code and use chai-smoothie more, but I have ran into some trouble:
This is what it looked like before:
return expect(Promise.all([
userMenuPage.userMenuItemIcon.isDisplayed(),
userMenuPage.userMenuItemText().isDisplayed()
])).to.eventually.be.eql([true, true])
and this is how I expected it to work in chai smoothie
expect(userMenuPage.userMenuItemIcon).to.eventually.be.displayed
expect(userMenuPage.userMenuItemText()).to.eventually.be.displayed
when running the new code, I receive the following error:
Step Definition: steps/userMenuSteps.js:23
Message:
TypeError: assertion._obj.locator is not a function
at <repo>/tests/node_modules/chai-smoothie/lib/src/chai-smoothie.ts:42:65
at <repo>/tests/node_modules/protractor/built/element.js:798:32
at ManagedPromise.invokeCallback_ (<repo>/tests/node_modules/selenium-webdriver/lib/promise.js:1379:14)
at TaskQueue.execute_ (<repo>/tests/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (<repo>/tests/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at asyncRun (<repo>/tests/node_modules/selenium-webdriver/lib/promise.js:2775:27)
at <repo>/tests/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (internal/process/next_tick.js:103:7)
Page model definition looks like this:
userMenuItemText: () => $('#desktop-menu #desktop-menu-classic span').getText(),
userMenuItemIcon: $('#desktop-menu #desktop-menu-classic .fa-fjunk'),
The issue is with the second row "userMenuPage.userMenuItemText().isDisplayed()". If I just use "userMenuPage.userMenuItemIcon.isDisplayed()", then I get no problem, and if I just use "userMenuPage.userMenuItemText().isDisplayed()", then I get the failure.
Do you have any recommendationts on how to overcome this and still use chai smoothie?