If say I've a 100 test cases to run in which test case no 24, 38 and 99 are interdependent. Then is it possible that while the 99th test case is getting executed you find out the status of a previously executed test case (say the 24th or 38th test case)? In my case, the 99th test case depends on the status of the 38th and the 24th test case and thus, if either the 24th or the 38th fails I would like the 99th test case NOT to get executed at all and thus save me a lot of time. Kindly, explain with some example if possible. Thanks in advance!
相关问题
- Flush single app django 1.9
- TestCafe - The browser always starts in clean slat
- How to stop a dbus gobject loop
- Python's difflib SequenceMatcher speed up
- Getting 'Missing required field: member' w
相关文章
- Is there a size limit for HTTP response headers on
- Web Test recorder does not allow me to record a te
- Does there exist empty class in python?
- Factory_girl has_one relation with validates_prese
- ImportError: No module named twisted.persisted.sty
- Get a header with Python and convert in JSON (requ
- What is the difference between `assert_frame_equal
- python unit testing methods inside of classes
Once robot starts running, there's no way to skip a test based on some condition. I think this is one of the weaknesses of robot, but the designers really don't seem to like the notion of skipped tests. Also, there's no built-in way for one test to depend on another. A feature request for this very feature was declined.
However, robot is very extensible, and a feature that was introduced in version 2.8.5 makes it easy to write a keyword that will fail if another test has failed.This feature is the ability for a library to act as a listener. With this, a library can keep track of the pass/fail status of each test. With that knowledge, you can create a keyword that fails immediately if some other test fails.
The basic idea is, cache the pass/fail status as each test finishes (via the special
_end_test
method). Then, use this value to determine whether to fail immediately or not.Here's an example of how to use such a keyword:
Here is the library definition:
To solve this problem I'm using something like this:
so maybe this will be usable also for you.