I am using Serenity-js BDD framework with screenplay pattern in my project. Here I am not able to perform assertion for visibility of an element on web-page using Ensure class's "that" method.
Code :
Page Element -
static searchPatientsVerificationRow = Target.the('verification record').located(by.xpath("//div[@class='row']//tr"));
Test Script Step :
return Ensure.that(TaggingSearchControls.searchPatientsVerificationRow,Is.visible())
Error :
Argument of type 'SuccessCondition' is not assignable to parameter of type 'Assertion'. Property 'answeredBy' is missing in type 'SuccessCondition' but required in type 'Assertion'
It seems like the code sample you posted might be using a mixture of Serenity/JS 1.x and 2.x syntax.
With Serenity/JS version 2, which you can get by installing the following dependencies (see an example):
you'd write it as follows:
With Serenity/JS version 1 you'd need to extract a
WebElementfrom theTargetfirst:Hope this helps!
Jan