常用断言关键字(rf中)
断言关键字 |
描述 |
||||||||||
Should Be Empty |
判断是否为空,如果不为空,执行失败,示例:
|
||||||||||
Should Start With |
判断某个字符串是否以预期执行的字符串开始,如果以指定的字符串开头,则执行成功,否则执行失败,示例
|
||||||||||
Should Not Start With |
与Should Start With刚好相反,如果以指定的字符串开头,则执行失败,否则执行成功,示例:
|
||||||||||
Should Match |
判断某个字符串是否与预期指定的字符串相匹配,如果可以匹配,则执行成功,否则执行失败,示例:
|
||||||||||
Should Not Match |
与Should Match刚好相反,如果字符串匹配,则执行失败,否则执行成功,示例:
|
||||||||||
Should Contain X Times |
与Should Contain 关键字类似,用来判断指定的字符串包含指定的字符或者字符串多少次,示例:
|
||||||||||
Should Be Equal As Integers |
以整数的形式来进行比较,示例:
|
||||||||||
Should Be Equal As Strings |
以字符串的形式来进行比较,示例:
|
||||||||||
Should Be Equal As Numbers |
以number的形式来进行比较,示例:
|
||||||||||
Should Not Be Equal |
与should be equal 用法相反,当带比较的两个值相等时,执行失败,否则执行成功,示例:
|
||||||||||
Should Not Be Empty |
与should be empty 用法相反,如果为空,执行失败,示例:
|