Test is marked Pass, when Canopy assertion "==" fails and returns error
See original GitHub issueI am new to Canopy and F#, still trying to get my head around these. In the following code, I just want a simple assertion “==” to make my test fail and mark it as Fail in the Reporter file. For some reason, the test is Pass, although the error was thrown.
"ILS Make a search by selecting each option from the AutoComplete list" &&& fun _ ->
"#Location" << "California"
sleep 5
highlight "#psrk-autocomplete"
sleep 1
let autoCompleteListOfOptions = (elements "#psrk-autocomplete a")
for i = 0 to autoCompleteListOfOptions.Length - 1 do
let optionToBeSelected = (nth i "#psrk-autocomplete a")
let optionToBeSelectedText = read optionToBeSelected
sleep 1
click (optionToBeSelected)
sleep 1
"#Location" == "blabla" // I want to make sure, that when this assertion fails, the test is marked as FAIL
sleep 3
clear "#Location"
"#Location" << "California"
sleep 3
I tried other assertions too : “===”, “!=” and same thing happens. What am i missing? Please help me.
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (10 by maintainers)
Top Results From Across the Web
TestNG showing as test passed even if assertion fails
A test execution framework (TestNG, JUnit, etc.) has simply no knowledge that any assertion failed.
Read more >mocha test passes even when assertion fail if async ...
1 Answer. Assertion libraries (like chai) have functions like expect and assert that will throw exceptions when the condition they are checking ...
Read more >Postman assertion tests are passing when they actually ...
So far, it seems like Postman is skipping pm.test() and marking it as Passed if the response is some kind of validation error....
Read more >Assertions In Selenium Using Junit And TestNG Frameworks
A test case is considered to be passed only if all the assertions have been met. ... marked as Failed when a hard...
Read more >Assert and Verify Methods in Selenium
The test case is marked as failed. In case of an assertion error, it will throw the “java.lang.AssertionError” exception.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s working great! Thank you, too, for looking into it and finding a very good fix! 😃
I am going to close this issue, if you have any more bugs/questions please feel free to open new issues!