yaml测试用例结构与关键字使用-valiables变量声明与引用

yaml测试用例结构与关键字使用-valiables变量声明与引用
valiables变量声明与引用
  teststeps中变量对当前的step有效  config中变量在整个yaml中都生效  但如果config和teststeps中都有变量,那么 局部变量大于全局变量  接口/login_var.yml
config:    name: 登录用例    variables:        user: test        psw: "123456"teststeps:-    name: step-登录    variables:        user: test1        psw: "123456"    request:        method: POST        url: http://127.0.0.1:端口号/api/test/login        json:            username: $user            password: $psw    validate:    - eq: [status_code, 200]    - eq: [body.code, 0]- eq: [body.username, test]    - len_eq: [body.token, 40]
config:    name: 登录用例    variables:        user: test1        psw: "123456"teststeps:-    name: step-登录#    variables:#        user: test1#        psw: "123456"    request:        method: POST        url: http://127.0.0.1:端口号/api/test/login        json:            username: $user            password: $psw    validate:    - eq: [status_code, 200]    - eq: [body.code, 0]- eq: [body.username, $user]    - len_eq: [body.token, 40]-    name: step-登录 test    request:        method: POST        url: http://127.0.0.1:端口号/api/test/login        json:            username: $user            password: $psw    validate:    - eq: [status_code, 200]    - eq: [body.code, 0]- eq: [body.username, $user]    - len_eq: [body.token, 40]

免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部