I want to do some action in case Selector('#particularButton-view').exists is true and some other action in case is false.
The problem is that it doesn't return a boolean. It returns some object. It's made to be used like this:
testController.expect(Selector('#particularButton-view').exists).ok()
How can I do to perform some action in each case?
Selector properties are wrapped in Promises, so to obtain a value you can use await from ES2017:
await Selector('...').exists;
If you can't use await, you can get the value by using then method of the promise, like:
Selector('...')
.exists
.then(exists => {
If (exists)
Foo();
else
Bar();
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With