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~无穷多个字符,“?”匹配单个字符

    原文地址:https://www.cnblogs.com/chengchengla1990/p/8910333.html

  • 相关阅读:
    在 django 中使用 mako or jinja2 (精简版) Python,Django language ITeye论坛
    Python发送WEB请求,并对WEB内容进行解析 lpxuan151009的专栏 博客频道 CSDN.NET
    egg hurt for django native template engine
    Java内部类与相关的设计模式(一)
    struts2官方入门案列curd 编辑
    中文标点符号unicode码
    浏览器与服务器连接
    为什么ListView.setOnItemClickListener、setOnCreateContextMenuListener会无效为什么ListView.setOnItemClickListen
    domino批量替换邮件模板
    ubuntu12.04上安装flashcahce
  • 原文地址:https://www.cnblogs.com/dydxw/p/10537286.html
Copyright © 2011-2022 走看看