-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Originally submitted to Google Code by bryan.oakley on 1 Apr 2011
It would be nice if there was a keyword that would skip a test under certain conditions. For example "Skip" would simply skip the remainder of the test. Another example would be a "Skip if" keyword, that works like "Run keyword if" keyword. This would skip the test only under certain conditions (eg: skip if | ${featureA} != "enabled")
Use cases:
One use case is for testing robot itself (or robot libraries) -- both test cases and test data in the form of other test cases could be in the same suite. Test cases used as test data could have their first statement as "Skip" so that they don't actually run. Then, robot could write tests using those cases, such as making sure they parse ok, etc.
As a real world example, we're writing a tool that can run a test suite through a set of rules to measure the quality of the suite or to certify that the suite is ready to be committed to ci (for example, no duplicate names, every test must have a tag that identifies a defect or story id, etc). This skip feature would be useful for writing test suites that test this functionality.
Another use case is for dynamically skipping tests. For example, if a smoke test fails you could set a flag so that subsequent tests of a module aren't run. Or, you could determine at runtime which portions of a system under test are configured or online or whatever, and skip those that aren't. For example, if a suite of tests required the services of a networked device and it wasn't online, those tests could be skipped.
It would be best if Robot could support the status of "Skip" in addition to "Pass" and "Fail". If that's not possible I think it could have one of three behaviors; not sure which would be best:
-
the skipped test simply wouldn't appear in the report. It would be as if it had a tag that was in the ignored tags list.
-
the skipped test could show up on the report as passed, with a message of "skipped" or "skipped; condition '${feature!} != "enabled" not met'
-
the skipped test could show up on the report as failed, but it could automatically be flagged as non-critical so that it doesn't fail the whole suite