Last active
November 14, 2022 06:07
-
-
Save laojala/4bb26f69495c9ca639ea2ac6ead9d5f1 to your computer and use it in GitHub Desktop.
Evaluates if variable passed from command line is Boolean type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** Settings *** | |
Documentation Evaluates if variable passed from command line is Boolean type | |
... Requires Robot Framework version 3.2 or newer | |
... Arguments are passed for a test like this: | |
... robot --variable MY_BOOLEAN:False path/to/this/file | |
... Tests pass both for "True" and "False" and should fail for any other inputs. | |
*** Variables *** | |
${MY_BOOLEAN} not boolean - tests fail with this | |
*** Test Cases *** | |
Variable Type Should Be Boolean | |
${is_boolean} Evaluate type(${MY_BOOLEAN}) == bool | |
Should Be True ${is_boolean} | |
Variable Type Should Be Boolean - Python Inline Evaluation | |
[Documentation] Uses Python Inline Evaluation | |
... Testing same thing as "Variable Should Be True" | |
Should Be True ${{ type(${MY_BOOLEAN}) == bool }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment