zoukankan      html  css  js  c++  java
  • robot framework-断言

    *** Test Cases ***
    断言一
        #01、should contain 、 should not contain 与should contain x times
        @{list1}=    create list    3    a    ${28}    22    25 
        @{list2}=    set variable    3.0    a    ${28}    22    22
        @{list3}=    create list    
        ${string1}=    set variable    cq is a girl
        ${name}=    set variable    cq
        should contain    ${list2}    3.0
        should not contain    ${list2}    3
        should contain x times    ${list2}    22    2
    
    断言二
        #should be empty 与 should not be empty
        @{list1}=    create list    3    a    ${28}    22    25 
        @{list2}=    create list
        ${list3}=    create list    cq
        should be empty    ${list2}
        should not be empty    ${list1}
    
    断言三
        #should be equal 与 should not be equal
        @{list1}=    create list    3    a    ${28}    22    22    3.0
        should be equal    ${list1[3]}    ${list1[4]}
        should not be equal    ${list1[0]}    ${list1[5]}
    
    断言四
        #Should Be Equal As Numbers 与 Should not Be Equal As Numbers
         @{list1}=    create list    3    a    ${28}    22    3.98    3.0 
         should be equal as numbers    ${list1[0]}    ${list1[5]}
         should not be equal as numbers    ${list1[0]}    ${list1[4]}
         #说明:${list1[0]}=3,忽略精度,与3.0相等;忽略精度,1与3.98还是不相等的
    
    断言五
        #Should Be Equal As Integers与Should not Be Equal As Integers
        @{list1}=    create list    3    a    ${28}    22    3.98    3.0    3    ${3}
        should be equal as Integers    ${list1[0]}    ${list1[6]}
        should not be equal as Integers    ${list1[0]}    ${list1[3]}
    
    断言六
        #Should Be True与Should not Be True
        @{list1}=    create list    3    a    ${28}    22    3.98    3.0    3    ${3}
        should be true    ${list1[0]}<${list1[3]}
        should not be true    ${list1[4]}<${list1[0]}  
    
    断言七
        #Should start With与Should not start With 
        ${string1}=    set variable    cq is a girl
        should start with    ${string1}    cq
        should not start with    ${string1}    cd   
    
    断言八
        #Should End With与Should not End With
        ${string1}=    set variable    cq is a girl
        should end with    ${string1}    girl
        should not end with    ${string1}    girls  
    
    断言九
        #should match与 should not match
        @{list1}=    create list    cq    a    ${28}    22    3.98    3.0    3    ${3}
        should match    ${list1[0]}    c?
        should not match    ${list1[0]}    a?
        #模式匹配和shell中的通配符类似,区分大小写,'*'匹配0~无穷多个字符,“?”匹配单个字符
  • 相关阅读:
    ZooKeeper系列
    CST和GMT时间的区别
    ZooKeeper系列之二:Zookeeper常用命令
    分布式服务框架 Zookeeper -- 管理分布式环境中的数据
    ZooKeeper资料
    分布式选举算法
    初识ZooKeeper与集群搭建实例
    原子广播
    Apache ZooKeeper
    工作流引擎
  • 原文地址:https://www.cnblogs.com/chengchengla1990/p/8910333.html
Copyright © 2011-2022 走看看