question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test is marked Pass, when Canopy assertion "==" fails and returns error

See original GitHub issue

I 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. 2016-11-16 17_56_20-canopy test results

"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:closed
  • Created 7 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
adalenthyacommented, Nov 22, 2016

It’s working great! Thank you, too, for looking into it and finding a very good fix! 😃

0reactions
lefthandedgoatcommented, Dec 1, 2016

I am going to close this issue, if you have any more bugs/questions please feel free to open new issues!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found